Lua Error to gamemode help please!


// read text file generated to initialize listfunction gateKeep:GrabGoingToServer(ServerID)


	local txt = "authedusers" .. tostring(EasternServers:GetServerId()) .. ".txt"


	if file.Exists(txt) then
		local contents = file.Read(txt)
		local ips = EasternServers:PlayerListToIDs(contents)


		SQLLog( "multiserver", "Authorized ips " .. table.concat(ips, ", ") ) **<= 426**
		for _, v in pairs(ips) do
			gateKeep.AuthorizedPlayers[v] = true
		end


		file.Delete(txt)
	
		// we can set state to 4, ready for players, but this means we need to handle the case when nobody joins
		EasternServers:SetState(3)
		timer.Simple( 45, gateKeep.ResetEmptyReadyServer )
	end
	
end

gamemodes/nicksservers/gamemode/scripts/gatekeeper.lua:426] attempt to call global ‘SQLLog’ (a nil value)

Please help.

By the way, I don’t really have any extra information other than this is being retarded. I would appreciate the help. Thank you!

Where is SQLLog() defined?

It was defined in another file, but here look, it works here, but it is defined after ‘then’.


function gateKeep:ResetEmptyReadyServer()

	local Count = gatekeeper.GetNumClients()
	if Count.total == 0 && EasternServers:GetState() == 3 then
	
		SQLLog( "multiserver", "In state 3 too long, changing level" )
		ErrorNoHalt("In state 3 but no players joined, restarting")
		EasternServers:EmptyServer()
		ChangeLevel(EasternServers:GetRandomMap())
		
	end
	
end

It is in the same file, by the way.

Is the file defining the function being included correctly?