mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-19 06:46:03 +01:00
Update client.lua
This commit is contained in:
@@ -606,21 +606,24 @@ 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
|
||||||
|
if fuel < 5.0 then
|
||||||
DisableControlAction(0, 71)
|
DisableControlAction(0, 71)
|
||||||
SetVehicleEngineOn(pedVeh, false, true, true)
|
SetVehicleEngineOn(pedVeh, false, true, true)
|
||||||
end
|
end
|
||||||
SetFuel(pedVeh, fuel - ((GetVehicleCurrentRpm(pedVeh) * config.vehicleClasses[vehClass]) / 1.7))
|
SetFuel(pedVeh, fuel - ((GetVehicleCurrentRpm(pedVeh) * config.vehicleClasses[vehClass]) / 1.7))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- spawn pumps on the map.
|
-- spawn pumps on the map.
|
||||||
|
|||||||
Reference in New Issue
Block a user