-- Main thread
CreateThread(function()
while true do
-- Loops forever
Wait(0)
-- Get player, vehicle and vehicle class
local player = GetPlayerPed(-1)
local vehicle = GetVehiclePedIsIn(player, false)
local vehicleClass = GetVehicleClass(vehicle)
-- Disable control if player is in the driver seat and vehicle class matches
if ((GetPedInVehicleSeat(vehicle, -1) == player) and vehicleClassDisableControl[vehicleClass]) then
-- Check if vehicle is in the air and disable L/R and UP/DN controls
if IsEntityInAir(vehicle) then
DisableControlAction(2, 59)
DisableControlAction(2, 60)
end
end
end
end)