getVehicleRotorSpeed | Multi Theft Auto: Wiki Skip to content

getVehicleRotorSpeed

Client-side
Server-side
Shared

Pair: setVehicleRotorSpeed

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


Retrieves the speed at which the rotor of a helicopter or plane rotates.

OOP Syntax Help! I don't understand this!

  • Method:vehicle:getVehicleRotorSpeed(...)
  • Variable: .vehicleRotorSpeed

Syntax

float getVehicleRotorSpeed ( vehicle theVehicle )
Required Arguments
  • theVehicle: the vehicle element (helicopter or plane) to get the rotor speed of.

Returns

  • float: value

Returns the rotor speed if successful. This is 0 when the helicopter or plane is stationary, and about 0.2 when it is fully spun up. It can be negative if the rotor rotates counter-clockwise. Returns false in case of failure (an invalid element or a vehicle element that is not a helicopter or plane was passed).

Code Examples

shared
function rotorSpeed()
local theVehicle = getPedOccupiedVehicle (localPlayer)
if theVehicle then
local controller = getVehicleController (theVehicle)
if controller == localPlayer then
local vehicleType = getVehicleType(theVehicle)
if vehicleType == "Helicopter" or vehicleType == "Plane" then
outputChatBox("Your vehicle rotor speed: "..math.ceil(getVehicleRotorSpeed(theVehicle)),0,255,0)
end
end
end
end
addCommandHandler("grs",rotorSpeed)

See Also

Vehicle Functions