Postado Fevereiro 27, 2015 10 anos Olá galera, estou precisando de uma ajudinha bem simples, quando chego no nível 717217, tenho uma talkaction !maxlevel, ela adiciona +1 level ao jogador, e permite que ele continue upando, porém, até o nível 903637, então criei !maxlevel2, porém depois, até o nível 1034406. Para não ficar criando actions e mais actions, teria algum modo de fazer algo do tipo "somente nos níveis 717217, 903637, 1034406, (e mais os que vou adicionar após os testes)" com algo do tipo "level após o talkaction = level atual + 1". Esse é o script do !maxlevel 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 then doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..maximum.lvlmax..", `experience` = 10000 WHERE `id` = "..maximum.player) else doPlayerSendCancel(cid, 'You do not have the level max 717217.') doSendMagicEffect(getPlayerPosition(cid),37) end end E esse do !maxlevel2 function onSay(cid, words, param) maximum = { player = getPlayerGUID(cid), lvlmax = getPlayerLevel(cid) + 1, -- Level que o player vai ficar apos usar o comando. } if getPlayerLevel(cid) == 903637 then doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..maximum.lvlmax..", `experience` = 10000 WHERE `id` = "..maximum.player) else doPlayerSendCancel(cid, 'You do not have the level max 903637.') doSendMagicEffect(getPlayerPosition(cid),37) end end
Postado Fevereiro 28, 2015 10 anos local levels = {717217, 903637, 1034406} --Adicione aqui os levels que participarão do script. function onSay(cid, words) if isInArray(levels, getPlayerLevel(cid)) then db.executeQuery("UPDATE players SET level = "..(getPlayerLevel(cid) + 1)..", experience = 10000 WHERE id = "..getPlayerGUID(cid)) doRemoveCreature(cid) end return true end Editado Fevereiro 28, 2015 10 anos por zipter98 (veja o histórico de edições) não respondo pms solicitando suporte em programação/scripting
Postado Fevereiro 28, 2015 10 anos Autor Zipter, da primeira vez funcionou, fui do level 717217 pro 717218 e continuei até o 903637, porém ai toda vez que usava !maxlevel o char não subia de nível. Aliás, teria como colocar alguma mensagem em caso de falha? Do tipo "Você ainda não tem level suficiente para continuar." *A versão é 8.6, TFS 3.6 **!maxlevel só deixa a mensagem em vermelho no chat, e não faz mais nada, e não dá erros no TFS. ***Rapaz, consegui arrumar o script, agora ele sobe 1 level quando o player tem o level certo, se não fosse o seu script não teria conseguido arrumar, muito obrigado. function onSay(cid, words, param) maximum = { player = getPlayerGUID(cid), lvlmax = (getPlayerLevel(cid) + 1), } local levels = {717217, 903637, 1034406, 1138511, 1226423} -- Level que o player vai usar o comando. if isInArray(levels, getPlayerLevel(cid)) then doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..maximum.lvlmax..", `experience` = 10000 WHERE `id` = "..maximum.player) else doPlayerSendCancel(cid, 'Você ainda não tem level suficiente para continuar.') doSendMagicEffect(getPlayerPosition(cid),37) end end Editado Fevereiro 28, 2015 10 anos por Bruxa0 (veja o histórico de edições)
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.