getElementPosition
Client-side
 Server-side
 Shared
 Pair: setElementPosition
This function allows you to retrieve the position coordinates of an element. This can be any real world element, including:
OOP Syntax Help! I don't understand this!
- Method: element:getPosition(...)
- Variable: .position
Syntax
float, float, float getElementPosition ( element theElement )Required Arguments
- theElement: The element which you'd like to retrieve the position of.
Returns
- float: x
- float: y
- float: z
Returns three floats indicating the position of the element, x, y and z respectively.
Code Examples
 client   
 This example will print the player position to chat using /pos command.
function whatsMyPosition()    -- get the position of local player    local fX, fY, fZ = getElementPosition(localPlayer);
    -- output it to chat    outputChatBox("My current position is X: "..fX.." Y: "..fY.." Z: "..fZ);endaddCommandHandler("pos", whatsMyPosition);Issues
| ID | Description | 
|---|---|
| 928 | Position desync with dead players | 
See Also
Element Functions
- attachElements
- createElement
- destroyElement
- detachElements
- getAllElementData
- getAttachedElements
- getElementAlpha
- getElementAngularVelocity
- getElementAttachedOffsets
- getElementAttachedTo
- getElementByID
- getElementByIndex
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementCollisionsEnabled
- getElementDimension
- getElementData
- getElementHealth
- getElementID
- getElementInterior
- getElementMatrix
- getElementModel
- getElementPosition
- getElementRotation
- getElementParent
- getElementType
- getElementVelocity
- getElementsByType
- getElementsWithinRange
- getResourceRootElement
- getRootElement
- hasElementData
- getResourceDynamicElementRoot
- getLowLODElement
- getPedContactElement
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLowLOD
- isElementOnFire
- isElementWithinMarker
- setElementAlpha
- setElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementInterior
- setElementModel
- setElementOnFire
- setElementID
- setElementParent
- setElementPosition
- setElementRotation
- setElementVelocity
- setLowLODElement
- getElementBoneMatrix
- getElementBonePosition
- getElementBoneQuaternion
- getElementBoneRotation
- getElementBoundingBox
- getElementDistanceFromCentreOfMassToBaseOfModel
- getElementLighting
- getElementRadius
- isElementCollidableWith
- isElementLocal
- isElementOnScreen
- isElementStreamable
- isElementStreamedIn
- isElementSyncer
- isElementWaitingForGroundToLoad
- setElementBoneMatrix
- setElementBonePosition
- setElementBoneQuaternion
- setElementBoneRotation
- setElementCollidableWith
- setElementLighting
- setElementStreamable
- updateElementRpHAnim
- addElementDataSubscriber
- clearElementVisibleTo
- cloneElement
- getElementSyncer
- getElementZoneName
- hasElementDataSubscriber
- isElementVisibleTo
- removeElementData
- removeElementDataSubscriber
- setElementSyncer
- setElementVisibleTo
Element Events
- onClientElementColShapeHit
- onClientElementColShapeLeave
- onClientElementDataChange
- onClientElementDestroy
- onClientElementDimensionChange
- onClientElementModelChange
- onClientElementInteriorChange
- onClientElementStreamIn
- onClientElementStreamOut
- onElementClicked
- onElementColShapeHit
- onElementColShapeLeave
- onElementDestroy
- onElementDataChange
- onElementModelChange
- onElementStopSync
- onElementDimensionChange
- onElementStartSync
- onElementInteriorChange
 
 