whole edit: i'm trying to convert this script to 0.2(luasql one) but have some problem when i say /war-invite Absolut it says that my guild is already in war or have a pending invitation ... any1 know the reason ? and i'm not in any war i checked /war-cancel-invite and /war-reject ...
it means that this is returning false instead of true
it means that this is returning false instead of true
Code:
if GuildIsInPEace(invitedGuild) == TRUE then
doInviteToWar(myGuild, invitedGuild)
doBroadcastMessage(BroadCast[1[1]..getPlayerGuildName(cid).. BroadCast[1][2] ..getGuildNameById(invitedGuild).. BroadCast[1][3], BroadCast_Type)
else
function doInviteToWar(myGuild, enemyGuild)
db.executeQuery("UPDATE `guilds` SET `invited_to` = ".. enemyGuild .." WHERE `id` = ".. myGuild .."")
db.executeQuery("UPDATE `guilds` SET `invited_by` = ".. myGuild .." WHERE `id` = ".. enemyGuild .."")
end
function GuildIsInPEace(id)
local Info = getGuildWarInfo(id)
return (Info.To == 0 and Info.By == 0 and Info.With == 0)
end
function getGuildWarInfo(id)
local Info = db.getResult("SELECT `invited_to`, `invited_by`, `in_war_with`,`war_time` FROM `guilds` WHERE `id` = " .. id .. "")
if Info:getID() ~= LUA_ERROR then
local invTo, invBy, warWith, Time = Info:getDataInt("invited_to"), Info:getDataInt("invited_by"), Info:getDataInt("in_war_with"), Info:getDataInt("war_time")
Info:free()
return {To = invTo, By = invBy, With = warWith, T = Time}
end
return LUA_ERROR
end
Last edited: