Element: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
m (info about dummy elements)
 
(39 intermediate revisions by 32 users not shown)
Line 1: Line 1:
An element is a generic class that can represent almost all in-game items.
An '''element''' is a generic class that can represent almost all in-game [[entity|entities]]. The built-in element types are:
The element types representing in-game entities are:


* [[Element/Player|Players]]
{{Elements}}
* [[Element/Vehicle|Vehicles]]
* [[Element/Object|Objects]]
* [[Element/Pickup|Pickups]]
* [[Element/Marker|Markers]]
* [[Element/Collision shape|Collision shapes]]
* [[Element/Blip|Blips]]
* [[Element/Radar area|Radar areas]]
* [[Element/Team|Teams]]
* [[Element/Spawnpoint|Spawnpoints]]
* [[Element/Console|Server console]]
* [[Element/Admin|Remote admins]]


Any other element type can be created as an abstract element, not referring to in-game entities. For example, ''resource'' and ''map'' elements are created to group entities they create as their children.
Any other element type can be created as an abstract element, not referring to any game [[entity]]. For example, '''resource''' and '''map''' elements are created when resources and maps are loaded to group entities they create as their children.


Elements share common functions such as type and list retrieval, a destroy operation to remove both the element and the game entity it is linked to (except for client elements, which can't be destroyed), and many more common operations.
Elements created with [[createElement]] are called dummy elements.


All elements are stored internally in a [[Element tree|tree structure]], and as such every element has a parent element, be it the ''root'' element, a ''map'' or another element. This is purely for declaring the scope of function calls.
Elements share common functions such as type and list retrieval, a destroy operation to remove both the element and the game entity it is linked to (except for some elements which can't be destroyed, for example client elements), [[element data]] storing and retrieval, and many more common operations.
 
All elements are stored internally in a [[Element tree|tree structure]], and as such every element except the '''root''' element has a parent element, that can be the '''root''' element, a '''resource''', '''map''' or another element. This is purely for declaring the scope of function calls.


==Related scripting functions==
==Related scripting functions==
Line 26: Line 16:
===Server===
===Server===
{{Element functions}}
{{Element functions}}
[[Category:Scripting Concepts]]
[[en:Element]]
[[ru:Element]]
[[es:Elemento]]
[[it:Elemento]]
[[hu:Element]]
[[pl:Element]]
[[pt-br:Elemento]]

Latest revision as of 09:49, 14 October 2024

An element is a generic class that can represent almost all in-game entities. The built-in element types are:

ADDED/UPDATED IN VERSION 1.6.0 r22410:

Any other element type can be created as an abstract element, not referring to any game entity. For example, resource and map elements are created when resources and maps are loaded to group entities they create as their children. Elements created with createElement are called dummy elements. Elements share common functions such as type and list retrieval, a destroy operation to remove both the element and the game entity it is linked to (except for some elements which can't be destroyed, for example client elements), element data storing and retrieval, and many more common operations. All elements are stored internally in a tree structure, and as such every element except the root element has a parent element, that can be the root element, a resource, map or another element. This is purely for declaring the scope of function calls.

Related scripting functions

Client



Server