GetVehicleRotation: Difference between revisions
Jump to navigation
Jump to search
(Removed X Y Z variants of the function, fixed the syntax) |
m (→Example) |
||
Line 15: | Line 15: | ||
This example creates a vehicle and gets it's rotation: | This example creates a vehicle and gets it's rotation: | ||
<syntaxhighlight lang="lua">local newcar = createVehicle ( 520, 1024, 1024, 1024 ) -- create a Hydra | <syntaxhighlight lang="lua">local newcar = createVehicle ( 520, 1024, 1024, 1024 ) -- create a Hydra | ||
local rx, ry, rz = getVehicleRotation ( newcar ) -- get the vehicle's x, y | local rx, ry, rz = getVehicleRotation ( newcar ) -- get the vehicle's x, y and z rotations and store them in rx, ry, and rz | ||
outputChatBox ( "Current rotation: " .. | outputChatBox ( "Current rotation: " .. rx .. " " .. ry .. " " .. rz ) -- output the rotations | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Vehicle functions}} | {{Vehicle functions}} |
Revision as of 13:28, 1 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 )
Required Arguments
- vehicle: The vehicle whose rotation you want to retrieve.
Returns
Returns three floats indicating the X, Y, and Z rotations of the vehicle in degrees (one float for a variant function), or false if the specified vehicle does not exist.
Example
This example creates a vehicle and gets it's rotation:
local newcar = createVehicle ( 520, 1024, 1024, 1024 ) -- create a Hydra local rx, ry, rz = getVehicleRotation ( newcar ) -- 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
- addVehicleUpgrade
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getTrainTrack
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleUpgrade
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
- setTrainTrack
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition
- setVehicleVariant
- setVehicleWheelStates