GetElementAngularVelocity: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
m (Consistency with other wiki pages)
Line 5: Line 5:
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
float rx, float ry, float rz getElementAngularVelocity ( element theElement )           
float, float, float getElementAngularVelocity ( element theElement )           
</syntaxhighlight>  
</syntaxhighlight>  
{{OOP||[[element]]:getAngularVelocity|angularVelocity|setElementAngularVelocity}}
{{OOP||[[element]]:getAngularVelocity|angularVelocity|setElementAngularVelocity}}

Revision as of 07:16, 3 April 2019

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

Returns

Returns three floats describing the x, y and z rotation

Example

addCommandHandler("getangularvelocity", function(player)
    --retrieve angular velocity of the player
    local avx, avy, avz = getElementAngularVelocity(player)
    outputChatBox("Your current angular velocity is: X: "..avx.." Y: "..avy.." Z: "..avz, player, 0, 255, 0, false)
end)

Requirements

This template will be deleted.

See Also