mtasa-blue
mtasa-blue copied to clipboard
Fix #552 Impossible to stop helicopter rotor if it has a driver
Fixed #552
This PR add two new functions
bool setVehicleRotorState(vehicle, bool state [, bool stopRotor = true ])
bool getVehicleRotorState(vehicle)
This function works in a similar way to setVehicleEngineState
.
By specifying state to false, the rotor will not be processed, i.e. it will not change its speed and the helicopter/plane cannot be controlled.
The stopRotor
parameter specifies whether the rotor is to be stopped (SetHeliRotorSpeed to 0). If we specify false, the rotor will not change its speed, but will not be stopped, it will rotate at the same speed all the time.
Of course, instead of adding new functions, we could use setVehicleEngineState
, but for backward compatibility reasons it is better not to do this and simply add these two new functions to avoid possible problems with older scripts.
This function also allows to achieve the effect that the rotor rotates even without a driver.