β›½nova_fuel

NOVA Framework fuel system. Adds realistic fuel consumption and gas station refueling to vehicles.

Features

  • Fuel Consumption β€” Vehicles consume fuel based on class and speed

  • Gas Stations β€” 25 pre-configured station locations

  • Pay Per Liter β€” Configurable price per liter

  • Vehicle Class Multipliers β€” Different consumption rates by vehicle class

  • Jerry Can β€” Portable fuel item for emergency refueling

  • Station Blips β€” Map markers for all gas stations

  • Station NPCs β€” Configurable peds at stations

Configuration

Edit config.lua:

FuelConfig = {
    PricePerLiter = 3,              -- Cost per liter
    TankCapacity = 65,              -- Default tank size (liters)
    GlobalMultiplier = 1.0,         -- Global consumption multiplier
    ConsumptionInterval = 10000,    -- Fuel check interval (ms)
    InteractDistance = 3.0,
    DrawDistance = 15.0,
    InteractKey = 38,               -- E key

    JerryCan = {
        itemName = 'jerrycan',
        fuelAmount = 25,
        useDistance = 3.0,
        useDuration = 5000,
        shopPrice = 200,
    },

    ClassMultiplier = {
        [0] = 1.0,     -- Compacts
        [1] = 1.0,     -- Sedans
        [2] = 1.2,     -- SUVs
        [3] = 0.9,     -- Coupes
        [4] = 1.3,     -- Muscle
        [5] = 1.5,     -- Sports Classics
        [6] = 1.5,     -- Sports
        [7] = 2.0,     -- Super
        [8] = 0.7,     -- Motorcycles
        [9] = 0.5,     -- Off-road
        -- More classes...
    },

    Blip = { sprite = 361, color = 1, scale = 0.6 },

    Stations = {
        { coords = vector3(49.42, 2778.79, 58.04), label = 'Gas Station' },
        -- 24 more stations...
    },
}

Configuration Options

Option
Type
Description

PricePerLiter

number

Cost per liter of fuel

TankCapacity

number

Default tank size in liters

GlobalMultiplier

number

Scales all consumption rates

ConsumptionInterval

number

How often fuel is consumed (ms)

ClassMultiplier

table

Consumption rate by GTA vehicle class

JerryCan

table

Jerry can item configuration

Stations

table

Gas station coordinates and labels

How It Works

  1. Vehicles spawn with a fuel level stored in nova_vehicles.fuel

  2. Fuel decreases over time based on speed and vehicle class

  3. At a gas station, press E to open the refuel menu

  4. Choose amount to refuel, pay the cost

  5. Jerry can items can be used near a vehicle to add fuel

Jerry Can

The jerry can is an inventory item that adds fuel to the nearest vehicle:

  • Requires nova_inventory to have the jerrycan item registered

  • Use near a vehicle to add JerryCan.fuelAmount liters

  • Consumed on use

  • Can be purchased at general stores

Dependencies

  • nova_core β€” Player data, money system

  • nova_notify β€” Notifications

Notes

  • Fuel level persists in the database via nova_vehicles.fuel

  • Empty vehicles stop consuming fuel

  • Aircraft and boats have their own class multipliers

  • The fuel gauge is displayed in the HUD when in a vehicle

Last updated