deleteResource
Server
Takes a stopped resource out of the resource list and moves its folder or archive into the trash folder of the server's resource cache.
bool deleteResource(resource|string resource)
Parameters
| Name | Type | Description |
|---|---|---|
| resource | resource|string | The resource, or its name. |
Returns
true if the resource was moved, false otherwise.
Example
addCommandHandler("delres", function(player, command, name)
if getResourceState(name) == "loaded" then
deleteResource(name)
end
end)NoteA resource that is not stopped cannot be deleted. Since
stopResource only stops the resource on the next pulse, calling deleteResource right after it fails.