GetElementID

From Multi Theft Auto: Wiki
Revision as of 12:31, 2 June 2006 by Erorr404 (talk | contribs)
Jump to navigation Jump to search


This function gets the ID of an element.

Syntax

string getElementID ( element element ) 

Required Arguments

  • element: the element from which to retrive the ID.

Returns

Returns a string containing the element ID, or false if the element is invalid.

Example

To get the id of the following element:

<flag id="northflag" posX="2365" posY="215" posZ="32">

You could use the following code:

-- assume flag refers to the flag element in the above XML code
idstring = getElementID ( flag ) -- get the id of the flag element
outputChatBox ( "The flag's ID is: " .. idstring ) -- output: The flag's ID is: northflag

See Also

Template:FunctionArea Functions