Postado Março 31, 2014 11 anos Autor isso é a talkaction, posta a action agora. O próprio console te fala aonde é o erro e qual foi o erro: talkactions\scripts\removefrags.lua na linha 6 e actions\scripts\removefrags.lua na linha 3 Ambos os erros são na função getPlayerFrags, porque vc tá cometendo um stack traceback (quando você compara um valor vazio (ou uma função) à um valor numério) experimenta fazer isso daqui em ambos os casos(actions e talkactions) porque costuma resolver local frags = getPlayerFrags(cid) if frags < config.amount then se não der fala e já me diz a versão do teu server (aparece no topo do console, logo que vc liga o server) O meu TFS é 3.6.0 porque não funciona meu deus alguem pode me ajudar? Ta quase todo mundo Black Skull e Red Skull no meu Otserv e não consigo fazer nada para que eles tirem o frags, todos script que eu acho so retira o Skull, alguem pode me ajudar precisando muito, REP +
Postado Abril 1, 2014 11 anos to tentando te ajudar cara mas não tem como eu fazer milagre.. o erro que tá aparecendo no console não condiz com o script que tu me passou o.O acho que você ta passando o script errado OU usando o script errado no talkactions.xml. Em todo caso, se nada resolver vai no config.lua e edita essa parte aqui redSkullLength = 15 * 12 * 30 * 30 ---tempo que dura a red skull blackSkullLength = 25 * 12 * 30 * 30 --- tempo que dura a blackskull dailyFragsToRedSkull = 3 --- quantos kills diários deixam red weeklyFragsToRedSkull = 10 -- quantos kills semanais deixam red monthlyFragsToRedSkull = 20 -- quantos kills mensais deixam red useBlackSkull = true -- usar black skull? true = sim/ false = não deixa algo mais ou menos parecido com isso redSkullLength = 12 * 30 * 30 blackSkullLength = 2 * 12 * 30 * 30 dailyFragsToRedSkull = 10 weeklyFragsToRedSkull = 30 monthlyFragsToRedSkull = 50 useBlackSkull = false Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Postado Abril 1, 2014 11 anos Autor to tentando te ajudar cara mas não tem como eu fazer milagre.. o erro que tá aparecendo no console não condiz com o script que tu me passou o.O acho que você ta passando o script errado OU usando o script errado no talkactions.xml. Em todo caso, se nada resolver vai no config.lua e edita essa parte aqui redSkullLength = 15 * 12 * 30 * 30 ---tempo que dura a red skull blackSkullLength = 25 * 12 * 30 * 30 --- tempo que dura a blackskull dailyFragsToRedSkull = 3 --- quantos kills diários deixam red weeklyFragsToRedSkull = 10 -- quantos kills semanais deixam red monthlyFragsToRedSkull = 20 -- quantos kills mensais deixam red useBlackSkull = true -- usar black skull? true = sim/ false = não deixa algo mais ou menos parecido com isso redSkullLength = 12 * 30 * 30 blackSkullLength = 2 * 12 * 30 * 30 dailyFragsToRedSkull = 10 weeklyFragsToRedSkull = 30 monthlyFragsToRedSkull = 50 useBlackSkull = false É verdade amigo, eu ja não estou conseguindo entender o erro que esta falando no distro, porque não importa o script.lua que eu coloco ele da o mesmo erro. No meu Config.lua ja esta assim. @Edit- Config.lua redSkullLength = 50 * 62 * 70 * 90 blackSkullLength = 64 * 72 * 80 * 95 dailyFragsToRedSkull = 55 weeklyFragsToRedSkull = 80 monthlyFragsToRedSkull = 90 dailyFragsToBlackSkull = dailyFragsToRedSkull weeklyFragsToBlackSkull = weeklyFragsToRedSkull monthlyFragsToBlackSkull = monthlyFragsToRedSkull dailyFragsToBanishment = dailyFragsToRedSkull weeklyFragsToBanishment = weeklyFragsToRedSkull monthlyFragsToBanishment = monthlyFragsToRedSkull blackSkulledDeathHealth = 40 blackSkulledDeathMana = 0 useBlackSkull = true useFragHandler = true advancedFragList = false @Edit- Eu voltei como o script estava antes e o erro continua esse o.O @Edit- Arrumei o erro que estava dando em todos scripts de remover frag, mais continuo sem achar um que remova. Editado Abril 1, 2014 11 anos por Rodrigo0lg (veja o histórico de edições)
Postado Abril 1, 2014 11 anos Autor A sim, desculpa galera...aqui está os scripts. data/talkactions/removefrags.lua function onSay(cid, words, param, channel) local config = { price = 10000, amount = 1 } if getPlayerFrags(cid) < config.amount then doPlayerSendCancel(cid,"você não tem frags suficientes para executar está ação.") return true elseif not doPlayerRemoveMoney(cid, config.price) then doPlayerSendCancel(cid,"você precisa ter "..config.price.." gps para remover seus frags.") return true end doPlayerRemoveFrag(cid, config.amount) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Parabéns! Foram removidos "..config.amount.." frags.") doSendMagicEffect(getPlayerPosition(cid), 26) return true end data/talkactions.xml <talkaction words="/removefrags;!removefrags" event="script" value="removefrags.lua"/> data/lib/removefrags.lua function doPlayerRemoveFrag(cid, count) -- by vodka local query,t,k = db.getResult("SELECT `kill_id` FROM `player_killers` WHERE `player_id` = "..getPlayerGUID(cid)),{},0 if (query:getID() ~= -1) then repeat local gs = db.getResult("SELECT `unjustified` FROM `killers` WHERE `id` = "..query:getDataInt("kill_id")) if (gs:getDataInt("unjustified") ~= 0) then table.insert(t, query:getDataInt("kill_id")) k = k +1 end until not query:next() or k >= count query:free() end for _, frag in pairs(t) do db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` = "..frag) end return true end Eu desisti deste script ^ eu achei um aqui agora amigo, que parece ser mais facil de se arrumar, olhe ele faz exatamente o que eu quero Remove todos os frags, so que quando o player mata algum player ele volta com os frags que estava antes de retirar olhe. !frags 01:12 You currently have 3 frags today, 21 this week and 21 this month. 01:12 Last frag at 01 April 2014 00:44:17 on level 8 (Testandolor). !removeskull 01:14 You currently have 0 frags today, 0 this week and 0 this month. Depois que mato 1 player do !frags 01:14 You currently have 4 frags today, 22 this week and 22 this month. 01:14 Last frag at 01 April 2014 01:14:36 on level 7 (Testandolor). Quero que depois que use o comando !removeskull, zere tudo e quando um player mata dinovo começa do 1, alguem pode me ajudar? O script é este. skull.lua local exstorage = 1499 local COST = 8 -- Valor necessário para tirar red local moeda = 2160 -- moeda que será removida local REMOVE_FRAGS = "yes" -- "yes" ou "no" // para retirar todos os frags local EFFECT = CONST_ME_YELLOW_RINGS -- efeito usado quando tirar o red local battle = true -- players deve estar sem battle (true or false) function onSay(cid, words, param, channel) if (exhaustion.check(cid, exstorage) == true) then doPlayerSendCancel(cid, "You are exhausted") return true end if battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não pode tirar red skull com battle.") return TRUE end if getCreatureSkullType(cid) == SKULL_RED then local query = db.getResult("SELECT `premdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. ";") local points = query:getDataInt("premdays") if getPlayerItemCount(cid,moeda) >= COST then db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")") doCreatureSetSkullType(cid,0) doPlayerSendTextMessage(cid, 27, "Sua red skull foi removida!") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED) doPlayerSetSkullEnd(cid, 0, getPlayerSkullType(cid)) doPlayerRemoveItem(cid,moeda,COST) doSendMagicEffect(getPlayerPosition(cid), effect) doRemoveCreature(cid) else doPlayerSendCancel(cid, "Você precisa de " ..COST.. " crystal coins para remover a red skull.") end else doPlayerSendCancel(cid, "Você não está red skull.") end exhaustion.set(cid, exstorage, 30) if (query ~= nil) then query:free() end return TRUE end REP+ . Editado Abril 1, 2014 11 anos por Rodrigo0lg (veja o histórico de edições)
Postado Abril 1, 2014 11 anos testa essa bagaça aqui local exstorage = 1499 local COST = 8 -- Valor necessário para tirar red local moeda = 2160 -- moeda que será removida local amount = 4 --quantidade de frags que vai remover local EFFECT = CONST_ME_YELLOW_RINGS -- efeito usado quando tirar o red local battle = true -- players deve estar sem battle (true or false) function doPlayerRemoveFrag(cid, count) -- by vodka local query,t,k = db.getResult("SELECT `kill_id` FROM `player_killers` WHERE `player_id` = "..getPlayerGUID(cid)),{},0 if (query:getID() ~= -1) then repeat local gs = db.getResult("SELECT `unjustified` FROM `killers` WHERE `id` = "..query:getDataInt("kill_id")) if (gs:getDataInt("unjustified") ~= 0) then table.insert(t, query:getDataInt("kill_id")) k = k +1 end until not query:next() or k >= count query:free() end for _, frag in pairs(t) do db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` = "..frag) end return true end function onSay(cid, words, param, channel) if (exhaustion.check(cid, exstorage) == true) then doPlayerSendCancel(cid, "You are exhausted") return true end if battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Voce não pode tirar sua skull com battle.") return TRUE end if creatureSkull ~= SKULL_NONE then local query = db.getResult("SELECT `premdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. ";") local points = query:getDataInt("premdays") if getPlayerItemCount(cid,moeda) >= COST then doPlayerRemoveFrag(cid, amount) doCreatureSetSkullType(cid,0) doPlayerSendTextMessage(cid, 27, "Sua skull foi removida!") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED) doPlayerSetSkullEnd(cid, 0, getPlayerSkullType(cid)) doPlayerRemoveItem(cid,moeda,COST) doSendMagicEffect(getPlayerPosition(cid), effect) doRemoveCreature(cid) else doPlayerSendCancel(cid, "Voce precisa de " ..COST.. " crystal coins para remover a skull.") end else doPlayerSendCancel(cid, "Voce nao esta skull.") end exhaustion.set(cid, exstorage, 30) if (query ~= nil) then query:free() end return TRUE end Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
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.