GetElementsByType: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
[[category:incomplete]] | [[category:incomplete]] | ||
__NOTOC__ | __NOTOC__ | ||
This | This function is used to retreive a list of all elemets of the specified type. This can be useful, as it disregards ''where'' in the element table it is in the element heirarchy. | ||
==Syntax== | ==Syntax== | ||
Line 9: | Line 9: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''type:''' The type of element you want a list of. This can be any one of the following ten things MTA is programmed to understand: | ||
**'''"player":''' A player connected to the server | |||
**'''"vehicle":''': A vehicle | |||
**'''"object":''' An object | |||
*''' | **'''"pickup":''' A pickup | ||
*''' | **'''"blip":''' A blip | ||
**'''"marker":''' A marker | |||
**'''"spawnpoint":''' A spawnpoint | |||
**'''"remoteclient":''' A remote client connected to the server | |||
**'''"console":''' The server Console | |||
**'''"unknown":''' Unknown element type | |||
===Returns=== | ===Returns=== | ||
Returns '' | Returns a ''table'' containing all the elements of the specified type. Returns an empty ''table'' if there are no elements of the specified type. Returns ''false'' if the string specified is invalid (or not a string). | ||
==Example== | ==Example== | ||
TODO: add an example here. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Add example here... | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{ | {{Element_functions}} |
Revision as of 15:30, 22 August 2006
This function is used to retreive a list of all elemets of the specified type. This can be useful, as it disregards where in the element table it is in the element heirarchy.
Syntax
table getElementsByType ( string type )
Required Arguments
- type: The type of element you want a list of. This can be any one of the following ten things MTA is programmed to understand:
- "player": A player connected to the server
- "vehicle":: A vehicle
- "object": An object
- "pickup": A pickup
- "blip": A blip
- "marker": A marker
- "spawnpoint": A spawnpoint
- "remoteclient": A remote client connected to the server
- "console": The server Console
- "unknown": Unknown element type
Returns
Returns a table containing all the elements of the specified type. Returns an empty table if there are no elements of the specified type. Returns false if the string specified is invalid (or not a string).
Example
TODO: add an example here.
Add example here...
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