getElementByID | Multi Theft Auto: Wiki Skip to content

getElementByID

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function returns an element from the specified ID. If more than one element with the same ID exists, only the first one in the order it appears in the XML tree will be returned by this function.

Note

The ID in this context is the value of the 'id' data item of the element (the id=".." attribute in the .map file), NOT the model ID, weapon ID or similiar.

Syntax

getElementByID ( )

Code Examples

server

Assuming we have this in the .map file:

<vehicle id="vipVehicle" posX="10" posY="10" posZ="4" model="602" />

See Also

Element Functions