shutdown | Multi Theft Auto: Wiki Skip to content

shutdown

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function shuts down the server.

Syntax

​bool shutdown ( [ ​string reason = "No reason specified", ​number exitCode = 0 ] )
Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.

  • reason (default: "No reason specified"): the reason why the server has been shutdown.
  • exitCode (default: 0): MISSING_PARAM_DESC

Returns

  • bool: value

Returns false if it was not possible to shut down the server.

Code Examples

shared

This command shuts down the server on request

addCommandHandler ( "shutdown", function ( player, command, reason )
if ( hasObjectPermissionTo ( player, "function.shutdown" ) ) then
shutdown ( reason or "" )
end
end )