Postado Março 12, 2017 8 anos Então, essa action, quando não tem frags, você clica no item, e "diz que funciona", porém, quando você esta com frags e skull, "fica pofando, saindo fumaça no char, mas nao remove skull nem frags". E uma talk, !removefrags, que rouba 20kk do player, mas remove todos os frags, e tira skull. tfs 0.4 -- [( Script created by Matheus for TibiaKing.com )] -- function onUse(cid, item, fromPosition, item2, toPosisition) local rskulls = {green = SKULL_GREEN, red = SKULL_RED, black = SKULL_BLACK} if isInArray(rskulls, getPlayerSkullType(cid)) then doPlayerSendCancel(cid,"You don't remover your frags and skulls.") doSendMagicEffect(getPlayerPosition(cid), 2) else db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")") doCreatureSetSkullType(cid, 0) doCreatureSay(cid, "Your frags and skulls is cleaned!", 19) doSendMagicEffect(getPlayerPosition(cid), 26) doRemoveItem(item.uid, 1) return TRUE end end
Postado Março 15, 2017 8 anos tem que kickar o player antes de chamar DB! não testei. local price = 20000000 function onSay(cid, words, param, channel) local rskulls = {green = SKULL_GREEN, red = SKULL_RED, black = SKULL_BLACK} if not isInArray(rskulls, getPlayerSkullType(cid)) then doPlayerSendCancel(cid,"You dont have skulls") return true end if not doPlayerRemoveMoney(cid, price) then doPlayerSendCancel(cid,"You need " .. price .. " cash.") return true end doCreatureSetSkullType(cid, 0) doCreatureSay(cid, "Your frags and skulls is cleaned!", 19) player = getPlayerGUID(cid) doRemoveCreature(cid, true) db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. player .. ")") return true end Editado Março 15, 2017 8 anos por x1zy (veja o histórico de edições)
Postado Março 15, 2017 8 anos Autor Em 15/03/2017 em 10:12, x1zy disse: tem que kickar o player antes de chamar DB! não testei. local price = 20000000 function onSay(cid, words, param, channel) local rskulls = {green = SKULL_GREEN, red = SKULL_RED, black = SKULL_BLACK} if not isInArray(rskulls, getPlayerSkullType(cid)) then doPlayerSendCancel(cid,"You dont have skulls") return true end if not doPlayerRemoveMoney(cid, price) then doPlayerSendCancel(cid,"You need " .. price .. " cash.") return true end doCreatureSetSkullType(cid, 0) doCreatureSay(cid, "Your frags and skulls is cleaned!", 19) player = getPlayerGUID(cid) doRemoveCreature(cid, true) db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. player .. ")") return true end Funcional, e em action, você consegue?
Postado Março 15, 2017 8 anos Solução local cfg = {item = 2423, ammount = 1} function onUse(cid, item, fromPosition, item2, toPosisition) local rskulls = {green = SKULL_GREEN, red = SKULL_RED, black = SKULL_BLACK} if not isInArray(rskulls, getPlayerSkullType(cid)) then doPlayerSendCancel(cid,"You dont have skulls") return true end if not doPlayerRemoveItem(cid, cfg.item, cfg.ammount) then doPlayerSendCancel(cid,"You need ".. cfg.ammount .. "x " .. getItemNameById(cfg.item) .. ".") return true end doCreatureSetSkullType(cid, 0) doCreatureSay(cid, "Your frags and skulls is cleaned!", 19) player = getPlayerGUID(cid) doRemoveCreature(cid, true) db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. player .. ")") return true end
Postado Março 15, 2017 8 anos Autor Em 15/03/2017 em 19:59, x1zy disse: local cfg = {item = 2423, ammount = 1} function onUse(cid, item, fromPosition, item2, toPosisition) local rskulls = {green = SKULL_GREEN, red = SKULL_RED, black = SKULL_BLACK} if not isInArray(rskulls, getPlayerSkullType(cid)) then doPlayerSendCancel(cid,"You dont have skulls") return true end if not doPlayerRemoveItem(cid, cfg.item, cfg.ammount) then doPlayerSendCancel(cid,"You need ".. cfg.ammount .. "x " .. getItemNameById(cfg.item) .. ".") return true end doCreatureSetSkullType(cid, 0) doCreatureSay(cid, "Your frags and skulls is cleaned!", 19) player = getPlayerGUID(cid) doRemoveCreature(cid, true) db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. player .. ")") return true end Funcionou, dúvida sanada, obrigado!
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.