Postado Dezembro 8, 2016 8 anos Olá Tk , eu gostaria de uma script que remove o pk red e o frags do player , e porque estou com um problema na que estou usando. quando o personagem loga o pk red volta novamente, mais o frags somem. pode ser tanto no npc ou ao usar um item . Uso tfs.0.3.6 Mnha script : Citar local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, "remover") then npcHandler:say("Voce quer remover seu red skull por 1000 golds? {yes} ou {no}.", cid) talkState[talkUser] = 1 elseif msgcontains(msg, "no") and talkState[talkUser] == 1 then npcHandler:say("Esta bem, quando decidir fale comigo novamente.", cid) talkState[talkUser] = 0 elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then if getCreatureSkullType(cid) < SKULL_RED then npcHandler:say("Voce nao esta red skull.", cid) else if doPlayerRemoveMoney(cid, 10000000) 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) npcHandler:say("Seu red skull foi removido.", cid) else npcHandler:say("Voce nao tem dinheiro... voce prescisa de 1000 golds para tirar seu red skull.", cid) end end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Postado Dezembro 12, 2016 8 anos Olá amigo tudo bem?? Estou um pouco inferrujado, mas acredito que o seu "erro" é simples, falta alterar o skulltime no banco de dados, a final se você remove a skull, tem que remover o tempo que continua lá... Tente usar este a baixo, se tiver algum problema me avise! local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, "remover") then npcHandler:say("Voce quer remover seu red skull por 1000 golds? {yes} ou {no}.", cid) talkState[talkUser] = 1 elseif msgcontains(msg, "no") and talkState[talkUser] == 1 then npcHandler:say("Esta bem, quando decidir fale comigo novamente.", cid) talkState[talkUser] = 0 elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then if getCreatureSkullType(cid) < SKULL_RED then npcHandler:say("Voce nao esta red skull.", cid) else if doPlayerRemoveMoney(cid, 10000000) then db.executeQuery("UPDATE killers SET unjustified = '0' WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = "..getPlayerGUID(cid)..")") db.executeQuery("UPDATE players SET skulltime = '0' WHERE player_id = "..getPlayerGUID(cid)..")") doCreatureSetSkullType(cid, 0) else npcHandler:say("Voce nao tem dinheiro... voce prescisa de 1000 golds para tirar seu red skull.", cid) end end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Abraço! xBlackWolf THX @Storm Night Best Avatar Ever
Postado Dezembro 13, 2016 8 anos Autor 11 horas atrás, xBlackWolf disse: Olá amigo tudo bem?? Estou um pouco inferrujado, mas acredito que o seu "erro" é simples, falta alterar o skulltime no banco de dados, a final se você remove a skull, tem que remover o tempo que continua lá... Tente usar este a baixo, se tiver algum problema me avise! local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, "remover") then npcHandler:say("Voce quer remover seu red skull por 1000 golds? {yes} ou {no}.", cid) talkState[talkUser] = 1 elseif msgcontains(msg, "no") and talkState[talkUser] == 1 then npcHandler:say("Esta bem, quando decidir fale comigo novamente.", cid) talkState[talkUser] = 0 elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then if getCreatureSkullType(cid) < SKULL_RED then npcHandler:say("Voce nao esta red skull.", cid) else if doPlayerRemoveMoney(cid, 10000000) then db.executeQuery("UPDATE killers SET unjustified = '0' WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = "..getPlayerGUID(cid)..")") db.executeQuery("UPDATE players SET skulltime = '0' WHERE player_id = "..getPlayerGUID(cid)..")") doCreatureSetSkullType(cid, 0) else npcHandler:say("Voce nao tem dinheiro... voce prescisa de 1000 golds para tirar seu red skull.", cid) end end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Abraço! Olá amigo aqui removeu o frags e o pk red como antes, mais quando reloga o red volta novamente e ainda da erro no talkactions quando tento falar !frags
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.