• 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 Small problem.

Potar

SocialWorld
Senator
Joined
Mar 1, 2009
Messages
1,661
Reaction score
125
Location
Warsaw, Poland
Hello i wrote a Global Save script, i have two problem's.

Everything works but if I have to worry about these errors?

First:

Code:
ots: /usr/include/boost/thread/pthread/condition_variable_fwd.hpp:38: boost::condition_variable::~condition_variable(): Assertion `!pthread_cond_destroy(&cond)' failed.

Second:
Code:
[5:49:00.673] [Error - GlobalEvent Interface] 
[5:49:00.673] In a timer event called from: 
[5:49:00.673] data/globalevents/scripts/global.lua:onTime
[5:49:00.673] Description: 
[5:49:00.673] (luaAddEvent) Callback parameter should be a function.

And there is my script:

LUA:
function onTime()
return prepareShutdown(math.abs(math.ceil(10)))
end

function prepareShutdown(minutes)
	if(minutes <= 0) then
	addEvent(close(), 1*1000)
	addEvent(global(), 10*1000)
		return false
	end

	if(minutes == 1) then
		doBroadcastMessage("Server is going down in " .. minutes .. " minute, please log out now!")
	elseif(minutes <= 3) then
		doBroadcastMessage("Server is going down in " .. minutes .. " minutes, please log out.")
	else
		doBroadcastMessage("Server is going down in " .. minutes .. " minutes.")
	end

	shutdownEvent = addEvent(prepareShutdown, 60000, minutes - 1)
	return true
end


function close()
doSetGameState(GAMESTATE_CLOSED)
end

function global()
doSetGameState(GAMESTATE_SHUTDOWN)
end
 
LUA:
function onTime()
	return prepareShutdown(math.abs(math.ceil(10)))
end
 
function prepareShutdown(minutes)
	if(minutes <= 0) then
		addEvent(close, 1*1000)
		addEvent(global, 10*1000)
		return false
	end
 
	if(minutes == 1) then
		doBroadcastMessage("Server is going down in " .. minutes .. " minute, please log out now!")
	elseif(minutes <= 3) then
		doBroadcastMessage("Server is going down in " .. minutes .. " minutes, please log out.")
	else
		doBroadcastMessage("Server is going down in " .. minutes .. " minutes.")
	end
 
	shutdownEvent = addEvent(prepareShutdown, 60000, minutes - 1)
	return true
end
 
 
function close()
	doSetGameState(GAMESTATE_CLOSED)
end
 
function global()
	doSetGameState(GAMESTATE_SHUTDOWN)
end
 
Back
Top