---@diagnostic disable: duplicate-set-field local resourceName = "ox_fuel" if GetResourceState(resourceName) == 'missing' then return end Fuel = Fuel or {} ---Returns the name of the active fuel resource. ---If no supported resource is found, "default" will be returned. ---@return string Fuel.GetResourceName = function() return resourceName end ---Returns the current fuel level of a vehicle. ---@param vehicle number The vehicle entity handle. ---@return number The vehicle fuel level. Fuel.GetFuel = function(vehicle) if not DoesEntityExist(vehicle) then return 0.0 end return Entity(vehicle).state.fuel end ---Sets the fuel level of a vehicle. ---@param vehicle number The vehicle entity handle. ---@param fuel number The fuel level to assign. ---@param type? string The fuel type, used only in ti_fuel. (default: RON91) ---@return nil Fuel.SetFuel = function(vehicle, fuel, type) if not DoesEntityExist(vehicle) then return end local state = Entity(vehicle).state state.fuel = (state.fuel or 0) + fuel end return Fuel