Postado Janeiro 29, 2015 10 anos Ao usar o comando !reset o personagem desloga e da erro na distro: ERRO: Eu adicionei o Sistema Resetar no meu servidor, seguindo este tutorial: http://www.tibiaking.com/forum/topic/9256-reset-system-with-sources/ script da TALKACTION: function onSay(cid, words, param) local t = { RemainingLvl = 8, exp = 4200, level = 350, redskull = true, battle = true, pz = true } if(t.redskull == true) and (getCreatureSkullType(cid) == 4) then return doPlayerSendTextMessage(cid, 22, "Apenas player sem red skull podem resetar.") end if(t.pz == true) and (getTilePzInfo(getCreaturePosition(cid)) == false) then return doPlayerSendTextMessage(cid, 22, "Voce precisa estar em protection zone pra poder resetar.") end if(t.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == true) then return doPlayerSendTextMessage(cid, 22, "Você precisa estar sem battle pra poder resetar.") end if getPlayerLevel(cid) >= t.level then setResets(cid, 1) doRemoveCreature(cid, true) db.executeQuery("UPDATE `players` SET `level` = "..t.RemainingLvl..", `experience` = "..t.exp.." WHERE `id` = "..getPlayerGUID(cid)) else doPlayerSendCancel(cid, "Voce precisa do level "..t.level.." ou mais para resetar.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end return true end Obs: Fiz tudo certo, source TFS 0.3.6 pl1. "O sucesso é uma consequência e não um objetivo. A persistência é o caminho do êxito".
Postado Janeiro 29, 2015 10 anos Como mencionado no erro, era concatenação errada na linha 22 : db.executeQuery("UPDATE `players` SET `level` = "..t.RemainingLvl..", `experience` = "..t.exp.." WHERE `id` = "..getPlayerGUID(cid).."") /\ Modo Correto. Basta trocar
Postado Janeiro 29, 2015 10 anos Autor Como mencionado no erro, era concatenação errada na linha 22 : db.executeQuery("UPDATE `players` SET `level` = "..t.RemainingLvl..", `experience` = "..t.exp.." WHERE `id` = "..getPlayerGUID(cid).."") /\ Modo Correto. Basta trocar Não deu certo, olha o erro: "O sucesso é uma consequência e não um objetivo. A persistência é o caminho do êxito".
Postado Janeiro 29, 2015 10 anos Como mencionado no erro, era concatenação errada na linha 22 : db.executeQuery("UPDATE `players` SET `level` = "..t.RemainingLvl..", `experience` = "..t.exp.." WHERE `id` = "..getPlayerGUID(cid).."") /\ Modo Correto. Basta trocar Nada a ver, estava correto... Não deu certo, olha o erro: Screenshot_1.png Tenta esse: function onSay(cid, words, param) local t = { RemainingLvl = 8, exp = 4200, level = 350, redskull = true, battle = true, pz = true } if(t.redskull == true) and (getCreatureSkullType(cid) == 4) then return doPlayerSendTextMessage(cid, 22, "Apenas players sem red skull podem resetar.") end if(t.pz == true) and (getTilePzInfo(getCreaturePosition(cid)) == false) then return doPlayerSendTextMessage(cid, 22, "Você precisa estar em protection zone pra poder resetar.") end if(t.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == true) then return doPlayerSendTextMessage(cid, 22, "Você precisa estar sem battle pra poder resetar.") end if getPlayerLevel(cid) >= t.level then setResets(cid, 1) db.executeQuery("UPDATE `players` SET `level` = "..t.RemainingLvl..", `experience` = "..t.exp.." WHERE `id` = "..getPlayerGUID(cid)) doRemoveCreature(cid, true) else doPlayerSendCancel(cid, "Você precisa do level "..t.level.." ou mais para resetar.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end return true end Editado Janeiro 29, 2015 10 anos por Snowsz (veja o histórico de edições) _ .-'` `} _./) / } .'o \ | } '.___.'`.\ {` /`\_/ , `. } ME DA UMA NOZ! \=' .-' _`\ { `'`;/ `, } _\ @ ; } /__`;-...'--' Cluck!
Postado Janeiro 30, 2015 10 anos Autor Nada a ver, estava correto... Tenta esse: function onSay(cid, words, param) local t = { RemainingLvl = 8, exp = 4200, level = 350, redskull = true, battle = true, pz = true } if(t.redskull == true) and (getCreatureSkullType(cid) == 4) then return doPlayerSendTextMessage(cid, 22, "Apenas players sem red skull podem resetar.") end if(t.pz == true) and (getTilePzInfo(getCreaturePosition(cid)) == false) then return doPlayerSendTextMessage(cid, 22, "Você precisa estar em protection zone pra poder resetar.") end if(t.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == true) then return doPlayerSendTextMessage(cid, 22, "Você precisa estar sem battle pra poder resetar.") end if getPlayerLevel(cid) >= t.level then setResets(cid, 1) db.executeQuery("UPDATE `players` SET `level` = "..t.RemainingLvl..", `experience` = "..t.exp.." WHERE `id` = "..getPlayerGUID(cid)) doRemoveCreature(cid, true) else doPlayerSendCancel(cid, "Você precisa do level "..t.level.." ou mais para resetar.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end return true end O erro na distro acabo, mas quando eu falo !reset o personagem deloga, e quando loga não reseta nada. UP "O sucesso é uma consequência e não um objetivo. A persistência é o caminho do êxito".
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.