removeResourceFile | Multi Theft Auto: Wiki Skip to content

removeResourceFile

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.


This function removes a file from the resource.

OOP Syntax Help! I don't understand this!

Syntax

bool removeResourceFile ( resource theResource, string fileName )
Required Arguments
  • theResource: The resource element.
  • fileName: The filename what you wan't to delete.

Returns

  • bool: value

Returns true if file was deleted, otherwise false if the resource is in use or the file doesn't exist.

Code Examples

shared

This example removes a .txt file from the resource sx_remanager (in-game script editor) when started.

addEventHandler("onResourceStart",resourceRoot,function()
resource = getResourceFromName("sx_resmanager")
removeResourceFile(resource,"description.txt")
end)