GetVehicleTurnVelocity: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(9 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Server client function}}
{{Server client function}}
{{Deprecated|getElementAngularVelocity|This function will be deprecated in '''1.5.6'''}}
__NOTOC__
__NOTOC__
This function is used to retrieve a vehicle's turning velocity for each axis.
This function is used to retrieve a vehicle's turning velocity for each axis.
Line 7: Line 9:
float float float getVehicleTurnVelocity ( vehicle theVehicle )
float float float getVehicleTurnVelocity ( vehicle theVehicle )
</syntaxhighlight>  
</syntaxhighlight>  
 
{{OOP||[[vehicle]]:getTurnVelocity|turnVelocity|setVehicleTurnVelocity}}
===Required Arguments===  
===Required Arguments===  
*'''theVehicle:''' The [[vehicle]] you wish to get the turning velocities of.
*'''theVehicle:''' The [[vehicle]] you wish to get the turning velocities of.


===Returns===
===Returns===
Returns 3 ''floats'' that represent the vehicle's turning velocity on the x, y and z axis.
Returns 3 ''floats'' that represent the vehicle's turning velocity on the x, y and z axis or ''false'' if wrong arguments were passed.


==Example==  
===Example===
<section name="Server" class="server" show="true">
This example shows the current turn velocity of the vehicle that you're in.


This page does not currently have an example
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--enter an example here
function velocity(player)
    if not isPedInVehicle(player) then return end
    local veh = getPedOccupiedVehicle(player)
    local vx, vy, vz = getVehicleTurnVelocity(veh)
    outputChatBox("Vehicle's turn velocity is: X: "..vx.." Y: "..vy.." Z: "..vz, player, 0, 255, 0, false)
end
addCommandHandler("geturnvelocity",velocity,false,false)
</syntaxhighlight>
</syntaxhighlight>
</section>


==See Also==
==See Also==


{{Vehicle Functions}}
{{Vehicle functions}}
[[Category:Needs_Example]]

Latest revision as of 07:37, 15 April 2023

Emblem-important.png This function is deprecated. This means that its use is discouraged and that it might not exist in future versions.

Please use getElementAngularVelocity instead. This function will be deprecated in 1.5.6


This function is used to retrieve a vehicle's turning velocity for each axis.

Syntax

float float float getVehicleTurnVelocity ( vehicle theVehicle )

OOP Syntax Help! I don't understand this!

Method: vehicle:getTurnVelocity(...)
Variable: .turnVelocity
Counterpart: setVehicleTurnVelocity


Required Arguments

  • theVehicle: The vehicle you wish to get the turning velocities of.

Returns

Returns 3 floats that represent the vehicle's turning velocity on the x, y and z axis or false if wrong arguments were passed.

Example

Click to collapse [-]
Server

This example shows the current turn velocity of the vehicle that you're in.

function velocity(player)
    if not isPedInVehicle(player) then return end
    local veh = getPedOccupiedVehicle(player)
    local vx, vy, vz = getVehicleTurnVelocity(veh)
    outputChatBox("Vehicle's turn velocity is: X: "..vx.." Y: "..vy.." Z: "..vz, player, 0, 255, 0, false)
end
addCommandHandler("geturnvelocity",velocity,false,false)

See Also