-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from devrodrigomolina/main
fix: Erro de ortografia
- Loading branch information
Showing
1 changed file
with
50 additions
and
49 deletions.
There are no files selected for viewing
99 changes: 50 additions & 49 deletions
99
modules/mri/client-side/vehicles-modules/disableaircontrol.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |