Morcega Negra
Banned User
- Joined
- Aug 4, 2015
- Messages
- 102
- Solutions
- 1
- Reaction score
- 8
Hello I have a version of TFS that the only way to save the server is to the command / closeserver with GM, other ways to save him from error, I wonder how to make a global event that CloseServer and after five minutes he gives OpenServer.
That's my talkaction of /closeserver / OpenServer:
I want to turn into globalevent that the close and after 5 min open
That's my talkaction of /closeserver / OpenServer:
Code:
function onSay(cid, words, param, channel)
local state = GAMESTATE_CLOSED
if(words:sub(2, 2) == "o") then
state = GAMESTATE_NORMAL
end
local str = "Failed to " .. (state == GAMESTATE_CLOSED and "close" or "open") .. " server."
if(doSetGameState(state) ~= LUA_ERROR) then
str = "Server has been " .. (state == GAMESTATE_CLOSED and "closed" or "opened") .. " successfully."
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)
return TRUE
end