Very simple script that disables steering/leaning of your vehicle when you are in the air.
Requested here: [REQUEST] Vehicle air controls
VehicleAirControl.zip (939 Bytes)
Code, in case you want to add this to your own scripts:
Citizen.CreateThread(function() while true do Citizen.Wait(0) local veh = GetVehiclePedIsIn(PlayerPedId(), false) if DoesEntityExist(veh) and not IsEntityDead(veh) then local model = GetEntityModel(veh) -- If it's not a boat, plane or helicopter, and the vehilce is off the ground with ALL wheels, then block steering/leaning left/right/up/down. if not IsThisModelABoat(model) and not IsThisModelAHeli(model) and not IsThisModelAPlane(model) and IsEntityInAir(veh) then DisableControlAction(0, 59) -- leaning left/right DisableControlAction(0, 60) -- leaning up/down end end end end)
You can do whatever you want with this. I don’t care if you release this with another script. As it’s literally just 14 lines of code.
Note there are some possible bugs which I haven’t tested and I don’t feel like fixing for this simple script, feel free to do it yourself and post the updated version in the replies below. Some of the things that may cause issues (untested):
- Using opressors?
- Using the ruiner 2000?
- Using other amphibious vehicles?