I have this scrpit that when use X item the exp will be duplicate for 1 hour,but if loggout they lose this bonus..So i would like that exp dont finish if loggout....Just finish after pass the 1 hour...
PHP:
function onUse(cid, item, frompos, item2, topos)
local pausa = 60*60*1000 -- (1000 = 1 segundos) Tempo que o script durará
local texto = "You have 2 times more experience for 1 hour, do not logout or else you will loose the bonus."
textofinal = "Your bonus time is gone." -- Texto que irá receber quando o efeito da potion acabar.
local exp = 2.0 -- O quanto que você quer que dobre sua experiencia, por exemplo 2 é 2x as rates do seu server.
expfinal = 1 --Não mude, isso é para a experiencia voltar ao normal.
if not(isVip(cid)) then
doPlayerSendTextMessage(cid, 22, "Você precisa ser VIP para utilizar esse item.")
else
doRemoveItem(item.uid,1)
doPlayerSetExperienceRate(cid,exp)
doSendMagicEffect(frompos,13)
doPlayerSendTextMessage(cid,22,texto)
addEvent(potion,pausa,cid)
end
end
function potion(pos, cid)
doPlayerSetExperienceRate(pos,expfinal)
doPlayerSendTextMessage(pos,22,textofinal)
end