GetElementVelocity
Jump to navigation
Jump to search
Description
This function returns three floats containing the velocity (movement speeds) along the X, Y, and Z axis respectively.
Syntax
float float float getElementVelocity ( element theElement )
Required Arguments
- theElement: The element you wish to retrieve the velocity of.
Returns
This function can fail if the element is a player in a car. Use the vehicle element in this case. It will also fail if the element specified does not have a velocity, or does not exist. If this function does fail, the first return value will be set to false. Other than that though, this function will return three floats that represent the element's current velocity along the x, y, and z axis respectively.
Example
speedx, speedy, speedz = getElementVelocity ( findPlayer ( "someguy" ) ) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) --Raising something to the exponent of 0.5 is the same thing as taking a square root. outputChatBox ( "Someguy's current Velocity: ", actualspeed, " arbitrary units." )
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