GetVehicleRotation: Difference between revisions

From Onset Developer Wiki
No edit summary
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Info|Function|Server & Client|1.0}}
{{Info|Function|Server & Client|1.0}}


{{FuncDescription|Returns the vehicle rotation (yaw, pitch and roll) of the specified vehicle.}}
{{FuncDescription|Returns the vehicle rotation (pitch, yaw and roll) of the specified vehicle.}}


{{FuncSyntax|GetVehicleRotation(vehicle)}}
{{FuncSyntax|GetVehicleRotation(vehicle)}}
Line 8: Line 8:
{{FuncParam|vehicle|The vehicle identifier}}
{{FuncParam|vehicle|The vehicle identifier}}


{{FuncReturnValue|The rotation yaw, pitch and roll of the vehicle.}}
{{FuncReturnValue|The rotation pitch, yaw and roll of the vehicle.}}


== Example ==
== Example ==
<syntaxhighlting=Lua>
<syntaxhighlight lang="Lua">
local rx, ry, rz = GetVehicleRotation(vehicle)
local rx, ry, rz = GetVehicleRotation(vehicle)
-- Reset pitch and roll, leave yaw alone
-- Reset pitch and roll, leave yaw alone
SetVehicleRotation(vehicle, 0.0, ry, 0.0)
SetVehicleRotation(vehicle, 0.0, ry, 0.0)
</syntaxhighlighting>
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
{{VehicleFunctions}}
{{VehicleFunctions}}

Latest revision as of 22:44, 26 January 2021