Ir para conteúdo
Banner com Efeitos

Balkalima

Membro
  • Registro em

  • Última visita

Solutions

  1. Balkalima's post in (Resolvido)[RESOLVIDO] Talkactions ver quantidade de money was marked as the answer   
    Olá pessoal, estou utilizando o TFS 0.4
     
    Bom, meu servidor tem o talkactions para ver a quantidade de money que o player tem "!q" (muito comum em diversos servidores), porem está acontecendo um problema com o método doNumberFormat pois quando eu mando o parâmetro para ele ele apresenta erro dizendo que esperava uma string e recebe null, mas eu já printei o tipo de dado que estou mandando e o tipo de dado que ele esta recebendo e ambos são string, se alguém souber o que está acontecendo 
     
    O erro é este aqui:
     
    Código o data/talkactions/scripts/money.lua
    function onSay(cid, words, param, channel) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have " .. doNumberFormat(tostring(getPlayerMoney(cid))) .. " gold.") return true end    
    Obs: já tentei mandar sem o tostring e o erro é o mesmo citado acima, o que me faz crer que o erro seja do método doNumberFormat
     
    Código do data/lib/050-function.lua
    function doNumberFormat(i) local str, found = string.gsub(i, "(%d)(%d%d%d)$", "%1,%2", 1), 0 repeat str, found = string.gsub(ret, "(%d)(%d%d%d),", "%1,%2,", 1) until found == 0 return str end  
    REP+ para quem conseguir ajudar!
     
     
    -- Edit 1
     
    RESOLVIDO, podem fechar o tópico
     
    O erro se encontrava, como suspeitado, no método doNumberFormat, onda na 4ª linha do 050-function.lua, estava utilizando uma variável não declarada, para quem estiver com o mesmo problema estrei colocando a solução:
     
    troque em data/lib/050-function.lua o método  doNumberFormat por:
    function doNumberFormat(i) local str, found = string.gsub(i, "(%d)(%d%d%d)$", "%1,%2", 1), 0 repeat str, found = string.gsub(str, "(%d)(%d%d%d),", "%1,%2,", 1) until found == 0 return str end  
  2. Balkalima's post in (Resolvido)AJUDA COM NPC, ADICIONAR SETINHA was marked as the answer   
    Cara eu não testei, mas se eu entendi bem o momento em que você quer que a TutorialArrow apareça o código fica assim:
    local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local vocation = {} local town = {} local destination = {} local arrowCave = {x=1104, y=1123, z=7 } 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 local function greetCallback(cid) local player = Player(cid) local level = player:getLevel() if player:getVocation():getId() > 0 then npcHandler:say("You already have a vocation!", cid) return false end return true end local function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end if msgcontains(msg, "yes") and npcHandler.topic[cid] == 0 then npcHandler:say("Great! Then... What profession have you chosen? {KNIGHT}, {PALADIN}, {SORCERER}, or {DRUID}?", cid) npcHandler.topic[cid] = 1 elseif npcHandler.topic[cid] == 1 then if msgcontains(msg, "sorcerer") then npcHandler:say("A SORCERER! Are you sure? this decision is irreversible!", cid) npcHandler.topic[cid] = 3 vocation[cid] = 1 doPlayerAddItem(cid, 2461) doPlayerAddItem(cid, 2651) doPlayerAddItem(cid, 2649) doPlayerAddItem(cid, 2643) doPlayerAddItem(cid, 23771) doPlayerAddItem(cid, 23719) elseif msgcontains(msg, "druid") then npcHandler:say("A DRUID! Are you sure? this decision is irreversible!", cid) npcHandler.topic[cid] = 3 vocation[cid] = 2 doPlayerAddItem(cid, 2461) doPlayerAddItem(cid, 2651) doPlayerAddItem(cid, 2649) doPlayerAddItem(cid, 2643) doPlayerAddItem(cid, 23771) doPlayerAddItem(cid, 23721) elseif msgcontains(msg, "paladin") then npcHandler:say("A PALADIN! Are you sure? this decision is irreversible!", cid) npcHandler.topic[cid] = 3 vocation[cid] = 3 doPlayerAddItem(cid, 2461) doPlayerAddItem(cid, 2651) doPlayerAddItem(cid, 2649) doPlayerAddItem(cid, 2643) doPlayerAddItem(cid, 2456) doPlayerAddItem(cid, 23839, 100) elseif msgcontains(msg, "knight") then npcHandler:say("A KNIGHT! Are you sure? this decision is irreversible!", cid) npcHandler.topic[cid] = 3 vocation[cid] = 4 doPlayerAddItem(cid, 2461) doPlayerAddItem(cid, 2651) doPlayerAddItem(cid, 2649) doPlayerAddItem(cid, 2643) doPlayerAddItem(cid, 2379) doPlayerAddItem(cid, 2512) else npcHandler:say("{KNIGHT}, {PALADIN}, {SORCERER}, OR {DRUID}?", cid) end elseif npcHandler.topic[cid] == 3 then if msgcontains(msg, "yes") then local player = Player(cid) npcHandler:say("So be it, go out and prove your valor! I marked some places to hunt on your map. Go out and explore hero!", cid) player:setVocation(Vocation(vocation[cid])) player:setTown(Town(town[cid])) doAddMapMark(cid, {x=1037, y=1085, z=7}, MAPMARK_SKULL, "Troll Cave") doAddMapMark(cid, {x=1104, y=1058, z=7}, MAPMARK_SKULL, "Bug Sewer") doAddMapMark(cid, {x=1134, y=1092, z=7}, MAPMARK_SKULL, "Rotworm Cave") else npcHandler:say("THEN WHAT? {KNIGHT}, {PALADIN}, {SORCERER}, OR {DRUID}?", cid) npcHandler.topic[cid] = 2 end end doSendMagicEffect(arrowCave,55) return true end local function onAddFocus(cid) town[cid] = 0 vocation[cid] = 0 destination[cid] = 0 end local function onReleaseFocus(cid) town[cid] = nil vocation[cid] = nil destination[cid] = nil end npcHandler:setCallback(CALLBACK_ONADDFOCUS, onAddFocus) npcHandler:setCallback(CALLBACK_ONRELEASEFOCUS, onReleaseFocus) npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) *As mudanças se encontram na linha 8 e 93.
     
    Se não for nesse momento que deseja que apareça, apenas troque a linha 93 de lugar
  3. Balkalima's post in (Resolvido)Mudar Mensagem de BAN was marked as the answer   
    Obrigado... Eu estava vendo outro tópico e consegui. Não me lembro o link para deixar aqui, mas caso alguém queira vou deixar o script aqui:
     
    Vá em data/talkactions/scripts/ban.lua
    function onSay(cid, words, param, channel) local t = param:explode(",") local name, days = t[1], tonumber(t[2]) local player = getPlayerByName(t[1]) if isPlayer(getPlayerByName(name)) == false then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"O jogador "..name.." não esta online ou não existe.") end if name then if days then local acc = getAccountIdByName(name) if acc ~= 0 then local tempo = days * 24 * 3600 doAddAccountBanishment(acc, target, os.time() + tempo, 5, 2, 'Você foi banido pelo administrador' , 0) doRemoveCreature(player) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este player não existe.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode adicionar essa quantidade de dia(s) de dias de banimento.") end end return TRUE end Agora em data/talkactions/talkactions.xml e adicione isto:
    <talkaction words="/ban" acess="4" event="script" value="ban.lua"/> o "acess" você escolhe qual grupo quer por!
     
     
     
    OBS: Esse script é apenas para ban na conta! E me desculpa por qualquer erro ai! 

Informação Importante

Confirmação de Termo