AddResourceMap: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 5: Line 5:
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
xmlnode addResourceMap ( resource theResource, string filename, [ int dimension = 0 ] )
xmlnode addResourceMap ( string filePath, [ int dimension = 0 ] )
</syntaxhighlight>  
</syntaxhighlight>  


===Required Arguments===  
===Required Arguments===
*'''theResource:''' the [[resource]] to which the map file will be added.
*'''filePath:''' the path of the resource map file in the following format: '''":resourceName/path"'''. 'resourceName' is the name of the resource the map file will be in, and 'path' is the path from the root directory of the resource to the file.
*'''filename:''' the name of the map file to be added.
:For example, if you want to create a map file named 'manycars.map' in the resource 'cdm', it can be created from another resource this way: ''addResourceMap(":cdm/manycars.map")''.
:If you want to create the map file in the current resource, only the file path is necessary, e.g. ''addResourceMap("manycars.map")''.


===Optional Arguments===  
===Optional Arguments===  

Revision as of 03:51, 30 July 2009

This function adds a new empty mapfile to an existing resource.

Syntax

xmlnode addResourceMap ( string filePath, [ int dimension = 0 ] )

Required Arguments

  • filePath: the path of the resource map file in the following format: ":resourceName/path". 'resourceName' is the name of the resource the map file will be in, and 'path' is the path from the root directory of the resource to the file.
For example, if you want to create a map file named 'manycars.map' in the resource 'cdm', it can be created from another resource this way: addResourceMap(":cdm/manycars.map").
If you want to create the map file in the current resource, only the file path is necessary, e.g. addResourceMap("manycars.map").

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • dimension: the dimension in which the map's objects will be placed.

Returns

Returns the new map's root xmlnode if the map was added successfully, false otherwise.

Example

See Also