SetVehicleTurnVelocity: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(Deprecated method in favor of setElementAngularVelocity) |
||
(8 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
{{ | __NOTOC__ | ||
{{Server client function}} | |||
{{Deprecated|setElementAngularVelocity|}} | |||
Sets the angular velocity of a vehicle. Basically applies a spin to it. | |||
[[ | {{Deprecated feature|3.0156|1.5.6|This function will be deprecated in '''1.5.6''', use [[setElementAngularVelocity]] in the future.}} | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool setVehicleTurnVelocity ( | bool setVehicleTurnVelocity ( vehicle theVehicle, float rx, float ry, float rz ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[vehicle]]:setTurnVelocity|turnVelocity|getVehicleTurnVelocity}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''theVehicle:''' The [[vehicle]] to apply the spin to. | ||
*'''rx:''' velocity around the X axis | |||
*'''ry:''' velocity around the Y axis | |||
*'''rz:''' velocity around the Z axis | |||
*''' | |||
*''' | |||
===Returns=== | ===Returns=== | ||
Returns ''true'' if | Returns ''true'' if it was succesful, ''false'' otherwise. | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | function onColShapeHit ( thePlayer, matchingDimension ) | ||
-- When a player hits the collision shape, check if he's in a vehicle | |||
local playerVehicle = getPedOccupiedVehicle ( thePlayer ) | |||
if playerVehicle ~= false then | |||
-- If so, give it a spin | |||
setVehicleTurnVelocity ( playerVehicle, 0, 0, 20 ) | |||
end | |||
end | |||
addEventHandler ( "onColShapeHit", getRootElement ( ), onColShapeHit ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{ | {{Vehicle functions}} |
Latest revision as of 15:58, 8 November 2018
This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. | |
Please use setElementAngularVelocity instead. |
Sets the angular velocity of a vehicle. Basically applies a spin to it.
Syntax
bool setVehicleTurnVelocity ( vehicle theVehicle, float rx, float ry, float rz )
OOP Syntax Help! I don't understand this!
- Method: vehicle:setTurnVelocity(...)
- Variable: .turnVelocity
- Counterpart: getVehicleTurnVelocity
Required Arguments
- theVehicle: The vehicle to apply the spin to.
- rx: velocity around the X axis
- ry: velocity around the Y axis
- rz: velocity around the Z axis
Returns
Returns true if it was succesful, false otherwise.
Example
function onColShapeHit ( thePlayer, matchingDimension ) -- When a player hits the collision shape, check if he's in a vehicle local playerVehicle = getPedOccupiedVehicle ( thePlayer ) if playerVehicle ~= false then -- If so, give it a spin setVehicleTurnVelocity ( playerVehicle, 0, 0, 20 ) end end addEventHandler ( "onColShapeHit", getRootElement ( ), onColShapeHit )
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