SetVehicleGearRatio
DocsSetVehicleGearRatio(vehicle, gear, ratio)Description
Sets the vehicles gear ratio on choosen gear, reverse gear needs to be a negative float and forward moving gear needs to be a positive float. Refer to the examples if confused.
Parameters
| Name | Type | Description |
|---|---|---|
vehicle | Vehicle | The vehicle handle. |
gear | int | The vehicles gear you want to change. |
ratio | float | The gear ratio you want to use. |
Quick Snippet: Get Vehiclevehicle
vehicleUse this to get the current vehicle handle for this native.
-- Get the vehicle the player is currently in
local ped = PlayerPedId()
local vehicle = GetVehiclePedIsIn(ped, false)
if vehicle ~= 0 then
print("Vehicle handle: " .. vehicle)
print("Model: " .. GetEntityModel(vehicle))
else
print("Player is not in a vehicle")
endVehicle Models

adder
alpha
blade
ardent
asea
cogcabrio
baller
blistaReturns
voidThis native does not return a value.
Examples
Official
local function Set8SpeedVehicleGears(Vehicle)
SetVehicleGearRatio(Vehicle, 0, -3.32) -- reverse gear at -3.21:1
SetVehicleGearRatio(Vehicle, 1, 4.71) -- 1st gear at 4.71:1
SetVehicleGearRatio(Vehicle, 2, 3.14) -- 2nd gear at 3.14:1
SetVehicleGearRatio(Vehicle, 3, 2.11) -- 3rd gear at 2.11:1
SetVehicleGearRatio(Vehicle, 4, 1.67) -- 4th gear at 1.67:1
SetVehicleGearRatio(Vehicle, 5, 1.29) -- 5th gear at 1.29:1
SetVehicleGearRatio(Vehicle, 6, 1.0) -- 6th gear at 1.0:1
SetVehicleGearRatio(Vehicle, 7, 0.84) -- 7th gear at 0.84:1
SetVehicleGearRatio(Vehicle, 8, 0.67) -- 8th gear at 0.67:1
end