Difference between revisions of "GetVehicleRotation"

From Multi Theft Auto: Wiki
Line 5: Line 5:
  
 
==Syntax==
 
==Syntax==
<syntaxhighlight lang="lua">float float float getVehicleRotation ( vehicle )</syntaxhighlight>
+
<syntaxhighlight lang="lua">float float float getVehicleRotation ( vehicle theVehicle )</syntaxhighlight>
  
 
===Required Arguments===
 
===Required Arguments===
*'''vehicle''': The [[vehicle]] whose rotation you want to retrieve.
+
*'''theVehicle''': The [[vehicle]] whose rotation you want to retrieve.
  
 
===Returns===
 
===Returns===

Revision as of 17:00, 17 August 2007

Description

This function gets the rotation of a vehicle along the X, Y, and Z axes in degrees.

Syntax

float float float getVehicleRotation ( vehicle theVehicle )

Required Arguments

  • theVehicle: The vehicle whose rotation you want to retrieve.

Returns

Returns three floats indicating the X, Y, and Z rotations of the vehicle in degrees, or false if the specified vehicle does not exist.

Example

This example creates a vehicle and gets its rotation:

local newHydra = createVehicle ( 520, 1024, 1024, 1024 ) -- create a Hydra
local rx, ry, rz = getVehicleRotation ( newHydra ) -- get the vehicle's x, y and z rotations and store them in rx, ry, and rz
outputChatBox ( "Current rotation: " .. rx .. " " .. ry .. " " .. rz ) -- output the rotations

See Also