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

Message on save

Gregor

New Member
Joined
Feb 29, 2008
Messages
770
Reaction score
3
Location
UK/POLAND
Hello!

i want message befor server save like:

"Server save in 30 sec!"

After 30 sec (after save):
"Server save done, next save in 30 minutes."

Thanks :)
 
he talk about global events

function executeSave()
saveServer()
doBroadcastMessage("Server save done, next save in 30 minutes.")
return TRUE
end

function onThink(interval, lastExecution)
doBroadcastMessage("Server save in 30 sec!.")
addEvent(executeSave, 300000)
return TRUE
end


not testedd and how much time must be execute save you must configure;P
 
Hello!

i want message befor server save like:

"Server save in 30 sec!"

After 30 sec (after save):
"Server save done, next save in 30 minutes."

Thanks :)

TFS 0.3 or 0.2?

This is for 0.3;

Go to data/globalevent/scripts/save.lua and replace it with:
Code:
local function saveGame()
	saveServer()
	doBroadcastMessage("Next save in 30 minutes.")
        return TRUE
end

function onThink(interval, lastExecution)
	doBroadcastMessage("Saving Server in 30 seconds.")
	addEvent(saveGame, 30000)
	return TRUE
end
and change saves interval in globalevents.xml to 1770.
 
he talk about global events

function executeSave()
saveServer()
doBroadcastMessage("Server save done, next save in 30 minutes.")
return TRUE
end

function onThink(interval, lastExecution)
doBroadcastMessage("Server save in 30 sec!.")
addEvent(executeSave, 300000)
return TRUE
end


not testedd and how much time must be execute save you must configure;P

So this i should put in gobal.lua
But where i need to configure the server save time in config.lua?
 
you put this to sctrips in folder globalevents and in global.xml

<globalevent name="save" interval="57600" script="nameofyourscript.lua"/>

interval is time fot how much is ss and addEvent(executeSave, 300000) is time when you see the message then 30 seconds you must put there 30 000
 
you put this to sctrips in folder globalevents and in global.xml

<globalevent name="save" interval="57600" script="nameofyourscript.lua"/>

interval is time fot how much is ss and addEvent(executeSave, 300000) is time when you see the message then 30 seconds you must put there 30 000

I using TFS 0.2, i dont have folder globalevents.
 
Back
Top