ServerExit: Difference between revisions
From Onset Developer Wiki
X7airworker (talk | contribs) No edit summary |
No edit summary |
||
Line 11: | Line 11: | ||
== 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}} | ||
__EDIT_ME__ | __EDIT_ME__ |
Revision as of 15:37, 17 November 2019
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)
See also
__EDIT_ME__