ServerExit: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|ServerExit([, ExitMessage])}} {{FuncParameters}} {{FuncParamOptional|ExitMessage|__EDIT_ME__}} {{..." |
No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Info|Function|Server|1.0}} | {{Info|Function|Server|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Shutdowns the server.}} | ||
{{FuncSyntax|ServerExit([, ExitMessage])}} | {{FuncSyntax|ServerExit([, ExitMessage])}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParamOptional|ExitMessage| | {{FuncParamOptional|ExitMessage|A shutdown message.}} | ||
{{FuncReturnValue| | {{FuncReturnValue|This function doesn't have a return value.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua> | |||
AddCommand("shutdown", function(playerid) | |||
AddPlayerChat(playerid, "Shutting down the server...") | |||
ServerExit("Server shutdown by"..GetPlayerName(playerid)) | |||
return | |||
end) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
*[[GetServerTickRate]] | |||
*[[ServerExit]] | |||
*[[SetServerName]] | |||
*[[GetServerName]] | |||
*[[GetMaxPlayers]] |
Latest revision as of 18:43, 30 August 2020
Description
Shutdowns the server.
Syntax
ServerExit([, ExitMessage])
Parameters
- ExitMessage (optional)
A shutdown message.
Return Value
- This function doesn't have a return value.
Example
AddCommand("shutdown", function(playerid)
AddPlayerChat(playerid, "Shutting down the server...")
ServerExit("Server shutdown by"..GetPlayerName(playerid))
return
end)