doBroadcastMessage(getPlayerGuildName(cid) .. " has invited " .. enemyName .. " to war till " .. frags .. " frags.", MESSAGE_EVENT_ADVANCE)
return true
end
if(not isInArray({"end", "finish"}, t[1])) then
return false
end
local status = (t[1] == "end" and 1 or 4)
tmp = db.getResult("SELECT `id` FROM `guild_wars` WHERE `guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy .. " AND `status` = " .. status)
if(tmp:getID() ~= -1) then
local query = "UPDATE `guild_wars` SET `end` = " .. os.time() .. ", `status` = 5 WHERE `id` = " .. tmp:getDataInt("id")
tmp:free()
doGuildRemoveEnemy(guild, enemy)
doGuildRemoveEnemy(enemy, guild)
db.query(query)
doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. (status == 4 and "mend fences" or "ended up a war") .. " with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE)
return true
end
if(status == 4) then
doPlayerSendChannelMessage(cid, "", "Currently there's no pending war truce from " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0)
return true
end
tmp = db.getResult("SELECT `id`, `end` FROM `guild_wars` WHERE `guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild .. " AND `status` = 1")
if(tmp:getID() ~= -1) then
if(tmp:getDataInt("end") > 0) then
tmp:free()
doPlayerSendChannelMessage(cid, "", "You cannot request ending for war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0)
return true
end
local query = "UPDATE `guild_wars` SET `status` = 4, `end` = " .. os.time() .. " WHERE `id` = " .. tmp:getDataInt("id")
tmp:free()
db.query(query)
doBroadcastMessage(getPlayerGuildName(cid) .. " has signed an armstice declaration on a war with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE)
return true
end
doPlayerSendChannelMessage(cid, "", "Currently there's no active war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0)
return true
end
ERRO: fica dando um erro no talkaction/scripts/war.lua, diz que está faltando o "END" pra fechar funçao da linha 1, perto do <eof> oq eu faço? acho que está faltando um END no final do script, logo abaixo do último end, pois ao meu ver a primeira função não foi fechada...mas nao tenho certeza! alguém pode me ajudar?
obs: não tentei por o end no fim pq n estou em casa!
Pergunta
Xubeiga 0
e ae gente, eu botei no meu ot o war system desse tópico aqui:
http://www.xtibia.co...em-com-escudos/
o script é:
ERRO: fica dando um erro no talkaction/scripts/war.lua, diz que está faltando o "END" pra fechar funçao da linha 1, perto do <eof> oq eu faço? acho que está faltando um END no final do script, logo abaixo do último end, pois ao meu ver a primeira função não foi fechada...mas nao tenho certeza! alguém pode me ajudar?
obs: não tentei por o end no fim pq n estou em casa!
Link para o comentário
Compartilhar em outros sites
0 respostass a esta questão
Posts Recomendados