GetVehicleRotation: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Info|Function|Server & Client|1.0}} | {{Info|Function|Server & Client|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Returns the vehicle rotation (pitch, yaw and roll) of the specified vehicle.}} | ||
{{FuncSyntax|GetVehicleRotation(vehicle)}} | {{FuncSyntax|GetVehicleRotation(vehicle)}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|vehicle| | {{FuncParam|vehicle|The vehicle identifier}} | ||
{{FuncReturnValue| | {{FuncReturnValue|The rotation pitch, yaw and roll of the vehicle.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
local rx, ry, rz = GetVehicleRotation(vehicle) | |||
-- Reset pitch and roll, leave yaw alone | |||
SetVehicleRotation(vehicle, 0.0, ry, 0.0) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{VehicleFunctions}} |
Latest revision as of 22:44, 26 January 2021
Description
Returns the vehicle rotation (pitch, yaw and roll) of the specified vehicle.
Syntax
GetVehicleRotation(vehicle)
Parameters
- vehicle
The vehicle identifier
Return Value
- The rotation pitch, yaw and roll of the vehicle.
Example
local rx, ry, rz = GetVehicleRotation(vehicle)
-- Reset pitch and roll, leave yaw alone
SetVehicleRotation(vehicle, 0.0, ry, 0.0)
See also
- CreateVehicle
- DestroyVehicle
- IsValidVehicle
- GetVehicleCount
- GetAllVehicles
- GetVehicleModel
- GetVehicleModelName
- SetVehicleRespawnParams
- IsVehicleStreamedIn
- GetStreamedVehiclesForPlayer
- GetStreamedVehicles
- SetVehicleLocation
- GetVehicleLocation
- SetVehicleRotation
- GetVehicleRotation
- SetVehicleHeading
- GetVehicleHeading
- SetVehicleHealth
- GetVehicleHealth
- SetVehicleLicensePlate
- GetVehicleVelocity
- GetVehicleDriver
- GetVehiclePassenger
- GetVehicleNumberOfSeats
- SetVehicleColor
- GetVehicleColor
- SetVehicleLinearVelocity
- SetVehicleAngularVelocity
- GetVehicleGear
- SetVehicleHoodRatio
- GetVehicleHoodRatio
- SetVehicleTrunkRatio
- GetVehicleTrunkRatio
- StartVehicleEngine
- StopVehicleEngine
- GetVehicleEngineState
- SetVehicleLightEnabled
- GetVehicleLightState
- SetVehicleDamage
- GetVehicleDamage
- AttachVehicleNitro