Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sBike = 2547
- local t = {
- [13984] = {article='', name='', text='', dtext='', s=32001, 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
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- 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 or getPlayerStorageValue(cid, 75846) >= 1 or
- getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then --alterado v1.9
- return doPlayerSendCancel(cid, "You can't do that right now.")
- end
- local underwater = {231, 670, 671, 5405, 5406, 5407, 5408, 5409, 5410, 5427, 5428, 5429, 5430, 5431, 5432, 5433, 5434, 5435, 5436, 5437, 5438}
- if isInArray(underwater, getTileInfo(getThingPos(cid)).itemid) then
- return doPlayerSendCancel(cid, "Você não pode usar bike nesse local.")
- end
- if getPlayerStorageValue(cid, 154585) >= 1 then
- return doPlayerSendCancel(cid, "Desculpe, isso não é possível.")
- end
- if ( getPlayerItemCount(cid, 13984) <= 0 ) then
- return doPlayerSendCancel(cid, 'Coloque na mochila para poder usar.')
- end
- if getPlayerStorageValue(cid, s) <= 0 then
- doCreatureSay(cid, r.text, 19)
- setPlayerStorageValue(cid, s, 1)
- BikeSpeedOn(cid,600)
- if getPlayerSex(cid) == 1 then
- doSetCreatureOutfit(cid, {lookType = 603, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
- else
- doSetCreatureOutfit(cid, {lookType = 602, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -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
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement