GetElementID: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:


__NOTOC__  
__NOTOC__  
This fake function is for use with blah & blah and does blahblahblabhalbhl
This function gets the ID of an element.


==Syntax==  
==Syntax==  
Line 10: Line 10:


===Required Arguments===  
===Required Arguments===  
*'''argumentName:''' description
*'''element:''' the element from which to retrive the ID.
 
===Optional Arguments===
{{OptionalArg}}
*'''argumentName2:''' descriptiona
*'''argumentName3:''' description


===Returns===
===Returns===
Returns ''true'' if blah, ''false'' otherwise.
Returns a string containing the element ID, or false if the element is invalid.


==Example==  
==Example==  
This example does...
To get the id of the following element:
<syntaxhighlight lang="lua"><flag id="northflag" posX="2365" posY="215" posZ="32"></syntaxhighlight>
You could use the following code:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
-- assume flag refers to the flag element in the above XML code
blabhalbalhb --abababa
idstring = getElementID ( flag ) -- get the id of the flag element
--This line does this...
outputChatBox ( "The flag's ID is: " .. idstring ) -- output: The flag's ID is: northflag
mooo
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{FunctionArea_Functions}}
{{FunctionArea_Functions}}

Revision as of 12:31, 2 June 2006


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