IsResourceArchived: Difference between revisions
Jump to navigation
Jump to search
(Correcting incorrect phrases, replacing the existing example and adding more examples.) |
m (→See Also) |
||
Line 56: | Line 56: | ||
==See Also== | ==See Also== | ||
{{ | {{Resource_functions|server}} |
Latest revision as of 22:48, 6 September 2024
Checks whether the specified resource is archived. (Currently running from a ZIP file)
Syntax
bool isResourceArchived(resource resourceElement)
OOP Syntax Help! I don't understand this!
- Method: resource:isArchived(...)
- Variable: .archived
Required Arguments
- resourceElement: The resource to check.
Returns
Returns true if the selected resource is archived, false if it is not archived, and nil if some kind of problem occurred.
Example
Click to collapse [-]
Example 1This example stops the resource if it's archived.
addEventHandler("onResourceStart", resourceRoot, function(resourceElement) if isResourceArchived(resourceElement) then cancelEvent() end end )
Click to collapse [-]
Example 2 (OOP)This example stops the resource if it's archived by using the object oriented method. (It's important to note that you need to enable OOP in meta.xml to use this)
addEventHandler("onResourceStart", resourceRoot, function(resourceElement) if resourceElement:isArchived() then cancelEvent() end end )
Click to collapse [-]
Example 3 (OOP)This example stops the resource if it's archived by using the object oriented variable. (It's important to note that you need to enable OOP in meta.xml to use this)
addEventHandler("onResourceStart", resourceRoot, function(resourceElement) if resourceElement.archived then cancelEvent() end end )
See Also
- addResourceConfig
- addResourceMap
- callRemote
- copyResource
- createResource
- deleteResource
- getResourceACLRequests
- getResourceInfo
- getResourceLastStartTime
- getResourceLoadFailureReason
- getResourceLoadTime
- getResourceMapRootElement
- getResourceOrganizationalPath
- getResources
- isResourceArchived
- isResourceProtected
- refreshResources
- removeResourceFile
- renameResource
- restartResource
- setResourceInfo
- startResource
- stopResource
- updateResourceACLRequest
- Shared
- abortRemoteRequest
- call
- fetchRemote
- getResourceConfig
- getResourceDynamicElementRoot
- getResourceExportedFunctions
- getResourceFromName
- getResourceName
- getResourceRootElement
- getResourceState
- getThisResource
- getRemoteRequests
- getRemoteRequestInfo