ServerExit: Difference between revisions

From Onset Developer Wiki
No edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 11: Line 11:


== 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