mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-15 15:04:53 +02:00
introduce changes from streamside fork
This commit is contained in:
23
data/talkactions/scripts/save.lua
Normal file
23
data/talkactions/scripts/save.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
function onSay(player, words, param)
|
||||
|
||||
local function timeSave(delay, msg)
|
||||
broadcastMessage(msg, MESSAGE_STATUS_WARNING)
|
||||
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, msg)
|
||||
addEvent(saveServer, delay)
|
||||
end
|
||||
|
||||
if not player:getGroup():getAccess() then
|
||||
return true
|
||||
end
|
||||
|
||||
if player:getAccountType() < ACCOUNT_TYPE_GOD then
|
||||
return false
|
||||
end
|
||||
|
||||
if isNumber(param) then
|
||||
local delay = tonumber(param) * 1000
|
||||
timeSave(delay, "Saving server in " .. tonumber(param) .. " seconds.")
|
||||
else
|
||||
saveServer()
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user