Skip to content

Commit

Permalink
Merge pull request #15 from devrodrigomolina/main
Browse files Browse the repository at this point in the history
fix: Erro de ortografia
  • Loading branch information
ggfto authored Jan 29, 2025
2 parents e345a9a + 51a659a commit ffe5e97
Showing 1 changed file with 50 additions and 49 deletions.
99 changes: 50 additions & 49 deletions modules/mri/client-side/vehicles-modules/disableaircontrol.lua
Original file line number Diff line number Diff line change
@@ -1,59 +1,60 @@
-- Otimização em cima do RealisticAirControl by .mur4i
-- contriubição: .reiffps

Citizen.CreateThread(function()
local playerPed = -1
local vehicle = nil
local vehicleClass = nil
local vehicleClassDisableControl = {
[0] = true, --compacts
[1] = true, --sedans
[2] = true, --SUV's
[3] = true, --coupes
[4] = true, --muscle
[5] = true, --sport classic
[6] = true, --sport
[7] = true, --super
[8] = false, --motorcycle
[9] = true, --offroad
[10] = true, --industrial
[11] = true, --utility
[12] = true, --vans
[13] = false, --bicycles
[14] = false, --boats
[15] = false, --helicopter
[16] = false, --plane
[17] = true, --service
[18] = true, --emergency
[19] = false --military
[0] = true, -- compacts
[1] = true, -- sedans
[2] = true, -- SUV's
[3] = true, -- coupes
[4] = true, -- muscle
[5] = true, -- sport classic
[6] = true, -- sport
[7] = true, -- super
[8] = false, -- motorcycle
[9] = true, -- offroad
[10] = true, -- industrial
[11] = true, -- utility
[12] = true, -- vans
[13] = false, -- bicycles
[14] = false, -- boats
[15] = false, -- helicopter
[16] = false, -- plane
[17] = true, -- service
[18] = true, -- emergency
[19] = false -- military
}
local disableIfFlying = true -- Enable/disable control disable while flying

while cfg.disableaircontrol.toogle do
if not IsPedInAnyVehicle(playerPed) then
-- Player not in vehicle, reset variables
playerPed = GetPlayerPed(-1)
vehicle = nil
vehicleClass = nil
Citizen.Wait(1000)
else
if playerPed ~= GetPlayerPed(-1) or vehicle ~= GetVehiclePedIsIn(playerPed, false) then
-- Player or vehicle changed, update variables
playerPed = GetPlayerPed(-1)
vehicle = GetVehiclePedIsIn(playerPed, false)
if IsPedInAnyVehicle(playerPed) then
vehicleClass = GetVehicleClass(vehicle)
end
end

if vehicleClass and vehicleClassDisableControl[vehicleClass] and (GetPedInVehicleSeat(vehicle, -1) == playerPed) then
if disableIfFlying and IsEntityInAir(vehicle) then
DisableControlAction(2, 59) -- Disable jump control
DisableControlAction(2, 60) -- Disable exit vehicle control
end
local disableIfFlying = true -- Enable/disable control disable while flying

while cfg.disableaircontrol.toggle do
if not IsPedInAnyVehicle(playerPed) then
-- Player not in vehicle, reset variables
playerPed = GetPlayerPed(-1)
vehicle = nil
vehicleClass = nil
Citizen.Wait(1000)
else
if playerPed ~= GetPlayerPed(-1) or vehicle ~=
GetVehiclePedIsIn(playerPed, false) then
-- Player or vehicle changed, update variables
playerPed = GetPlayerPed(-1)
vehicle = GetVehiclePedIsIn(playerPed, false)
if IsPedInAnyVehicle(playerPed) then
vehicleClass = GetVehicleClass(vehicle)
end
end

if vehicleClass and vehicleClassDisableControl[vehicleClass] and
(GetPedInVehicleSeat(vehicle, -1) == playerPed) then
if disableIfFlying and IsEntityInAir(vehicle) then
DisableControlAction(2, 59) -- Disable jump control
DisableControlAction(2, 60) -- Disable exit vehicle control
end
end
end
end

Citizen.Wait(0) -- Wait for next frame without unnecessary delay

Citizen.Wait(0) -- Wait for next frame without unnecessary delay
end
end)
end)

0 comments on commit ffe5e97

Please sign in to comment.