Postado Janeiro 1, 2015 10 anos Preciso de uma talk que remova apenas os FRAGS e que precise de 5kk para o jogador apagar apenas seus frags Fulano tem 5 frags, usou a talk, 0 tudo Talk ou por item UP Editado Janeiro 1, 2015 10 anos por jNo (veja o histórico de edições)
Postado Janeiro 1, 2015 10 anos Solução Em 01/01/2015 em 12:50, jNo disse: Talk ou por item Tente: removefrags.lua (data\talkactions\scripts): function onSay(cid) price = 500 -- crystal coins time = 5 -- seconds to logout if getPlayerFrags(cid) > 0 then if not getCreatureCondition(cid, CONDITION_INFIGHT) or not isPlayerPzLocked(cid) then if doPlayerRemoveMoney(cid, price * 10000) then doCreatureSetNoMove(cid, true) db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = ".. getPlayerGUID(cid) ..")") doSendMagicEffect(getThingPos(cid), CONST_ME_STUN) addEvent(doRemoveCreature, time * 1000, cid, true) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You will be logged out within '..time..' seconds to complete the removal of your frags.') else doPlayerSendCancel(cid, 'You need '..price..' crystal coins to remove your frags.') end else doPlayerSendCancel(cid, 'You can\'t remove your frags when you\'re in battle or in fight.') end else doPlayerSendCancel(cid, 'You don\'t have any frag.') end return true end Tag - talkactions.xml (data\talkactions): <talkaction words="!removefrags" event="script" value="removefrags.lua"/> removefrags.lua (data\actions\scripts): function onUse(cid, item, fromPos, toPos) time = 5 -- seconds to logout if getPlayerFrags(cid) > 0 then if not getCreatureCondition(cid, CONDITION_INFIGHT) or not isPlayerPzLocked(cid) then doCreatureSetNoMove(cid, true) db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = ".. getPlayerGUID(cid) ..")") doSendMagicEffect(toPos, CONST_ME_STUN) addEvent(doRemoveCreature, time * 1000, cid, true) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You will be logged out within '..time..' seconds to complete the removal of your frags.') doRemoveItem(item.uid) else doPlayerSendCancel(cid, 'You can\'t remove your frags when you\'re in battle or in fight.') end else doPlayerSendCancel(cid, 'You don\'t have any frag.') end return true end Tag - actions.xml (data\actions): <action itemid="ITEMID" script="removefrags.lua"/> PS: Já que há uma modificação nos dados (via database) do player, ele precisa fazer logout para atualizar. Então fiz pra que ele precise estar sem battle/pz locked para usar a talkaction/item, além de que ficará imóvel até ser "removido" do jogo. Editado Janeiro 1, 2015 10 anos por Suicide (veja o histórico de edições)
Postado Janeiro 1, 2015 10 anos Autor Funcionou os 2 perfeitamente, muito obrigado, esta ajudando muito! +rep
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.