Ir para conteúdo
  • Cadastre-se

Posts Recomendados

a 1ª vez a war anti-entrosa funciona normalmente, já na segunda da o seguinte erro.

 

[Error - TalkAction Interface]
data/talkactions/scripts/citywar.lua:onSay
Description:
data/talkactions/scripts/citywar.lua:104: attempt to index local 'v' (a boolean value)
stack traceback:
data/talkactions/scripts/citywar.lua:104: in function 'cityWarGo'
data/talkactions/scripts/citywar.lua:167: in function <data/talkactions/scripts/citywar.lua:136>

 

 --------------- tudo que tem dentro do arquivo ---------------

 

-- /citywar invite, guild, cidade, numero, modo, tempo
local function cityWarInvite(cid, param)

local guildId = getGuildId(param[2])
    if guildId == false then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid guild name.")
        return false
    end
    if guildId == getPlayerGuildId(cid) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid guild invite.")
        return false    
    end
    if isGuildAntiEntrosa(guildId) or isGuildAntiEntrosa(getPlayerGuildId(cid)) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Guild already on war.")
        return false        
    end
local nomeB = param[2]
    
    --if not cityWarExtraRequirements(cid, guildId) then
        --return false
    --end    
local ret, instance = isInAnyArray(War.cidade_string, param[3])
    if ret then        
        instanceid = Instance:getFree(instance)
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid city name.")
        return false
    end
    
local numero = 0
    if tonumber(param[4]) and isInAnyArray(War.numero, tonumber(param[4])) then
        numero = tonumber(param[4])
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid number of players.")
        return false
    end
    
local ret, modo = isInAnyArray(War.modo_string, param[5])
    if not ret then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid type name.")
        return false
    end

local preco, tempo = 0, 0
    if tonumber(param[6]) then
        tempo = tonumber(param[6])
        ret, preco = isInAnyArray(War.tempo, tonumber(param[6]))
        if not ret then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid duration time.")
            return false
        end
        if not doPlayerWithdrawMoney(cid, War.preco[preco]) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Not enough money.")
            return false            
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid duration time.")
        return false
    end        

local config = {
    desafiante = cid,
    nomeA = getPlayerGuildName(cid),
    nomeB = nomeB,
    tempo = tempo,
    valor = War.preco[preco],
    modo = modo,
    numero = numero,
    cidade = instance,
    instanceid = instanceid,
    guildA = getPlayerGuildId(cid),
    guildB = guildId
}

    Wars(config)
end

-- /citywar accept, guild
local function cityWarAccept(cid, param)
local selfGuild = getPlayerGuildId(cid)
local invitingGuild = getGuildId(param[2])
    if selfGuild == invitingGuild then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot accept your own request.")
        return
    end
    for _, v in pairs(Wars) do
        if type(v) == 'table' then
            if v:isGuildOnWar(invitingGuild) and v:isGuildOnWar(selfGuild) then
                if doPlayerWithdrawMoney(cid, v.valor) then
                    v:start()
                else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Not enough money.")
                end
            end
        end
    end
end

-- /citywar go
local function cityWarGo(cid)
selfGuild = getPlayerGuildId(cid)
    for _, v in pairs(Wars) do
        if not v == false then
            if v:isGuildOnWar(selfGuild) then
                if getTileInfo(getThingPosition(cid)).protection == false then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Please go to a protection zone.")
                    return true
                end
                return v:newPlayer(cid)
            end
        end
    end
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your guild is not in a war.")
    return true
end

-- /citywar exit
local function cityWarExit(cid)
    if getPlayerWarType(cid) <= 0 then
        return false
    end
    selfGuild = getPlayerGuildId(cid)
    for _, v in pairs(Wars) do
        if type(v) == 'table' then
            if v:isGuildOnWar(selfGuild) then
                if getTileInfo(getThingPosition(cid)).protection == false then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Please go to a protection zone.")
                    return true
                end
                v:removePlayer(cid)
            end
        end
    end
end

function onSay(cid, words, param, channel)
    if(param == '') then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
        return true
    end    

    local t = string.explode(param, ",")
    local ret = RETURNVALUE_NOERROR

    local comando = t[1]
    if comando == "accept" then
        if isGuildLeader(cid) then
            if getPlayerWarType(cid) < 1 then
                cityWarAccept(cid, t)
            else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are already in a war.")    
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are not a guild leader.")            
        end
    elseif comando == "invite" then
        if isGuildLeader(cid) then
            if getPlayerWarType(cid) < 1 then
                cityWarInvite(cid, t)
            else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are already in a war.")    
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are not a guild leader.")            
        end
    elseif comando == "go" then
        if not cityWarGo(cid) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player number limit reached.")            
        end
    elseif comando == "exit" then
        if not cityWarExit(cid) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are not in war.")
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid command param.")
    end
    return true
end

Editado por samersz (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • 5 months later...

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por Jaurez
      .
    • Por Cat
      Em alguns casos, o tibia 8.60 comum não abre de jeito nenhum no map editor, mesmo desmarcando check file signatures e configurando o path corretamente.
       
      Este é o client 8.60 adaptado para o Remere's Map Editor. Resolvi postar já que ele foi removido do site oficial do RME. (ficou apenas a versão para linux lá)
      Se estiver tendo problemas para abrir a versão 8.60, tente utilizar este.
                                                                                                                     
      Baixar o Tibia Client 8.60 que funciona no Remere’s Map Editor
      Essa versão do Tibia 8.60 client resolve o erro unsupported client version ou Could not locate tibia.dat and/or tibia.spr, please navigate to your tibia 8.60 installation folder.
       
      Downloads
      https://tibiaking.com/applications/core/interface/file/attachment.php?id=47333

      Scan: https://www.virustotal.com/gui/file/333e172ac49ba2028db9eb5889994509e7d2de28ebccfa428c04e86defbe15cc
       
    • Por danilo belato
      Fala Galera To Com um problema aki 
       
      quero exporta umas sprites de um server para colocar em outro 
       
      eu clico na sprites ai aparece tds a forma delas do lado de la >>
       
      ai eu clico nela e ponho a opiçao de export mais quando salvo a sprite ela n abri 
       
      aparece isso quando tento vê-la 
       
      visualização não disponível ( no formatos png e bitmap)
       
      Agora no formato idc fala que o paint n pode ler 
       
      me ajudem ae...
    • Por Vitor Bicaleto
      Galera to com o script do addon doll aqui, quando eu digito apenas "!addon" ele aparece assim: Digite novamente, algo está errado!"
      quando digito por exemplo: "!addon citizen" ele não funciona e não da nenhum erro
       
      mesma coisa acontece com o mount doll.. 
    • Por Ayron5
      Substitui uma stone no serve, deu tudo certo fora  esse  erro ajudem  Valendo  Rep+  Grato  

      Erro: data/actions/scripts/boost.lua:557: table index is nil
       [Warning - Event::loadScript] Cannot load script (data/actions/scripts/boost.lua)

      Script:
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo