For the complete documentation index, see llms.txt. This page is also available as Markdown.

Fuel add system

Our HUD is already compatible with several fuel systems: cdn-fuel, frfuel, LegacyFuel, lj-fuel, nd_fuel, okokGasStation, ox_fuel, ps-fuel, Renewed-Fuel, ti_fuel.

Custom Fuel System Integration

How to add your own fuel system

  1. Create a new .lua file in this folder (e.g., myfuel.lua)

  2. Use this template:

-- My Custom Fuel System
return {
    name = "myfuel",           -- unique identifier
    resourceName = "myfuel",   -- resource name to check (use nil for no check)

    GetFuel = function(vehicle)
        -- Your code to get fuel level here
        local success, result = pcall(function()
            return exports['myfuel']:GetFuelLevel(vehicle)
        end)

        if success and result then
            return math.ceil(result)  -- return 0-100
        end

        return nil  -- return nil if failed
    end
}
  1. Save the file

  2. In config.lua, set:

    • Config.FuelSystem = "auto" (auto-detect all systems)

    • OR Config.FuelSystem = "myfuel" (use only your system)

Available Systems

  • LegacyFuel - LegacyFuel system

  • ox_fuel - Overextended fuel

  • cdn-fuel - CDN Fuel

  • ps-fuel - Project Sloth fuel

  • lj-fuel - LJ Fuel

  • okokGasStation - okokGasStation

  • Renewed-Fuel - Renewed Fuel

  • ti_fuel - TI Fuel

  • nd_fuel - ND Fuel

  • frfuel - FR Fuel

  • native - GTA V native fuel (fallback)

Configuration

In config.lua:

Priority Order (when using "auto")

The system will try fuel systems in this order:

  1. Your configured system (if specified)

  2. All systems in editable/fuel/ folder

  3. Native GTA V fuel (fallback)

Notes

  • Return values should be between 0-100

  • Use math.ceil() to round up decimals

  • Return nil if fuel cannot be retrieved

  • The resourceName field is optional (set to nil if not needed)

Last updated