RO

[Encerrado] Bike Sytem Pda .... Vip

Por rodrigoorgirdor, 31 de out. de 2012 em Tópicos Sem Resposta

8
862
31 de outubro de 2012 às 21:08

Como coloco o uso das bikes somente para vip's no PDA?

SlicerS
31 de outubro de 2012 às 21:11

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

 

local sBike = 5701

 

local t = {

[2547] = {article='a', name='bike', text='Mount, bike!', dtext='Demount, bike!', s=5700, condition=bikeCondition},

} --mude o [ ] pro id do item q vai usar a bike...

 

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 #getCreatureSummons(cid) >= 1 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 not isPremium(cid) then --alterei aki!

doPlayerSendCancel(cid, "You can't use bike without be a premium player.")

return true

end

 

if getPlayerStorageValue(cid, s) <= 0 then

doSendMagicEffect(pos, 177)

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted ' .. r.article .. ' '.. r.name .. '.')

BikeSpeedOn(cid,500)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393}, -1)

end

elseif getPlayerStorageValue(cid, s) == 1 then

doSendMagicEffect(pos, 177)

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted ' .. r.article .. ' '.. r.name .. '.')

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

 

ta ae...

01 de novembro de 2012 às 21:43

testando aki... ja respondo se pode mover

 

mano ... deu certinho.... agora só uma pergunta.... a velocidade da bike é baseada em que?

SlicerS
01 de novembro de 2012 às 22:55

eh fixa em 500..

BikeSpeedOn(cid,500)

01 de novembro de 2012 às 23:00

achei outro probleminha aki....... se o player desloga com a bike, ele volta com a speed muito pequena... tem como colocar pra não deslogar de bike?

SlicerS
02 de novembro de 2012 às 00:01

vai em creaturescripts/scripts/login.lua e acha essa parte..

elseif getPlayerStorageValue(cid, 5700) > 0 then   --bike
    doChangeSpeed(cid, getPlayerStorageValue(cid, 5700))
    if getPlayerSex(cid) == 1 then
	   doSetCreatureOutfit(cid, {lookType = 1394}, -1)
    else
	   doSetCreatureOutfit(cid, {lookType = 1393}, -1)
    end

 

troca isso..

doChangeSpeed(cid, getPlayerStorageValue(cid, 5700))

 

por isso..

doChangeSpeed(cid, -getCreatureSpeed(cid))
doChangeSpeed(cid, 500)

02 de novembro de 2012 às 00:27

Testado e 100 % funfando.... Vlw To te devendo um Rep mano... ja dei um rep hj..

5 anos depois...
StigalS
21 de abril de 2018 às 03:03
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.