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

Help Save/RL SAVE

Mauzim

Member
Joined
Jan 3, 2011
Messages
568
Reaction score
9
Code:
1. At 02:50 -> Broadcast 1 & Block all incomming connections (new logins)
2. At 02:55 -> Broadcast 2
3. At 02:59 -> Broadcast 3
4. At 03:00 -> Close Server (kick everybody)
5. At 03:03 -> Save de server
6. At 03:08 -> Shutdown the server
how do that
and how add reload npc and movements to
Code:
 local config = {
	broadcast = {120, 30},
	shallow = "no",
	delay = 120,
	events = 30
}

config.shallow = getBooleanFromString(config.shallow)

local function executeSave(seconds)
	if(isInArray(config.broadcast, seconds)) then
		local text = ""
		if(not config.shallow) then
			text = "Full s"
		else
			text = "S"
		end

		text = text .. "erver save within " .. seconds .. " seconds, please mind it may freeze!"
		doBroadcastMessage(text)
	end

	if(seconds > 0) then
		addEvent(executeSave, config.events * 1000, seconds - config.events)
	else
		doSaveServer(config.shallow)
	end
end

function onThink(interval)
	if(table.maxn(config.broadcast) == 0) then
		doSaveServer(config.shallow)
	else
		executeSave(config.delay)
	end

	return true
end
please help rep++
 
I need 2 scripts:
1.GLOBAL SAVE BASE ON THIS:
Code:
1. At 02:50 -> Broadcast 1 & Block all incomming connections (new logins)
2. At 02:55 -> Broadcast 2
3. At 02:59 -> Broadcast 3
4. At 03:00 -> Close Server (kick everybody)
5. At 03:03 -> Save de server
6. At 03:08 -> Shutdown the server

2.EDIT MY SCRIPT AND ADD RELOAD NPC AND MOVEMENTS AT SAVE:
Code:
 local config = {
	broadcast = {120, 30},
	shallow = "no",
	delay = 120,
	events = 30
}

config.shallow = getBooleanFromString(config.shallow)

local function executeSave(seconds)
	if(isInArray(config.broadcast, seconds)) then
		local text = ""
		if(not config.shallow) then
			text = "Full s"
		else
			text = "S"
		end

		text = text .. "erver save within " .. seconds .. " seconds, please mind it may freeze!"
		doBroadcastMessage(text)
	end

	if(seconds > 0) then
		addEvent(executeSave, config.events * 1000, seconds - config.events)
	else
		doSaveServer(config.shallow)
	end
end

function onThink(interval)
	if(table.maxn(config.broadcast) == 0) then
		doSaveServer(config.shallow)
	else
		executeSave(config.delay)
	end

	return true
end
 
LUA:
local config = {
	
	--stuff you need in config
	
}


function onThink(interval)

	--call functions
	
	return true
end

local function broadcastWarning(warningNumber)

	-- broadcast a warning
end

local function closeServer()

	-- close the server and kick players
end

local function executeSave()

	-- save the server
end

local function shutdownServer()

	-- shutdown the server
end

Fill in the blanks. ;)
 
Back
Top