Files
community_bridge/modules/fuel/ox_fuel/client.lua
T
2025-03-03 19:08:46 -05:00

15 lines
594 B
Lua

if GetResourceState('ox_fuel') ~= 'started' or (BridgeClientConfig.Fuel ~= "ox_fuel" and BridgeClientConfig.Fuel ~= "auto") then return end
--if GetResourceState('ox_fuel') ~= 'started' then return end
Fuel = Fuel or {}
Fuel.GetFuel = function(vehicle)
if not DoesEntityExist(vehicle) then return 0.0 end
return Entity(vehicle).state.fuel
end
Fuel.SetFuel = function(vehicle, fuel, type)
if not DoesEntityExist(vehicle) then return end
local currentFuel = Entity(vehicle).state.fuel
Entity(vehicle).state.fuel = currentFuel + fuel
return Entity(vehicle).state.fuel
end