CreateElement: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(Fixed argument order) |
||
Line 4: | Line 4: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
element createElement ( string | element createElement ( string name, string type ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''name:''' The ID of the element being created. | |||
*'''type:''' The type of element being created. This value will be returned if getElementType is used on it. | *'''type:''' The type of element being created. This value will be returned if getElementType is used on it. | ||
===Returns=== | ===Returns=== | ||
Line 18: | Line 18: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
alphahandle = createElement(" | alphahandle = createElement( "Alpha", "squad" ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{element functions}} | {{element functions}} |
Revision as of 06:39, 11 December 2006
This function is used to create dummy elements in the element table, but do not have a counterpart within the San Andreas world. A common use for this function is for creating group or team elements.
Syntax
element createElement ( string name, string type )
Required Arguments
- name: The ID of the element being created.
- type: The type of element being created. This value will be returned if getElementType is used on it.
Returns
Returns true if the element was successfully created. Returns false if the arguments are wrong or if the type is not allowed. Unallowed types include hard-coded MTA elements (such as "vehicle") and the type "dummy".
Example
This example creates a squad element called 'Alpha', which will appear just off root on the element table:
alphahandle = createElement( "Alpha", "squad" )
See Also
- attachElements
- createElement
- destroyElement
- detachElements
- getAttachedElements
- getElementAlpha
- getElementAttachedOffsets
- getElementAttachedTo
- getElementByIndex
- getElementByID
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementCollisionsEnabled
- getElementColShape
- getElementData
- getAllElementData
- hasElementData
- getElementDimension
- getElementHealth
- getElementID
- getElementInterior
- getElementMatrix
- getElementModel
- getElementParent
- getElementPosition
- getElementRotation
- getElementsByType
- getElementsWithinColShape
- getElementsWithinRange
- getElementType
- getElementVelocity
- getLowLODElement
- getRootElement
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLowLOD
- isElementWithinColShape
- isElementWithinMarker
- setElementAlpha
- setElementAngularVelocity
- getElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementModel
- setElementParent
- setElementPosition
- setElementRotation
- setElementVelocity
- setLowLODElement
- getPedContactElement
- getResourceDynamicElementRoot
- getResourceRootElement