• 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!

Lua GuildWar.lua: No such file or directory

Please follow the Support rules
#1. Use a clear yet descriptive title with your problem and keep it objective!
http://otland.net/f16/need-help-ask-properly-correctly-18402/
I will change the title for you this time.

Use this link for your problem.
http://otland.net/f132/guild-war-request-rep-28263/#post284667

Okay.

- - - Updated - - -

Limos Wher to put this

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

I do not understand this

Go to TFS Folder and create an LUA File, With a name: "guild_war"
 
Look further in the thread what Darkhaos says about the problem.
is your mistake.. "no such file or directory".

checks that the name of the file that one finds in the first folder (where the config.lua is) has the correct name (GuildWar.lua)
 
hehehe :rolleyes:

I ask where to put this Script:

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

- - - Updated - - -

Lime in /???/???
 
yes please u try it i send to u mail

- - - Updated - - -

my id and pass TeamViewer 8

- - - Updated - - -

Can u please try
 
Just add the lua file with name GuildWar.lua in the place where your config.lua, data, doc, mods, schemas, dll files, etc is (so in the same folder as those files/folders), you can't really do this wrong, unless the name is wrong, so be sure it's called GuildWar.
 
Last edited:
Back
Top