Postado Setembro 16, 2014 10 anos Ola Galera Do Tibia king, queria que modifica sem essa talkaction para que so remove o redskull c o player tiver o item com o id 9969 segue a talkactions abaixo. local moneyRed = 50000 -- Preço cobrado para remover o frag e red skull local moneyBlack = 60000 -- Preço cobrado para remover o frag e black skull local moneySkullNone = 40000 -- Preço cobrado para remover o frag function onSay(cid, words, param, channel) pid = getPlayerGUID(cid) if getCreatureSkullType(cid) == 4 then if doPlayerRemoveMoney(cid, moneyRed) then doCreatureSetSkullType(cid, 0) doPlayerSendTextMessage(cid, 19, 'His frags and red skull were removed for '.. doNumberFormat(moneyRed) ..' golds. You will be logged off in 5 seconds.') doSendMagicEffect(getPlayerPosition(cid), 14) doRemoveConditions(cid, CONDITION_INFIGHT) doRemoveCreature(cid) db.query("UPDATE players SET skulltime = 0 WHERE id = ".. pid ..";") db.query("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ");") else doPlayerSendTextMessage(cid, 19, 'You don\'t have enough money, it takes '.. doNumberFormat(moneyRed) ..' golds') doSendMagicEffect(getPlayerPosition(cid), 2) end return TRUE end if getCreatureSkullType(cid) == 5 then if doPlayerRemoveMoney(cid, moneyBlack) then doCreatureSetSkullType(cid, 0) doPlayerSendTextMessage(cid, 19, 'His frags and black skull were removed for '.. doNumberFormat(moneyBlack) ..' golds. You will be logged off in 5 seconds.') doSendMagicEffect(getPlayerPosition(cid), 14) doRemoveConditions(cid, CONDITION_INFIGHT) doRemoveCreature(cid) db.query("UPDATE players SET skulltime = 0 WHERE id = ".. pid ..";") db.query("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ");") else doPlayerSendTextMessage(cid, 19, 'You don\'t have enough money, it takes '.. doNumberFormat(moneyBlack) ..' golds') doSendMagicEffect(getPlayerPosition(cid), 2) end return TRUE end if getCreatureSkullType(cid) <= 3 then if doPlayerRemoveMoney(cid, moneySkullNone) then doCreatureSetSkullType(cid, 0) doPlayerSendTextMessage(cid, 19, 'His frags were removed for '.. doNumberFormat(moneySkullNone) ..' golds. You will be logged off in 5 seconds.') doSendMagicEffect(getPlayerPosition(cid), 14) doRemoveConditions(cid, CONDITION_INFIGHT) doRemoveCreature(cid) db.query("UPDATE players SET skulltime = 0 WHERE id = ".. pid ..";") db.query("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ");") else doPlayerSendTextMessage(cid, 19, 'You don\'t have enough money, it takes '.. doNumberFormat(moneySkullNone) ..' golds') doSendMagicEffect(getPlayerPosition(cid), 2) end return TRUE end end
Postado Setembro 16, 2014 10 anos local moneyRed = 50000 -- Preço cobrado para remover o frag e red skull local moneyBlack = 60000 -- Preço cobrado para remover o frag e black skull local moneySkullNone = 40000 -- Preço cobrado para remover o frag function onSay(cid, words, param, channel) pid = getPlayerGUID(cid) if(getPlayerItemCount(cid, 9969) >0) then if getCreatureSkullType(cid) == 4 then if doPlayerRemoveMoney(cid, moneyRed) then doCreatureSetSkullType(cid, 0) doPlayerSendTextMessage(cid, 19, 'His frags and red skull were removed for '.. doNumberFormat(moneyRed) ..' golds. You will be logged off in 5 seconds.') doSendMagicEffect(getPlayerPosition(cid), 14) doRemoveConditions(cid, CONDITION_INFIGHT) doRemoveCreature(cid) db.query("UPDATE players SET skulltime = 0 WHERE id = ".. pid ..";") db.query("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ");") else doPlayerSendTextMessage(cid, 19, 'You don\'t have enough money, it takes '.. doNumberFormat(moneyRed) ..' golds') doSendMagicEffect(getPlayerPosition(cid), 2) end return TRUE end if getCreatureSkullType(cid) == 5 then if doPlayerRemoveMoney(cid, moneyBlack) then doCreatureSetSkullType(cid, 0) doPlayerSendTextMessage(cid, 19, 'His frags and black skull were removed for '.. doNumberFormat(moneyBlack) ..' golds. You will be logged off in 5 seconds.') doSendMagicEffect(getPlayerPosition(cid), 14) doRemoveConditions(cid, CONDITION_INFIGHT) doRemoveCreature(cid) db.query("UPDATE players SET skulltime = 0 WHERE id = ".. pid ..";") db.query("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ");") else doPlayerSendTextMessage(cid, 19, 'You don\'t have enough money, it takes '.. doNumberFormat(moneyBlack) ..' golds') doSendMagicEffect(getPlayerPosition(cid), 2) end return TRUE end if getCreatureSkullType(cid) <= 3 then if doPlayerRemoveMoney(cid, moneySkullNone) then doCreatureSetSkullType(cid, 0) doPlayerSendTextMessage(cid, 19, 'His frags were removed for '.. doNumberFormat(moneySkullNone) ..' golds. You will be logged off in 5 seconds.') doSendMagicEffect(getPlayerPosition(cid), 14) doRemoveConditions(cid, CONDITION_INFIGHT) doRemoveCreature(cid) db.query("UPDATE players SET skulltime = 0 WHERE id = ".. pid ..";") db.query("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ");") else doPlayerSendTextMessage(cid, 19, 'You don\'t have enough money, it takes '.. doNumberFormat(moneySkullNone) ..' golds') doSendMagicEffect(getPlayerPosition(cid), 2) end return TRUE end end Tente assim, talvez funcione xd Editado Setembro 16, 2014 10 anos por shntutor (veja o histórico de edições)
Postado Setembro 16, 2014 10 anos O tópico foi movido para a área correta, preste mais atenção da próxima vez! Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680 Este tópico foi movido: De: "OTServ → Scripting → Actions e TalkActions" Para: "OTServ → Suporte OTServ → Suporte de Scripts" Ot Design: https://discord.gg/VgtVRNmCD7
Postado Setembro 16, 2014 10 anos Faltou 1 end. Editado Setembro 16, 2014 10 anos por Alencar123 (veja o histórico de edições)
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.