ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. restartResource

Function

restartResource

Stops and immediately starts a resource, e.g. after its files changed.

Syntax

bool restartResource(resource theResource)

Arguments

theResourceresource
The resource (a handle or a name).

Differences from MTA:SA

  • These MTA:SA arguments are not here: bool persistent = false, bool configs = true, bool maps = true, bool scripts = true, bool html = true, bool clientConfigs = true, bool clientScripts = true, bool clientFiles = true

In MTA:SA

restartResource(resource theResource, bool persistent = false, bool configs = true, bool maps = true, bool scripts = true, bool html = true, bool clientConfigs = true, bool clientScripts = true, bool clientFiles = true)

Returns

true on success.

Example

addCommandHandler("restart", function(player, _, name)
    if hasObjectPermissionTo(player, "command.restart") then
        restartResource(getResourceFromName(name or ""))
    end
end)

See also