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|__EDIT_ME__}}
{{FuncDescription|Shutdowns the server.}}


{{FuncSyntax|ServerExit([, ExitMessage])}}
{{FuncSyntax|ServerExit([, ExitMessage])}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParamOptional|ExitMessage|__EDIT_ME__}}
{{FuncParamOptional|ExitMessage|A shutdown message.}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|This function doesn't have a return value.}}


== Example ==
== Example ==
__EDIT_ME__
<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__
*[[GetServerTickRate]]
*[[ServerExit]]
*[[SetServerName]]
*[[GetServerName]]
*[[GetMaxPlayers]]

Latest revision as of 18:43, 30 August 2020

ServerExit

Type: Function
Context: Server
Introduced: v1.0

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