createElement | Multi Theft Auto: Wiki Skip to content

createElement

Client-side
Server-side
Shared

Manual Review Required

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


This function is used to create a new dummy element in the element tree which do not necessarily represent an entity within the San Andreas world. A common use for this function is for creating custom elements, such as a Flag or a Base.

OOP Syntax Help! I don't understand this!

Syntax

element createElement ( string elementType, [ string elementID = nil ] )
Required Arguments
  • elementType: The type of element being created.
Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.

  • elementID (default: nil): The ID of the element being created.

Returns

  • element: value

Returns the element if it was successfully created. Returns false if the arguments are wrong.

Code Examples

shared

This example creates a "flag" element, named "blue", which will be at the resource's dynamic map.

blueTeamFlag = createElement( "flag", "blue" )

See Also

Element Functions