- Documentation
- Server functions
- deleteResource
Function
deleteResource
Deletes a stopped resource from disk together with its folder. A script may delete only a resource it created itself with createResource.
Syntax
bool deleteResource(resource theResource)Arguments
theResourceresource- The resource (must be stopped).Different type in MTA:SA: string resourceName
Differences from MTA:SA
- Arguments in a different colour differ from MTA:SA.
In MTA:SA
deleteResource(string resourceName)Returns
true on success.
Example
deleteResource(getResourceFromName("smieci"))
See also
createResourceCreates a new empty resource (a folder withmeta.xml) inresources/, optionally in a category such as[maps]. The name may contain letters, digits,_and-; if such a resource already exists it returnsfalse. The script that created the resource may then write files in it with a":name/file"path (fileCreate,xmlCreateFile), add entries withaddResourceMap/addResourceConfigand delete it withdeleteResource. Start the new resource withstartResource; on the next server start it starts by itself.stopResourceStops a running resource. Its elements, timers, commands and key binds go away.