Postado Fevereiro 13, 2015 10 anos Prezados, boa noite! Gostaria de pedir a ajuda de vocês para criar uma talkaction que ao ser usada /removerfrag "Player" remova apenas 1 frag do player. Obrigado desde já! Att, Grafit.
Postado Fevereiro 13, 2015 10 anos Sou iniciante, mas fiz para você acho que vai funcionar, teste: Frag.lua function onSay(cid, words, param, channel) local frag = 9999 if item.itemid == frag and item.type >= 1 then doRemoveItem(frag, 1) doPlayerSendCancel(cid, "Removeu uma frag.") else return false doPlayerSendCancel(cid, "Voce nao tem uma frag.") end return true end Tag: <talkaction words="/removefrag" event="script" value="frag.lua"/> Ajudei? REP+ Talvez possa te ajudar: • Launcher AutoUpdate C# - Tutorial • Sprites OtPokémon 9.4 e 10.1 • Liberando espaço de sprites no old client • Deixar OTClient com zoom padrão
Postado Fevereiro 13, 2015 10 anos Autor Sou iniciante, mas fiz para você acho que vai funcionar, teste: Frag.lua function onSay(cid, words, param, channel) local frag = 9999 if item.itemid == frag and item.type >= 1 then doRemoveItem(frag, 1) doPlayerSendCancel(cid, "Removeu uma frag.") else return false doPlayerSendCancel(cid, "Voce nao tem uma frag.") end return true end Tag: <talkaction words="/removefrag" event="script" value="frag.lua"/> Eu queria que removesse um FRAG, no caso um KILL.. Mas de qualquer jeito obrigado. Editado Fevereiro 13, 2015 10 anos por grafit (veja o histórico de edições) Att, Grafit.
Postado Fevereiro 13, 2015 10 anos Eu queria que removesse um FRAG, no caso um KILL.. Mas de qualquer jeito obrigado. kkkk, malz eu nem sei oq e Frag nunca entrei em um Tibia. Ajudei? REP+ Talvez possa te ajudar: • Launcher AutoUpdate C# - Tutorial • Sprites OtPokémon 9.4 e 10.1 • Liberando espaço de sprites no old client • Deixar OTClient com zoom padrão
Postado Fevereiro 13, 2015 10 anos Solução function onSay(cid, words, param) if(param == "") then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command need a player name param.") end local pid = getPlayerByNameWildcard(param) if(not pid) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not exist or is offline.") end local result, retInt = db.getResult("SELECT `unjustified` FROM `killers` WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = "..getPlayerGUID(pid)..");"), result:getDataInt("unjustified") if(result:getID() ~= -1) then if(retInt >= 0) then db.executeQuery("UPDATE `killers` SET `unjustified` = "..(retInt - 1).." WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = "..getPlayerGUID(pid)..");") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Frag removed successfully.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player do not have frag.") end result:free() else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Failed.") end return true end Não testei...
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.