@@ -109,8 +109,8 @@ function MiscVehicle:ShootExplosiveMG(enemiesOnly, targetEntity, startPos, endPo
109109end
110110
111111function MiscVehicle :UpdateMachineGuns ()
112- if ( not GVars .features .vehicle .aircraft_mg . triggerbot
113- and not GVars . features . vehicle . aircraft_mg .manual_aim ) then
112+ local cfg = GVars .features .vehicle .aircraft_mg
113+ if not ( cfg . triggerbot or cfg .manual_aim ) then
114114 return
115115 end
116116
@@ -120,17 +120,17 @@ function MiscVehicle:UpdateMachineGuns()
120120
121121 local PV = self .m_entity
122122 local handle = PV :GetHandle ()
123- local manualAim = GVars . features . vehicle . aircraft_mg .manual_aim
124- local triggerbotRange = GVars . features . vehicle . aircraft_mg .tiggerbot_range
123+ local manualAim = cfg .manual_aim
124+ local triggerbotRange = cfg .tiggerbot_range
125125 local playerPos = LocalPlayer :GetPos ()
126126 local rotation = manualAim and CAM .GET_GAMEPLAY_CAM_ROT (2 ) or PV :GetRotation (2 )
127127 local direction = rotation :to_direction ()
128128 local multiplier = manualAim and 200 or triggerbotRange
129129 local destination = playerPos + direction * multiplier
130130 local hit , endCoords , entityHit = World :RayCast (playerPos , destination , - 1 , handle )
131131
132- if (hit and GVars . features . vehicle . aircraft_mg .triggerbot and (ENTITY .IS_ENTITY_A_PED (entityHit ) or ENTITY .IS_ENTITY_A_VEHICLE (entityHit ))) then
133- local enemiesOnly = GVars . features . vehicle . aircraft_mg .enemies_only
132+ if (hit and cfg .triggerbot and (ENTITY .IS_ENTITY_A_PED (entityHit ) or ENTITY .IS_ENTITY_A_VEHICLE (entityHit ))) then
133+ local enemiesOnly = cfg .enemies_only
134134 local ped = Game .GetClosestPed (endCoords , 50 , true )
135135 local veh = Game .GetClosestVehicle (endCoords , 50 , handle )
136136
@@ -150,8 +150,8 @@ function MiscVehicle:UpdateMachineGuns()
150150 self :ShootExplosiveMG (false , 0 , playerPos , endPos )
151151 end
152152
153- local color = GVars . features . vehicle . aircraft_mg .marker_color
154- local markerSize = GVars . features . vehicle . aircraft_mg .marker_size
153+ local color = cfg .marker_color
154+ local markerSize = cfg .marker_size
155155 local markerDest = hit and endCoords or vec3 :new (
156156 playerPos .x + direction .x * 50 ,
157157 playerPos .y + direction .y * 50 ,
@@ -206,17 +206,18 @@ function MiscVehicle:DisableAirTurbulence()
206206end
207207
208208function MiscVehicle :Update ()
209- local PV = self .m_entity
209+ local PV = self .m_entity
210210 local handle = PV :GetHandle ()
211+ local cfg = GVars .features .vehicle
211212
212- if (GVars . features . vehicle .fast_jets and PV :IsPlane () and (VEHICLE .GET_VEHICLE_FLIGHT_NOZZLE_POSITION (handle ) ~= 1.0 )) then
213+ if (cfg .fast_jets and PV :IsPlane () and (VEHICLE .GET_VEHICLE_FLIGHT_NOZZLE_POSITION (handle ) ~= 1.0 )) then
213214 local speed = PV :GetSpeed ()
214215 local gearState = PV :GetLandingGearState ()
215216 local rot = PV :GetRotation (2 )
216217 local pitch = rot .x
217- local baseThrust = 2e4
218- local minThrust = 5e3
219- local maxSpeed = 164 .0
218+ local baseThrust = 25e3
219+ local minThrust = 1e4
220+ local maxSpeed = cfg . fast_jets_speed or 150 .0
220221 local thrustMult = 1.0
221222
222223 if (pitch >= 60 ) then
@@ -225,10 +226,7 @@ function MiscVehicle:Update()
225226 thrustMult = 1.4
226227 end
227228
228- if speed >= 72 and speed < maxSpeed
229- and PAD .IS_CONTROL_PRESSED (0 , 87 )
230- and gearState == Enums .eLandingGearState .RETRACTED
231- then
229+ if (speed >= 70 and speed < maxSpeed and PAD .IS_CONTROL_PRESSED (0 , 87 ) and gearState == Enums .eLandingGearState .RETRACTED ) then
232230 local lerp = math.min (1.0 , (speed ) / (maxSpeed ))
233231 local thrust = math.min (minThrust , baseThrust * thrustMult * (1.0 - lerp ))
234232 ENTITY .APPLY_FORCE_TO_ENTITY_CENTER_OF_MASS (
@@ -245,13 +243,13 @@ function MiscVehicle:Update()
245243 end
246244 end
247245
248- if (GVars . features . vehicle .no_jet_stall ) then
246+ if (cfg .no_jet_stall ) then
249247 if (PV :IsDriveable () and PV :GetEngineHealth () > 350 and PV :GetHeightAboveGround () > 5.0 and not PV :IsEngineOn ()) then
250248 VEHICLE .SET_VEHICLE_ENGINE_ON (handle , true , true , false )
251249 end
252250 end
253251
254- if (GVars . features . vehicle .no_turbulence ) then
252+ if (cfg .no_turbulence ) then
255253 self :DisableAirTurbulence ()
256254 end
257255
0 commit comments