GetVehicleTurnVelocity: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
Line 14: Line 14:
Returns 3 ''floats'' that represent the vehicle's turning velocity on the x, y and z axis or ''false'' if wrong arguments were passed.
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
addCommandHandler("geturnvelocity", function(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)
</syntaxhighlight>
</syntaxhighlight>
</section>


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

Revision as of 16:18, 24 May 2012

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

Syntax

float float float getVehicleTurnVelocity ( vehicle theVehicle )

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.

addCommandHandler("geturnvelocity", function(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)

See Also