GetVehicleRotation: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 11: | Line 11: | ||
== Example == | == Example == | ||
< | <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) | ||
</ | </syntaxhighlight> | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{VehicleFunctions}} | {{VehicleFunctions}} |
Revision as of 07:15, 16 November 2019
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
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