From Multi Theft Auto: Wiki
Jump to navigation Jump to search

This function shuts down the server.

Make sure your server ACL setup has function.shutdown object protected.


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

Optional Arguments

  • reason: the reason why the server has been shutdown.
  • exitCode: the server application exit code to be returned on shutdown.


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


This command shuts down the server on request

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

See Also