• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

The Forgotten Server has Stopped Working?

Well, as you can see the script is kinda old, maybe isn't compatible with your TFS version (which is 8.60) do yo mean that this only happens when you active this GW system?
 
In the PM you sent me yesterday, you said you got an error when adding the GuildWar script, is this error causing the crash? if it is, do what I said and add the correct GuildWar.lua script.
So this one:
LUA:
function guildExists(guildId)
	if(type(guildId) ~= 'number') then
		return FALSE, error("luaGuildExists: number expected for 'guildId' (got " .. type(guildId) .. ")", 2)
	end
	
	local res = db.getResult("SELECT `id` FROM `guilds` WHERE `id` = " .. guildId)
	if(res:getID() ~= LUA_ERROR) then
		res:free()
		return TRUE
	end
	
	return FALSE
end

function isGuildInWar(guildId)
	if(guildExists(guildId) == TRUE) then
		return FALSE
	end
	
	return FALSE
end

function getGuildIdByName(name)
	if(type(name) ~= 'string') then
		return FALSE, error("luaGetGuildIdByName: string expected for 'name' (got " .. type(name) .. ")", 2)
	end
	
	local res = db.getResult("SELECT `id` FROM `guilds` WHERE `name` = " .. db.escapeString(name))
	if(res:getID() ~= LUA_ERROR) then
		local id = res:getDataInt "id"
		res:free()
		
		return id
	end
	
	return FALSE
end

function getGuildLeaderRank(guildId)
	if(guildExists(guildId) == FALSE) then
		return FALSE
	end
	
	local res = db.getResult("SELECT `name` FROM `guild_ranks` WHERE `guild_id` = " .. guildId .. " ORDER BY level DESC LIMIT 1;")
	local leaderId = res:getDataString "name"
	res:free()
	
	return leaderId
end

function getGuildWarId(guildId, status)
	if(type(status) ~= 'number') then
		return FALSE, error("luaGetGuildWarId: number expected for 'status' (got " .. type(status) .. ")", 2)
	elseif(guildExists(guildId) == FALSE) then
		return FALSE
	end
	
	local res = db.getResult("SELECT `war_id` FROM `guilds` WHERE `id` = " .. guildId .. ", `war_status` = " .. status)
	if(res:getID() ~= LUA_ERROR) then
		local warId = res:getDataInt "war_id"
		res:free()
	
		return warId
	end
	
	return FALSE
end

function setGuildWarId(guildId, warId, status)
	if(type(status) ~= 'number') then
		return FALSE, error("luaSetGuildWarId: number expected for 'status' (got " .. type(status) .. ")", 2)
	elseif(guildExists(guildId) == FALSE or guildExists(warId) == FALSE) then
		return FALSE
	end
	
	local res = db.executeQuery("UPDATE `guilds` SET `war_id` = " .. warId .. ", `war_status` = " .. status .. " WHERE `id` = " .. guildId)
	return TRUE
end

function isInGuildWar(cid, player)
	local guildId = getPlayerGuildId(cid)
	if(guildId ~= FALSE) then
		return FALSE
	end
	
	return FALSE
end
 
In the PM you sent me yesterday, you said you got an error when adding the GuildWar script, is this error causing the crash? if it is, do what I said and add the correct GuildWar.lua script.
So this one:
LUA:
function guildExists(guildId)
	if(type(guildId) ~= 'number') then
		return FALSE, error("luaGuildExists: number expected for 'guildId' (got " .. type(guildId) .. ")", 2)
	end
	
	local res = db.getResult("SELECT `id` FROM `guilds` WHERE `id` = " .. guildId)
	if(res:getID() ~= LUA_ERROR) then
		res:free()
		return TRUE
	end
	
	return FALSE
end

function isGuildInWar(guildId)
	if(guildExists(guildId) == TRUE) then
		return FALSE
	end
	
	return FALSE
end

function getGuildIdByName(name)
	if(type(name) ~= 'string') then
		return FALSE, error("luaGetGuildIdByName: string expected for 'name' (got " .. type(name) .. ")", 2)
	end
	
	local res = db.getResult("SELECT `id` FROM `guilds` WHERE `name` = " .. db.escapeString(name))
	if(res:getID() ~= LUA_ERROR) then
		local id = res:getDataInt "id"
		res:free()
		
		return id
	end
	
	return FALSE
end

function getGuildLeaderRank(guildId)
	if(guildExists(guildId) == FALSE) then
		return FALSE
	end
	
	local res = db.getResult("SELECT `name` FROM `guild_ranks` WHERE `guild_id` = " .. guildId .. " ORDER BY level DESC LIMIT 1;")
	local leaderId = res:getDataString "name"
	res:free()
	
	return leaderId
end

function getGuildWarId(guildId, status)
	if(type(status) ~= 'number') then
		return FALSE, error("luaGetGuildWarId: number expected for 'status' (got " .. type(status) .. ")", 2)
	elseif(guildExists(guildId) == FALSE) then
		return FALSE
	end
	
	local res = db.getResult("SELECT `war_id` FROM `guilds` WHERE `id` = " .. guildId .. ", `war_status` = " .. status)
	if(res:getID() ~= LUA_ERROR) then
		local warId = res:getDataInt "war_id"
		res:free()
	
		return warId
	end
	
	return FALSE
end

function setGuildWarId(guildId, warId, status)
	if(type(status) ~= 'number') then
		return FALSE, error("luaSetGuildWarId: number expected for 'status' (got " .. type(status) .. ")", 2)
	elseif(guildExists(guildId) == FALSE or guildExists(warId) == FALSE) then
		return FALSE
	end
	
	local res = db.executeQuery("UPDATE `guilds` SET `war_id` = " .. warId .. ", `war_status` = " .. status .. " WHERE `id` = " .. guildId)
	return TRUE
end

function isInGuildWar(cid, player)
	local guildId = getPlayerGuildId(cid)
	if(guildId ~= FALSE) then
		return FALSE
	end
	
	return FALSE
end

Okay i well

- - - Updated - - -

Its NOT working i get same error!!

- - - Updated - - -

Limos Its not working i get agend https://i.imgur.com/eLMmv44.png
 
So you added the right script and now it crashes without error?

What happens if you remove the script, it still crashes when loading?
 
From the start you already had the scripts right in talkactions, so you never had to change there anything. You said when you added the GuildWar.lua in the first folder you got an error. You still didn't tell me when you got this error if your server crashed, so I will assume it didn't. So what did you do then before it crashed while loading.
 
That is not an error, that is a crash (an error is when you get a message with error in your console), so you did something else besides adding the GuildWar.lua file.
 
Oh

GuildWar.lua from first folder

LUA:
function guildExists(guildId)
	if(type(guildId) ~= 'number') then
		return FALSE, error("luaGuildExists: number expected for 'guildId' (got " .. type(guildId) .. ")", 2)
	end
	
	local res = db.getResult("SELECT `id` FROM `guilds` WHERE `id` = " .. guildId)
	if(res:getID() ~= LUA_ERROR) then
		res:free()
		return TRUE
	end
	
	return FALSE
end

function isGuildInWar(guildId)
	if(guildExists(guildId) == TRUE) then
		return FALSE
	end
	
	return FALSE
end

function getGuildIdByName(name)
	if(type(name) ~= 'string') then
		return FALSE, error("luaGetGuildIdByName: string expected for 'name' (got " .. type(name) .. ")", 2)
	end
	
	local res = db.getResult("SELECT `id` FROM `guilds` WHERE `name` = " .. db.escapeString(name))
	if(res:getID() ~= LUA_ERROR) then
		local id = res:getDataInt "id"
		res:free()
		
		return id
	end
	
	return FALSE
end

function getGuildLeaderRank(guildId)
	if(guildExists(guildId) == FALSE) then
		return FALSE
	end
	
	local res = db.getResult("SELECT `name` FROM `guild_ranks` WHERE `guild_id` = " .. guildId .. " ORDER BY level DESC LIMIT 1;")
	local leaderId = res:getDataString "name"
	res:free()
	
	return leaderId
end

function getGuildWarId(guildId, status)
	if(type(status) ~= 'number') then
		return FALSE, error("luaGetGuildWarId: number expected for 'status' (got " .. type(status) .. ")", 2)
	elseif(guildExists(guildId) == FALSE) then
		return FALSE
	end
	
	local res = db.getResult("SELECT `war_id` FROM `guilds` WHERE `id` = " .. guildId .. ", `war_status` = " .. status)
	if(res:getID() ~= LUA_ERROR) then
		local warId = res:getDataInt "war_id"
		res:free()
	
		return warId
	end
	
	return FALSE
end

function setGuildWarId(guildId, warId, status)
	if(type(status) ~= 'number') then
		return FALSE, error("luaSetGuildWarId: number expected for 'status' (got " .. type(status) .. ")", 2)
	elseif(guildExists(guildId) == FALSE or guildExists(warId) == FALSE) then
		return FALSE
	end
	
	local res = db.executeQuery("UPDATE `guilds` SET `war_id` = " .. warId .. ", `war_status` = " .. status .. " WHERE `id` = " .. guildId)
	return TRUE
end

function isInGuildWar(cid, player)
	local guildId = getPlayerGuildId(cid)
	if(guildId ~= FALSE) then
		return FALSE
	end
	
	return FALSE
end

and the guildwar.lua from talkactions/script

LUA:
dofile("./GuildWar.lua")

function onSay(cid, words, param)
	if getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER then
		local myGuild = getPlayerGuildId(cid)
		if words == "/war-invite" then
			if GuildIsInPEace(myGuild) == true then
				if param ~= "" then
					if guildExist(param) ~= LUA_ERROR then
						local invitedGuild = getGuildId(param)
						if invitedGuild ~= LUA_ERROR then
							if invitedGuild ~= myGuild then
								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
									doPlayerSendCancel(cid, CancelMessagesWar[6])
								end
							else
								doPlayerSendCancel(cid, CancelMessagesWar[8])
							end
						else
							doPlayerSendCancel(cid, CancelMessagesWar[4])
						end
					else
						doPlayerSendCancel(cid, CancelMessagesWar[4])
					end
				else
					doPlayerSendCancel(cid, CancelMessagesWar[7])
				end
			else
				doPlayerSendCancel(cid, CancelMessagesWar[5])
			end
		elseif words == "/war-accept" then
			if getGuildWarInfo(myGuild).By ~= 0 then
				local enemyGuild = getGuildWarInfo(myGuild).By
				doBroadcastMessage(BroadCast[2][1] ..getPlayerGuildName(cid).. BroadCast[2][2] ..getGuildNameById(enemyGuild).. BroadCast[2][3], BroadCast_Type)
				WarAccept(myGuild, enemyGuild)
			else
				doPlayerSendCancel(cid, CancelMessagesWar[1])
			end
		elseif words == "/war-reject" then
			if getGuildWarInfo(myGuild).By ~= 0 then
				doBroadcastMessage(BroadCast[3][1] ..getPlayerGuildName(cid).. BroadCast[3][2] ..getGuildNameById(getGuildWarInfo(myGuild).By).. BroadCast[3][3], BroadCast_Type)
				cleanInfo(getGuildWarInfo(myGuild).By)
				cleanInfo(myGuild)
			else
				doPlayerSendCancel(cid, CancelMessagesWar[1])	
			end
		elseif words == "/war-cancel-invite" then
			if getGuildWarInfo(myGuild).To ~= 0 then
				if getGuildWarInfo(myGuild).With == 0 then
					doBroadcastMessage(BroadCast[4][1] ..getPlayerGuildName(cid).. BroadCast[4][2] ..getGuildNameById(getGuildWarInfo(myGuild).To).. BroadCast[4][3], BroadCast_Type)
					cleanInfo(getGuildWarInfo(myGuild).To)
					cleanInfo(myGuild)
				else
					doPlayerSendCancel(cid, CancelMessagesWar[3])
				end
			else
				doPlayerSendCancel(cid, CancelMessagesWar[1])	
			end
		elseif words == "/war-challenge" then
			local map = Maps[param]
			if map then
				if getGuildWarInfo(myGuild).With ~= 0 and getGuildWarInfo(myGuild).ON == 0 then
					local enemyGuild = getGuildWarInfo(myGuild).With
					addEvent(StarWar, 15 * 1000, {myGuild = myGuild, enemyGuild = enemyGuild, map = param})
					doBroadcastMessage(BroadCast[5][1] ..getPlayerGuildName(cid).. BroadCast[5][2] ..getGuildNameById(enemyGuild).. BroadCast[5][3] .. param ..".", BroadCast_Type)
				else
					doPlayerSendCancel(cid, CancelMessagesWar[10])
				end
			else
				doPlayerSendCancel(cid, CancelMessagesWar[9])
			end
		elseif words == "/war-cancel" then
			local enemy = getGuildWarInfo(myGuild).With
			if enemy ~= 0 then
				if (os.time() - getGuildWarInfo(myGuild).T) >= (60 * DelayToCancel) then
					StopWar(myGuild, enemy)
					doBroadcastMessage(BroadCast[6][1] ..getGuildNameById(myGuild).. BroadCast[6][2] ..getGuildNameById(enemy).. BroadCast[6][3], BroadCast_Type)
				else
					doPlayerSendCancel(cid, CancelMessagesWar[11])
				end
			else
				doPlayerSendCancel(cid, CancelMessagesWar[10])
			end
		end
	else
		doPlayerSendCancel(cid, CancelMessagesWar[2])
	end
	local file = io.open("data/logs/Wars.txt", "a") 
	file:write("".. os.date("%d %B %Y %X ", os.time()) .." -->  "..getCreatureName(cid)..": "..words.." "..param.."\n") 
	file:close() 
	return TRUE
end
 
I've tried everything!
This Guild War System is NOT good!
When i Delete Guild War System all server Works just fine!!!:mad:<_<:blink:
 

Similar threads

Replies
8
Views
3K
Back
Top