Subwat 405 Postado Abril 23, 2011 Share Postado Abril 23, 2011 bom eu to com um probleminha,eu criei um comando que se o player atinge o level maximo q é 717217 ele usa o comando !max e vai pro lvl 717218,só que tem um pequeno detalhe,qualquer player independente do lvl está conseguindo usar o comando e assim chegar ao lvl 717218. quero que só quem é 717217 possa usar o comando,nem level maior nem level menor,único e exclusivamente para este level. segue abaixo meu script. -- Subwat Scripting-- function onSay(cid, words, param) maximum = { player = getPlayerGUID(cid), lvlmax = 717218, -- Level que o player vai ficar apos usar o comando. } if getPlayerLevel(cid) <= 717217 and getPlayerStorageValue(cid,15915) then doPlayerSendCancel(cid, 'voce nao atingiu o level 717217 ou ja usou este comando.') else setPlayerStorageValue(cid, 15915) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..maximum.lvlmax..", `experience` = 0 WHERE `id` = "..maximum.player) end end quem ajudar leva um rep+ e um beijo na testa se quizer. Link para o comentário https://xtibia.com/forum/topic/155542-max-level/ Compartilhar em outros sites More sharing options...
Kimoszin 32 Postado Abril 24, 2011 Share Postado Abril 24, 2011 (editado) Removido! Editado Abril 24, 2011 por Kimoszin Link para o comentário https://xtibia.com/forum/topic/155542-max-level/#findComment-1027398 Compartilhar em outros sites More sharing options...
Demonbholder 420 Postado Abril 24, 2011 Share Postado Abril 24, 2011 (editado) -- Subwat Scripting-- function onSay(cid, words, param) maximum = { player = getPlayerGUID(cid), lvlmax = 717218, -- Level que o player vai ficar apos usar o comando. } if getPlayerLevel(cid) ~= 717217 or getPlayerStorageValue(cid,15915) == 1 then doPlayerSendCancel(cid, 'voce nao atingiu o level 717217 ou ja usou este comando.') else setPlayerStorageValue(cid, 15915, 1) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..maximum.lvlmax..", `experience` = 0 WHERE `id` = "..maximum.player) end end O comando getPlayerStorageValue sem comparação só ira retornar FALSE se o storage tiver valor nil, portanto, é necessário fazer a comparação. Já o comando setPlayerStorageValue deve colocar algum valor a um storage. Se você fez a Query certa, o script deve funcionar. Até mais. Editado Abril 24, 2011 por Demonbholder Link para o comentário https://xtibia.com/forum/topic/155542-max-level/#findComment-1027401 Compartilhar em outros sites More sharing options...
Subwat 405 Postado Abril 24, 2011 Autor Share Postado Abril 24, 2011 funcionou perfeitamente,muito obrigado minha amiga demonBholder, Um rep+ pra tu,mas quando o player morre ele volta pro lvl 1 oO o que será isso? Link para o comentário https://xtibia.com/forum/topic/155542-max-level/#findComment-1027453 Compartilhar em outros sites More sharing options...
Demonbholder 420 Postado Abril 24, 2011 Share Postado Abril 24, 2011 (editado) retired. Editado Abril 24, 2011 por Demonbholder Link para o comentário https://xtibia.com/forum/topic/155542-max-level/#findComment-1027632 Compartilhar em outros sites More sharing options...
Subwat 405 Postado Abril 24, 2011 Autor Share Postado Abril 24, 2011 vou testar se nao funcionar vo bater em vc. @edit nao funcionou .. vo ti bater ashashuuhsa ,arruma ae Link para o comentário https://xtibia.com/forum/topic/155542-max-level/#findComment-1027657 Compartilhar em outros sites More sharing options...
Demonbholder 420 Postado Abril 24, 2011 Share Postado Abril 24, 2011 Ahhh, faz por login então: function onLogin(cid) maximum = { player = getPlayerGUID(cid), lvlmax = 717217, -- Level que o player vai ficar apos usar o comando. } if getPlayerLevel(cid) == 1 and getPlayerStorageValue(cid,15915) == 1 then doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..maximum.lvlmax..", `experience` = 0 WHERE `id` = "..maximum.player) end return TRUE end Edita a experiência que ele ficaria quando ele morre. Link para o comentário https://xtibia.com/forum/topic/155542-max-level/#findComment-1027667 Compartilhar em outros sites More sharing options...
Tedescoo 8 Postado Abril 24, 2011 Share Postado Abril 24, 2011 Me ajuda ae ? http://www.xtibia.com/forum/topic/155583-pedido-de-script/ @topic o gean o script que você falo que não funcionou o que você postou lá no começo , aqui funfo normal ;d Só pra avisar e.e Link para o comentário https://xtibia.com/forum/topic/155542-max-level/#findComment-1027674 Compartilhar em outros sites More sharing options...
Subwat 405 Postado Abril 25, 2011 Autor Share Postado Abril 25, 2011 vou testar miguxo Link para o comentário https://xtibia.com/forum/topic/155542-max-level/#findComment-1027722 Compartilhar em outros sites More sharing options...
Posts Recomendados