- Documentation
- Server functions
- isResourceProtected
Function
isResourceProtected
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