SetHelicopterRotorSpeed: Difference between revisions
Jump to navigation
Jump to search
(New page: __NOTOC__ {{Client function}} Sets the rotor speed of a helicopter. ==Syntax== <syntaxhighlight lang="lua"> bool setHelicopterRotorSpeed ( vehicle heli, float speed ) </syntaxhighlight> ===Required Arguments=== *''...) |
m (Deprecate) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
{{Client function}} | {{Client function}} | ||
Sets the rotor speed of a helicopter. | Sets the rotor speed of a helicopter. | ||
{{deprecated|setVehicleRotorSpeed}} | |||
{{Note|Setting higher values will cause problems to the client}} | |||
==Syntax== | ==Syntax== | ||
Line 7: | Line 10: | ||
bool setHelicopterRotorSpeed ( vehicle heli, float speed ) | bool setHelicopterRotorSpeed ( vehicle heli, float speed ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[vehicle]]:setHelicopterRotorSpeed|helicopterRotorSpeed|getHelicopterRotorSpeed}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 14: | Line 18: | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if successful, ''false'' otherwise. | Returns ''true'' if successful, ''false'' otherwise. | ||
==Example== | |||
This example change the helicopter rotor speed. | |||
<section name="Client" class="client" show="true"> | |||
<syntaxhighlight lang="lua"> | |||
function rotorSpeed() | |||
local theVehicle = getPedOccupiedVehicle (localPlayer) | |||
if theVehicle then | |||
local controller = getVehicleController (theVehicle) | |||
if controller == localPlayer then | |||
local vehecileType = getVehicleType(theVehicle) | |||
if vehecileType == "Helicopter" then | |||
setHelicopterRotorSpeed (theVehicle,10) | |||
end | |||
end | |||
end | |||
end | |||
addCommandHandler("rs",rotorSpeed) | |||
</syntaxhighlight> | |||
</section> | |||
==See Also== | ==See Also== | ||
{{Client vehicle functions}} | {{Client vehicle functions}} |
Latest revision as of 13:34, 2 September 2024
Sets the rotor speed of a helicopter.
This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. | |
Please use setVehicleRotorSpeed instead. |
Syntax
bool setHelicopterRotorSpeed ( vehicle heli, float speed )
OOP Syntax Help! I don't understand this!
- Method: vehicle:setHelicopterRotorSpeed(...)
- Variable: .helicopterRotorSpeed
- Counterpart: getHelicopterRotorSpeed
Required Arguments
- heli: the helicopter to adjust the rotor of.
- speed: the new rotor speed. Usual values are 0 if the helicopter stands still, or 0.2 if the rotor is fully spun up. Higher values than normal will not affect the helicopter's handling. Negative values are allowed and will make the rotor spin in the opposite direction (pushing the helicopter down).
Returns
Returns true if successful, false otherwise.
Example
This example change the helicopter rotor speed.
Click to collapse [-]
Clientfunction rotorSpeed() local theVehicle = getPedOccupiedVehicle (localPlayer) if theVehicle then local controller = getVehicleController (theVehicle) if controller == localPlayer then local vehecileType = getVehicleType(theVehicle) if vehecileType == "Helicopter" then setHelicopterRotorSpeed (theVehicle,10) end end end end addCommandHandler("rs",rotorSpeed)
See Also
- areVehicleLightsOn
- getHeliBladeCollisionsEnabled
- getHelicopterRotorSpeed
- getVehicleAdjustableProperty
- getVehicleComponentPosition
- getVehicleComponentRotation
- getVehicleComponents
- getVehicleComponentScale
- getVehicleComponentVisible
- getVehicleCurrentGear
- getVehicleDummyPosition
- getVehicleGravity
- getVehicleLandingGearDown
- getVehicleModelDummyDefaultPosition
- getVehicleModelDummyPosition
- getVehicleModelExhaustFumesPosition
- getVehicleModelWheelSize
- getVehicleNitroCount
- getVehicleNitroLevel
- getVehicleWheelFrictionState
- getVehicleWheelScale
- isTrainChainEngine
- isVehicleNitroActivated
- isVehicleNitroRecharging
- isVehicleOnGround
- isVehicleWheelOnGround
- isVehicleWindowOpen
- resetVehicleComponentPosition
- resetVehicleComponentRotation
- resetVehicleComponentScale
- resetVehicleDummyPositions
- setHeliBladeCollisionsEnabled
- setHelicopterRotorSpeed
- setVehicleAdjustableProperty
- setVehicleComponentPosition
- setVehicleComponentRotation
- setVehicleComponentScale
- setVehicleComponentVisible
- setVehicleDummyPosition
- setVehicleGravity
- setVehicleLandingGearDown
- setVehicleModelDummyPosition
- setVehicleModelExhaustFumesPosition
- setVehicleModelWheelSize
- setVehicleNitroActivated
- setVehicleNitroCount
- setVehicleNitroLevel
- setVehicleWheelScale
- setVehicleWheelStates
- setVehicleWindowOpen
- Shared
- 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