Update client.lua

This commit is contained in:
Andyyy7666
2022-09-16 14:49:42 +02:00
committed by GitHub
parent b05e558f2f
commit f98a15bafb

View File

@@ -606,19 +606,22 @@ end)
-- vehicle fuel consumption. -- vehicle fuel consumption.
CreateThread(function() CreateThread(function()
while true do while true do
Wait(3500) Wait(500)
local pedVeh = GetVehiclePedIsIn(ped) local pedVeh = GetVehiclePedIsIn(ped)
if pedVeh ~= 0 then local seat = GetPedInVehicleSeat(pedVeh, -1)
if pedVeh ~= 0 and seat ~= 0 then
local vehClass = GetVehicleClass(pedVeh) local vehClass = GetVehicleClass(pedVeh)
if not DecorExistOn(pedVeh, FUEL_DECOR) then if not DecorExistOn(pedVeh, FUEL_DECOR) then
SetFuel(pedVeh, math.random(200, 800) / 10) SetFuel(pedVeh, math.random(200, 800) / 10)
end end
local fuel = GetFuel(pedVeh) local fuel = GetFuel(pedVeh)
if fuel < 5.0 and GetIsVehicleEngineRunning(pedVeh) then if GetIsVehicleEngineRunning(pedVeh) then
DisableControlAction(0, 71) if fuel < 5.0 then
SetVehicleEngineOn(pedVeh, false, true, true) DisableControlAction(0, 71)
SetVehicleEngineOn(pedVeh, false, true, true)
end
SetFuel(pedVeh, fuel - ((GetVehicleCurrentRpm(pedVeh) * config.vehicleClasses[vehClass]) / 1.7))
end end
SetFuel(pedVeh, fuel - ((GetVehicleCurrentRpm(pedVeh) * config.vehicleClasses[vehClass]) / 1.7))
end end
end end
end) end)