Postado Junho 21, 2020 4 anos Usando tfs 0.4 Estou recebendo o erro [23:22:26.742] [Error - Action Interface] [23:22:26.747] data/actions/scripts/points.lua:onUse [23:22:26.750] Description: [23:22:26.752] data/lib/048-ppoints.lua:13: attempt to perform arithmetic on a boolean value [23:22:26.756] stack traceback: [23:22:26.758] data/lib/048-ppoints.lua:13: in function 'doAccountAddPoints' [23:22:26.762] data/actions/scripts/points.lua:8: in function <data/actions/scripts/points.lua:5> meu script é function getAccountPoints(cid) local res = db.getResult("SELECT `points` FROM `znote_accounts` WHERE id = " .. getAccountNumberByPlayerName(getCreatureName(cid))..";") if(res:getID() == -1) then return false end local ret = res:getDataInt("points") res:free() return tonumber(ret) end function doAccountAddPoints(cid, count) return db.query("UPDATE `znote_accounts` SET `points` = '".. getAccountPoints(cid) + count .."' WHERE id = " .. getAccountNumberByPlayerName(getCreatureName(cid))..";") end function doAccountRemovePoints(cid, count) return db.query("UPDATE `znote_accounts` SET `points` = '".. getAccountPoints(cid) - count .."' WHERE id = " .. getAccountNumberByPlayerName(getCreatureName(cid))..";") end a ideia é quando o player usar o item ele receber os pts na conta Se eu te ajudei e você também quer me ajudar, faça uma doação Tfs 0.4 - Click up Tfs 0.4 - Countdown horário dos próximos eventos Tfs 0.4 - Spell que cancela o target do inimigo
Postado Junho 21, 2020 4 anos Autor local cfg = { amount = 1 } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerLevel(cid) > 8 then doAccountAddPoints(cid, cfg.amount) doCreatureSay(cid, "Parabéns! Você recebeu 1 Premium Points! ", TALKTYPE_ORANGE_1) doSendMagicEffect(getCreaturePosition(cid), 28) doRemoveItem(item.uid,1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "RELOGUE PARA SALVAR. SEUS PONTOS ESTÃO DISPONIVEIS NO SITE") else doPlayerSendCancel(cid,"Você precisa de level 8 para usar este item.") end return TRUE end action ai Se eu te ajudei e você também quer me ajudar, faça uma doação Tfs 0.4 - Click up Tfs 0.4 - Countdown horário dos próximos eventos Tfs 0.4 - Spell que cancela o target do inimigo
Postado Junho 21, 2020 4 anos function getAccountPoints(cid) local res = db.getResult("SELECT `points` FROM `znote_accounts` WHERE id = " .. getAccountNumberByPlayerName(getCreatureName(cid))..";") if(res:getID() ~= -1) then repeat return res:getDataInt("points") until not(res:next()) res:free() end end Aew mano! só substituir a sua getAccountPoints por essa Editado Junho 21, 2020 4 anos por Suckie esqueci informações (veja o histórico de edições)
Postado Junho 21, 2020 4 anos Autor @Suckie deu esse erro [3:32:36.726] [Error - Action Interface] [3:32:36.729] data/actions/scripts/points.lua:onUse [3:32:36.732] Description: [3:32:36.734] data/lib/048-ppoints.lua:12: attempt to perform arithmetic on a nil value [3:32:36.739] stack traceback: [3:32:36.741] data/lib/048-ppoints.lua:12: in function 'doAccountAddPoints' [3:32:36.745] data/actions/scripts/points.lua:8: in function <data/actions/scripts/points.lua:5> Se eu te ajudei e você também quer me ajudar, faça uma doação Tfs 0.4 - Click up Tfs 0.4 - Countdown horário dos próximos eventos Tfs 0.4 - Spell que cancela o target do inimigo
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.