Postado Julho 25, 2016 8 anos function onUse(cid, item, fromPosition, itemEx, toPosition) local sBike = 2547 local t = { [14515] = {article='a', name='Bike', text='Montou na Bike,', dtext='Desceu da Bike', s=9999, condition=bikeCondition}, } function BikeSpeedOn(cid,nSpeed) setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid)) doChangeSpeed(cid,-getCreatureSpeed(cid)) doChangeSpeed(cid,nSpeed) end function BikeSpeedOff(cid) doChangeSpeed(cid,-getCreatureSpeed(cid)) doChangeSpeed(cid,getPlayerStorageValue(cid,sBike)) end local v, r = getCreaturePosition(cid), t[item.itemid] local s = r.s local pos = {x = v.x, y = v.y, z = v.z} if r then if getPlayerStorageValue(cid, 25000) == 5 then return end if getPlayerStorageValue(cid, 23000) == 5 then return end if getPlayerStorageValue(cid, 17001) == 1 or getPlayerStorageValue(cid, 63215) == 1 or getPlayerStorageValue(cid, 17000) == 1 then doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.") return true end if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == item.uid then doPlayerSendCancel("Não está no slot correto") return true end if getPlayerStorageValue(cid, s) <= 0 then doCreatureSay(cid, r.text, 19) setPlayerStorageValue(cid, s, 1) BikeSpeedOn(cid,1200) -- Speed da Bike if getPlayerSex(cid) == 1 then doSetCreatureOutfit(cid, {lookType = 2269, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1) else doSetCreatureOutfit(cid, {lookType = 2270, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1) end elseif getPlayerStorageValue(cid, s) == 1 then doCreatureSay(cid, r.dtext, 19) setPlayerStorageValue(cid, s, 0) BikeSpeedOff(cid) return doRemoveCondition(cid, CONDITION_OUTFIT) else return doPlayerSendCancel(cid, 'You can\'t do this.') end else return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.') end end <action itemid="14515" script="Bike.lua" /> Editado Julho 25, 2016 8 anos por JujuLady (veja o histórico de edições) ~ Se ajudei +Rep ~ Sheele
Postado Julho 25, 2016 8 anos Autor 1 hora atrás, JujuLady disse: function onUse(cid, item, fromPosition, itemEx, toPosition) local sBike = 2547 local t = { [14515] = {article='a', name='Bike', text='Montou na Bike,', dtext='Desceu da Bike', s=9999, condition=bikeCondition}, } function BikeSpeedOn(cid,nSpeed) setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid)) doChangeSpeed(cid,-getCreatureSpeed(cid)) doChangeSpeed(cid,nSpeed) end function BikeSpeedOff(cid) doChangeSpeed(cid,-getCreatureSpeed(cid)) doChangeSpeed(cid,getPlayerStorageValue(cid,sBike)) end local v, r = getCreaturePosition(cid), t[item.itemid] local s = r.s local pos = {x = v.x, y = v.y, z = v.z} if r then if getPlayerStorageValue(cid, 25000) == 5 then return end if getPlayerStorageValue(cid, 23000) == 5 then return end if getPlayerStorageValue(cid, 17001) == 1 or getPlayerStorageValue(cid, 63215) == 1 or getPlayerStorageValue(cid, 17000) == 1 then doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.") return true end if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == item.uid then doPlayerSendCancel("Não está no slot correto") return true end if getPlayerStorageValue(cid, s) <= 0 then doCreatureSay(cid, r.text, 19) setPlayerStorageValue(cid, s, 1) BikeSpeedOn(cid,1200) -- Speed da Bike if getPlayerSex(cid) == 1 then doSetCreatureOutfit(cid, {lookType = 2269, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1) else doSetCreatureOutfit(cid, {lookType = 2270, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1) end elseif getPlayerStorageValue(cid, s) == 1 then doCreatureSay(cid, r.dtext, 19) setPlayerStorageValue(cid, s, 0) BikeSpeedOff(cid) return doRemoveCondition(cid, CONDITION_OUTFIT) else return doPlayerSendCancel(cid, 'You can\'t do this.') end else return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.') end end <action itemid="14515" script="Bike.lua" /> Esse <action itemid="14515" script="Bike.lua" /> Bota no Action XML ?
Postado Julho 25, 2016 8 anos 15 horas atrás, wougoplex disse: Esse <action itemid="14515" script="Bike.lua" /> Bota no Action XML ? Sim ~ Se ajudei +Rep ~ Sheele
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.