GetElementData

From Multi Theft Auto: Wiki
Revision as of 10:54, 14 August 2006 by Aeron (talk | contribs)
Jump to navigation Jump to search

Elements can contain data values. These are accessable via names, and their value can be retrieved using getElementData and set using setElementData. These values are also loaded from the attributes in the XML map files, and as such can provide a powerful way to store and retrieve data in XML for each element.

Syntax

var getElementData ( element theElement, string name )

Example

This example will return the version of the map, generally this will be 2.0 in the final release.

map = getRootElement ( )
mapVersion = getElementData ( map, "version" )

See Also