GetVehicleRotation: Difference between revisions

From Onset Developer Wiki
No edit summary
No edit summary
Line 1: Line 1:
{{Info|Function|Server & Client|1.0}}
{{Info|Function|Server & Client|1.0}}


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


{{FuncSyntax|GetVehicleRotation(vehicle)}}
{{FuncSyntax|GetVehicleRotation(vehicle)}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|vehicle|__EDIT_ME__}}
{{FuncParam|vehicle|The vehicle identifier}}


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


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


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

Revision as of 07:14, 16 November 2019

GetVehicleRotation

Type: Function
Context: Server & Client
Introduced: v1.0

Description

Returns the vehicle rotation (yaw, pitch and roll) of the specified vehicle.

Syntax

GetVehicleRotation(vehicle)

Parameters

  • vehicle
    The vehicle identifier

Return Value

  • The rotation yaw, pitch and roll of the vehicle.

Example

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

See also