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

Function

startResource

Starts a stopped resource. It loads its scripts, maps and files, and players download it.

Syntax

bool startResource(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 startIncludedResources = true, bool loadServerConfigs = true, bool loadMaps = true, bool loadServerScripts = true, bool loadHTML = true, bool loadClientConfigs = true, bool loadClientScripts = true, bool loadFiles = true

In MTA:SA

startResource(resource resourceToStart, bool persistent = false, bool startIncludedResources = true, bool loadServerConfigs = true, bool loadMaps = true, bool loadServerScripts = true, bool loadHTML = true, bool loadClientConfigs = true, bool loadClientScripts = true, bool loadFiles = true)

Returns

true if the resource started.

Example

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

See also