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

Function

isResourceProtected

ServerResourcesIdentical to MTA:SA

Checks whether a resource has protected="true" in <info> in meta.xml (a resource other scripts should not stop).

Syntax

bool isResourceProtected(resource theResource)

Arguments

theResourceresource
The resource.

Returns

true when the resource is protected.

Example

for _, res in ipairs(getResources()) do
    if getResourceState(res) == "running" and not isResourceProtected(res) and res ~= getThisResource() then
        stopResource(res)
    end
end

See also