GetElementPosition

From Multi Theft Auto: Wiki
Revision as of 23:54, 20 July 2006 by MrJax (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

An Element is anything which has been defined or can be retrieved from Lua. The getElementPosition function allows you to retrieve the location of any element.

Syntax

float, float, float getElementPosition ( element theElement )

Required Arguments

  • theElement: The element in 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

Explain what the example does here

-- create a landstalker, and store it's reference in the variable called 'myLandstalker'
myLandstalker = createVehicle ( 400, 1591.596680, -2495.323242, 18.098244 ) 
-- Create a weapon pickup at the vehicle's position
createPickup ( getElementPosition ( myLandstalker ), 2, 31 )

See Also