GetElementPosition
From Multi Theft Auto: Wiki
The getElementPosition function allows you to retrieve the position coordinates of an element. This can be any real world element, including:
Syntax
float, float, float getElementPosition ( element theElement )
OOP Syntax Help! I don't understand this!
- Method: element:getPosition(...)
- Variable: .position
- Counterpart: setElementPosition
Required Arguments
- theElement: The element which you'd like to retrieve the location of
Returns
Returns three floats indicating the position of the element, x, y and z respectively.
Example
This example attaches a samsite on the player's vehicle.
-- create the elegy; myElegy = createVehicle ( 562, 1591.596680, -2495.323242, 18.098244 ) -- get the vehicle's position; local x,y,z = getElementPosition( myElegy ) -- create the samsite; samsite = createObject ( 3267, x, y, z + 3 ) -- attach the samsite to the elegy; attachElementToElement ( samsite, myElegy, 0, 0, 0 )
See Also
- attachElements
- clearElementVisibleTo
- cloneElement
- createElement
- destroyElement
- detachElements
- getAllElementData
- getAttachedElements
- getElementAlpha
- getElementAttachedOffsets
- getElementAttachedTo
- getElementCollisionsEnabled
- getElementByID
- getElementByIndex
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementColShape
- getElementData
- getElementDimension
- getElementHealth
- getElementID
- getElementInterior
- getElementMatrix
- getElementModel
- getElementParent
- getElementPosition
- getElementRotation
- getElementSyncer
- getElementType
- getElementVelocity
- getElementZoneName
- getElementsByType
- getElementsWithinColShape
- getLowLODElement
- getRootElement
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLowLOD
- isElementVisibleTo
- isElementWithinColShape
- isElementWithinMarker
- removeElementData
- setElementAlpha
- setElementAngularVelocity
- getElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementModel
- setElementParent
- setElementPosition
- setElementRotation
- setElementSyncer
- setElementVelocity
- setElementVisibleTo
- setLowLODElement