GetVehicleTurnVelocity: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Deprecated again with better template) |
||
(14 intermediate revisions by 9 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | {{Server client function}} | ||
{{Deprecated|getElementAngularVelocity|}} | |||
This | |||
__NOTOC__ | |||
This function is used to retrieve a vehicle's turning velocity for each axis. | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
float float float getVehicleTurnVelocity ( vehicle theVehicle ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[vehicle]]:getTurnVelocity|turnVelocity|setVehicleTurnVelocity}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theVehicle:''' The [[vehicle]] you wish to get the turning velocities of. | |||
*''' | |||
===Returns=== | |||
=== | Returns 3 ''floats'' that represent the vehicle's turning velocity on the x, y and z axis or ''false'' if wrong arguments were passed. | ||
=== | ===Example=== | ||
< | <section name="Server" class="server" show="true"> | ||
This example shows the current turn velocity of the vehicle that you're in. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function velocity(player) | |||
if not isPedInVehicle(player) then return end | |||
local veh = getPedOccupiedVehicle(player) | |||
local vx, vy, vz = getVehicleTurnVelocity(veh) | |||
outputChatBox("Vehicle's turn velocity is: X: "..vx.." Y: "..vy.." Z: "..vz, player, 0, 255, 0, false) | |||
end | |||
addCommandHandler("geturnvelocity",velocity,false,false) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
==See Also== | ==See Also== | ||
{{ | {{Vehicle functions}} | ||
Latest revision as of 22:56, 29 April 2024
This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. | |
Please use getElementAngularVelocity instead. |
This function is used to retrieve a vehicle's turning velocity for each axis.
Syntax
float float float getVehicleTurnVelocity ( vehicle theVehicle )
OOP Syntax Help! I don't understand this!
- Method: vehicle:getTurnVelocity(...)
- Variable: .turnVelocity
- Counterpart: setVehicleTurnVelocity
Required Arguments
- theVehicle: The vehicle you wish to get the turning velocities of.
Returns
Returns 3 floats that represent the vehicle's turning velocity on the x, y and z axis or false if wrong arguments were passed.
Example
Click to collapse [-]
ServerThis example shows the current turn velocity of the vehicle that you're in.
function velocity(player) if not isPedInVehicle(player) then return end local veh = getPedOccupiedVehicle(player) local vx, vy, vz = getVehicleTurnVelocity(veh) outputChatBox("Vehicle's turn velocity is: X: "..vx.." Y: "..vy.." Z: "..vz, player, 0, 255, 0, false) end addCommandHandler("geturnvelocity",velocity,false,false)
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