Postado Setembro 29, 2015 9 anos bom eu tenho um server de dbo e dps que passa do level 631 tem que desbugar, mais tem gente que usa o desbug pra upar, queria por um tempo nele, é por um item e nao por npc function onUse(cid, item, frompos, item2, topos) if item.itemid == 5785 and doPlayerRemoveMoney(cid,500000) == 1 and getPlayerLevel (cid) >= 200 then doSendMagicEffect(topos,14) doPlayerSay(cid,"Level Desbugado",16) addLevel(cid,1) doSendMagicEffect(topos,14) doPlayerSay(cid,"Level Desbugado",16) else doPlayerSay(cid,"Sorry Custa 50 Gold",16) doPlayerSendCancel(cid,"Sorry no have Lvl 500!") end return 1 end ai está o comando se alguem conseguir me ajudar arrumando, ficarei grato.
Postado Setembro 29, 2015 9 anos Solução Troque seu código por esse : local time = 30 -- minutos function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, 5489) <= os.time() then if doPlayerRemoveMoney(cid,500000) == 1 and getPlayerLevel(cid) >= 200 then addLevel(cid,1) doSendMagicEffect(topos,14) doPlayerSay(cid,"Level Desbugado",16) setPlayerStorageValue(cid, 5489, (60*time) + os.time()) else doPlayerSay(cid,"Sorry Custa 50 Gold",16) doPlayerSendCancel(cid,"Sorry no have Lvl 500!") end else doPlayerSendCancel(cid,"Você tem que esperar" .. (getPlayerStorageValue(cid, 5489) - os.time()) / 60 .. "minuto(s) para desbugar novamente.") end return true end Editado Setembro 29, 2015 9 anos por Flavio S (veja o histórico de edições)
Postado Setembro 29, 2015 9 anos Autor Em 29/09/2015 em 17:41, Flavio S disse: Troque seu código por esse : local time = 30 -- minutos function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, 5489) <= os.time() then if doPlayerRemoveMoney(cid,500000) == 1 and getPlayerLevel(cid) >= 200 then addLevel(cid,1) doSendMagicEffect(topos,14) doPlayerSay(cid,"Level Desbugado",16) setPlayerStorageValue(cid, 5489, (60*time) + os.time()) else doPlayerSay(cid,"Sorry Custa 50 Gold",16) doPlayerSendCancel(cid,"Sorry no have Lvl 500!") end else doPlayerSendCancel(cid,"Você tem que esperar" .. (getPlayerStorageValue(cid, 5489) - os.time()) / 60 .. "minuto(s) para desbugar novamente.") end return true end VLW FUNCIONOU PERFEITAMENTE, só mais 1 pergunta como transformo em segundos? queria por a cada 20 segundos
Postado Setembro 29, 2015 9 anos local time = 30 -- minutos function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, 5489) <= os.time() then if doPlayerRemoveMoney(cid,500000) == 1 and getPlayerLevel(cid) >= 200 then addLevel(cid,1) doSendMagicEffect(topos,14) doPlayerSay(cid,"Level Desbugado",16) setPlayerStorageValue(cid, 5489, time + os.time()) else doPlayerSay(cid,"Sorry Custa 50 Gold",16) doPlayerSendCancel(cid,"Sorry no have Lvl 500!") end else doPlayerSendCancel(cid,"Você tem que esperar" .. (getPlayerStorageValue(cid, 5489) - os.time()) .. " segundo(s) para desbugar novamente.") end return true end
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.