- Documentation
- Server functions
- copyResource
Function
copyResource
Copies a resource under a new name. In the current server version the function is not wired up yet and returns false with a warning.
Syntax
resource copyResource(resource theResource, string newResourceName [, string organizationalPath])Arguments
theResourceresource- The resource to copy.
newResourceNamestring- The new name.
organizationalPathstring, optional- A subfolder.
Returns
The copy or false.
Example
copyResource(getResourceFromName("race"), "race_kopia")
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.renameResourceRenames a stopped resource. In the current server version the function is not wired up yet and returnsfalsewith a warning.