GetElementAngularVelocity: Difference between revisions
Jump to navigation
Jump to search
DezZolation (talk | contribs) No edit summary |
Fernando187 (talk | contribs) (Remove obsolete Requirements section) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
float | float, float, float getElementAngularVelocity ( element theElement ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[element]]:getAngularVelocity|angularVelocity|setElementAngularVelocity}} | {{OOP||[[element]]:getAngularVelocity|angularVelocity|setElementAngularVelocity}} | ||
Line 16: | Line 16: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addCommandHandler("getangularvelocity", function( | addCommandHandler("getangularvelocity", | ||
function(sourcePlayer, commandName) | |||
local aX, aY, aZ = getElementAngularVelocity(sourcePlayer) | |||
end) | outputChatBox("Your current angular velocity is: X: " .. aX .." Y: " .. aY .." Z: " .. aZz, sourcePlayer) | ||
end | |||
) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Element functions}} | {{Element functions}} |
Latest revision as of 17:14, 7 November 2024
Gets the current angular velocity of a specified, supported element.
Syntax
float, float, float getElementAngularVelocity ( element theElement )
OOP Syntax Help! I don't understand this!
- Method: element:getAngularVelocity(...)
- Variable: .angularVelocity
- Counterpart: setElementAngularVelocity
Required Arguments
- theElement: The element to retrieve the angular velocity from. Can be either a player, ped, object, vehicle or a custom weapon. Server side supports only vehicles currently.
Returns
Returns three floats describing the x, y and z rotation
Example
addCommandHandler("getangularvelocity", function(sourcePlayer, commandName) local aX, aY, aZ = getElementAngularVelocity(sourcePlayer) outputChatBox("Your current angular velocity is: X: " .. aX .." Y: " .. aY .." Z: " .. aZz, sourcePlayer) end )
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