isResourceArchived | Multi Theft Auto: Wiki Skip to content

isResourceArchived

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


Checks whether the specified resource is archived. (Currently running from a ZIP file)

OOP Syntax Help! I don't understand this!

  • Method: resource:isArchived(...)
  • Variable: .archived

Syntax

bool isResourceArchived ( resource resourceElement )
Required Arguments
  • resourceElement: The resource to check.

Returns

  • bool: value

Returns true if the selected resource is archived, false if it is not archived, and nil if some kind of problem occurred.

Code Examples

shared

This example stops the resource if it's archived.

addEventHandler("onResourceStart", resourceRoot,
function(resourceElement)
if isResourceArchived(resourceElement) then
cancelEvent()
end
end
)