ox_fuel Expanded

One fuel resource. Several community projects. Far too many correctly attached hoses.

Version
v1.5.2-expanded.2
Updated
Aug 30, 2026
License
GPL-3.0
View ox_fuel Expanded resource View files on GitHub
Browse documentationox_fuel Expanded
Sections
01 / OVERVIEW

Overview

ox_fuel Expanded builds on CommunityOx ox_fuel 1.5.2. It adds hands-on gasoline fueling, electric vehicle (EV) charging, portable emergency charging, a themed checkout, and payments checked by the server. Install both included resource folders and the required sound, inventory, and interaction resources before changing vehicle settings.

02 / REQUIREMENTS

Requirements

Required
ox_lib 3.22.0+ and ox_inventory 2.30.0+
Interaction
ox_target for the complete gasoline, EV, and portable workflow
Audio
San Andreas Sound with seven bundled OGG files installed
Companion
Included ox_fuel_assets 1.0.0, started before ox_fuel
Resource names
Keep ox_fuel and ox_fuel_assets
03 / INSTALLATION

Installation

  1. Install both included folders, keeping them named ox_fuel and ox_fuel_assets, and disable every competing fuel resource.

  2. Install ox_lib 3.22.0+, ox_inventory 2.30.0+, ox_target, and San Andreas Sound.

  3. Add the supplied portable_ev_charger item to ox_inventory and copy its compact image into ox_inventory/web/images.

  4. Copy all seven bundled OGG files into san_andreas_sound/web/sounds.

  5. Review fuel, payment, pump, nozzle, EV, portable, vehicle-profile, location, and Chaos Mode settings in config.lua and the data modules.

  6. Start the resources in the documented order and perform a full server restart for the first ox_fuel_assets installation.

04 / CONFIGURATION

Configuration

01

Install the package and dependency baseline

Copy both packaged resources into the server, keep their folders named ox_fuel and ox_fuel_assets, and disable every competing fuel resource. The runtime checks ox_lib 3.22.0+ and ox_inventory 2.30.0+; the complete feature set also requires ox_target and San Andreas Sound.

02

Install the portable inventory item

Copy the portable_ev_charger definition from install/ox_inventory_items.lua into ox_inventory/data/items.lua, then copy portable_ev_charger_compact.png into ox_inventory/web/images. Keep stack false so each unit retains its own charge and deployment metadata.

Exampleox_inventory/data/items.lualua
['portable_ev_charger'] = {
    label = 'Portable EV Charger',
    weight = 12000,
    stack = false,
    close = true,
    consume = 0,
    client = {
        export = 'ox_fuel.portableEvCharger',
        image = 'portable_ev_charger_compact.png',
    },
}
03

Install the seven positional sounds

Copy chargestop.ogg, charging.ogg, fuelstop.ogg, pickupnozzle.ogg, putbackcharger.ogg, putbacknozzle.ogg, and refuel.ogg from ox_fuel/assets/sounds into san_andreas_sound/web/sounds. The shipped configuration addresses that resource directly and the manifest declares it as a dependency.

Examplesan_andreas_sound/web/sounds
chargestop.ogg
charging.ogg
fuelstop.ogg
pickupnozzle.ogg
putbackcharger.ogg
putbacknozzle.ogg
refuel.ogg
04

Configure fuel grades and checkout

The fueling table controls grade order, price per gallon, transfer rate, blend ratio, and consumption multiplier. payments controls visible Cash and Bank choices. Cash uses ox_inventory's money item; Bank auto-detects qbx_core, qb-core, or es_extended.

Exampleconfig.lualua
fueling = {
    pumpGallonsPerSecond = 0.20,
    canGallonsPerSecond = 0.10,
    defaultGrade = 'regular',
    premiumGrade = 'premium',
    gradeOrder = { 'regular', 'premium' },
    grades = {
        regular = { octane = 87, pricePerGallon = 5.82, premiumRatio = 0.0, consumptionMultiplier = 1.00 },
        premium = { octane = 93, pricePerGallon = 7.99, premiumRatio = 1.0, consumptionMultiplier = 0.90 },
    },
}

payments = {
    defaultMethod = 'cash',
    methodOrder = { 'cash', 'bank' },
}
05Register a custom payment provider

When the built-in framework bank adapters do not fit the server, register a server provider after ox_fuel starts. getBalance receives the player ID and selected method; pay must return true only after the matching amount is removed.

Exampleserver payment bridgelua
exports.ox_fuel:setPaymentProvider({
    getBalance = function(playerId, methodId)
        -- Return the available balance for this payment method.
    end,
    pay = function(playerId, amount, methodId)
        -- Remove the amount and return true only on success.
    end,
})
06Tune validation and source occupancy

serverValidation bounds vehicle distance, source-to-vehicle tolerance, accepted tick variance, and the completion grace window. pumpOccupancy controls coordinate precision, four-meter default acquisition range, 15-second leases, and five-second heartbeats. Adjust these together only after testing normal hose and cable reach.

Exampleconfig.lualua
serverValidation = {
    maxVehicleDistance = 6.0,
    sourceVehicleTolerance = 4.0,
    tickTolerance = 2,
    sessionGraceMs = 10000,
}

pumpOccupancy = {
    enabled = true,
    maxAcquireDistance = 4.0,
    leaseDurationMs = 15000,
    heartbeatMs = 5000,
}
07Tune nozzles, hoses, and vehicle mounts

nozzle controls the physical prop, hose reach, attachment, distance rules, fallback mount, positional audio, and debug tools. Resolution checks a model-specific profile first, then safe petrolcap or petroltank bones, then the configurable body fallback; explicit profiles may intentionally use other bones.

08Configure EV stations and portable power

electric controls the charger and connector props, Standard and Rapid pricing and transfer rates, configured EV models, battery capacities, station locations, cables, blips, audio, and synchronized damage. electric.portable controls the unique item's 12 kWh capacity, 7.2 kW display rate, purchase, placement, cable, recharge, warnings, and damage behavior.

09Add custom pumps and fleet profiles

customGasPumpLocations accepts a pump prop, vector4 location, and optional ropeLength; every prop must also be listed in pumpModels. Use vehicleProfiles for gasoline capacity and consumption, electric.vehicles for batteries, and nozzle_offsets.lua for model-specific nozzle or connector mounts.

Exampleconfig.lualua
customGasPumpLocations = {
    {
        prop = 'prop_gas_pump_old3',
        location = vector4(442.2, -977.17, 42.69, 270.3),
        ropeLength = 14.0,
    },
}
10Turn on Chaos Mode

chaosMode.enabled defaults to false. Beneath the master gate are running-engine hazards, hose drive-off outcomes, vintage pump flow quirks, Rapid charger faults, and portable thermal shutdowns. Chance rolls happen on the server; major events use player cooldowns and one-event session guards, and interrupted sessions settle only delivered fuel or energy.

Exampleconfig.lualua
chaosMode = {
    enabled = false,
    adminLogging = true,
    protections = {
        playerCooldownSeconds = 900,
        oneMajorEventPerSession = true,
    },
}
05 / USAGE

How to use and test it

Fuel a gasoline vehicle

Target an available pump, choose a grade and payment method, take the nozzle to the resolved fuel-cap mount, and begin transfer. The live register reports sale, gallons, tank level, grade, and payment while the server bounds volume and cost. Remove the attached nozzle and return it to the source pump when finished.

Charge an electric vehicle

Use a configured Sentinel station with a vehicle listed in electric.vehicles. Choose Standard or Rapid and Cash or Bank, take the connector to the resolved charge port, and complete or interrupt the session through the same server-settled flow. Unlisted vehicles are treated as gasoline unless you add an electric profile.

Purchase and use portable EV power

Purchase the portable unit at an EV station, use the unique ox_inventory item to deploy it, connect it to a configured EV, then pick it up when the transfer ends. Remaining charge is stored in item metadata; recharge the deployed unit at a normal station before recovering it.

Buy, refill, and use a petrol can

Use a target-enabled fuel pump to purchase or refill the equipped WEAPON_PETROLCAN, select the grade and payment method, then use the can near a supported vehicle's resolved fuel-cap position. Can volume and premium blend are stored in item metadata and finalized by the server.

Create a nozzle or connector profile

Set nozzle.offsetDebug.enabled to true, aim at a vehicle, and run the appropriate editor command. Press G for the compact editor, use Up/Down to choose a field and Left/Right to adjust it, Backspace to inspect, then E to print and copy the ready-to-paste profile. /ox_fuel_debugcaps toggles nearby mount markers and missing-model reporting.

Commands
/ox_fuel_nozzleoffset
/ox_fuel_chargeroffset
/ox_fuel_debugcaps

Restart the package safely

After the initial full restart, ox_fuel may be restarted while ox_fuel_assets remains mounted. Stop or update the companion only as part of a full server restart, then verify station props, portable metadata, pump leases, and managed sounds after reconnecting.

Use the direct gasoline fallback

When config.ox_target is false, the client registers /startfueling and maps it to E for gasoline pumps and petrol cans. EV and portable target workflows are not complete in this mode, so ox_target remains required for the advertised package.

Commands
/startfueling
06 / PACKAGE CONTENTS

Package contents

The repository contains two installable resources plus the inventory, image, and sound files that must be placed into their host resources.

01

ox_fuel

Main Lua and NUI resource for gasoline fueling, EV charging, portable power, vehicle energy use, checkout, synchronization, configuration, locales, and public integration exports. Keep this folder name for existing ox_fuel integrations.

02

ox_fuel_assets

Version 1.0.0 companion that streams the electric charger and connector models. It owns persistent YTYP archetypes and must remain mounted while the main resource is restarted.

03

Manual install payloads

install/ox_inventory_items.lua and install/images contain the portable item definition and image. assets/sounds contains the seven San Andreas Sound files. These files are source copies until installed into ox_inventory and san_andreas_sound.

07 / TRANSACTION AND STATE MODEL

Transaction and state model

01

Server-managed transfer sessions

The server resolves configured grade or charge mode, payment balance, capacity, transfer per tick, maximum transferable volume, source reach, and final delivered ticks. Cancellation and fault paths settle only completed delivery.

02

Synchronized source occupancy

Fixed pumps and chargers use coordinate-based leases with acquisition distance, a 15-second default lease, five-second heartbeats, release events, and loss notifications so clients agree on source availability.

03

Replicated vehicle energy state

Entity(vehicle).state.fuel remains a replicated 0–100 value for ox_fuel compatibility. Gas vehicles may also carry fuelPremiumRatio from 0–1; EV models use the same percentage state with configured battery capacity and consumption.

08 / DIFFERENCES FROM UPSTREAM

Differences from upstream

Baseline
CommunityOx ox_fuel 1.5.2
Expanded version
1.5.2-expanded.2
Energy sources
Gas pumps, fuel cans, EV stations, and portable EV power
Vehicle mounts
Automatic safe bones, body fallback, and 669 adapted profiles
Public state
Replicated 0–100 fuel plus normalized premium blend ratio
01

Physical and electric interaction layer

Expanded adds attached gasoline nozzles and EV connectors, hoses and cables, custom stations, synchronized damage, managed positional sound, portable energy, and model-specific branded displays.

02

Capacity, grade, and payment model

Class and model tank sizes, EV batteries, Regular/Premium blend state, live volume pricing, Cash/Bank checkout, and Qbox, QBCore, ESX, or custom bank adapters sit above the preserved 0–100 fuel state.

09 / OPERATIONAL LIMITATIONS

Operational limitations

01

Community preview distribution

The public repository currently has no tag or GitHub release. Treat main as a versioned preview snapshot, pin the tested commit for production, and review the changelog before updating.

02

Complete mode depends on ox_target

ox_target appears in both READMEs but not the main fxmanifest dependencies. The E-key gasoline fallback exists when target is disabled, but EV and portable interactions require the target workflow.

03

Later EVs require newer game builds

Suzume requires build 3570 or newer; X-Treme and Vivanite2 require 3751 or newer; E-Stride needs a build containing the Kortz Center Heist assets. Remove unavailable models from electric.vehicles or raise the server build.

04

Version check follows the upstream base

versionCheck currently queries communityox/ox_fuel rather than this Expanded repository. Use the Expanded repository and changelog as the update source until that checker is changed.

10 / UPDATING

Updating

01

Preserve local configuration and data

Back up config.lua, custom locations, vehicle and electric profiles, nozzle_offsets.lua, payment bridges, and portable item data. Compare those files against the new package instead of overwriting them blindly.

02

Update assets only during a full restart

When ox_fuel_assets changes, stop the server, replace both folders as required, and perform a full restart. Do not stop the companion with players connected. Recheck charger props, connector models, and cleanup before reopening.

03

Repeat the acceptance pass

Test representative gasoline vehicles, EVs, addon models, framework accounts, custom pumps, fuel cans, portable metadata, resource restart, insufficient funds, interrupted transfers, and every enabled Chaos Mode outcome.

11 / LICENSING AND PROVENANCE

Licensing and provenance

01

GPL-3.0 community expansion

Both packaged resources include GPL-3.0 license files. This is an independent expansion of CommunityOx ox_fuel v1.5.2, not an official CommunityOx release; preserve the license, notices, attribution, and prominent modification history with redistributed copies.

02

CDN-Fuel assets and sounds

The companion's charger and connector models plus seven selected sounds are redistributed from the GPL-3.0 CDN-Fuel project at the revisions documented in THIRD_PARTY_NOTICES.md. CDN-Fuel runtime code is not included.

03

LC Fuel data

The 26 default station coordinates and original EV baseline were transcribed from LC Fuel. nozzle_offsets.lua adapts 669 active GPL-3.0 vehicle entries; LC Fuel runtime scripts and media are not required or redistributed.

12 / TROUBLESHOOTING

Troubleshooting

The resource stops during startup
Checks

Check the console for dependency failures. ox_lib 3.22.0+, ox_inventory 2.30.0+, san_andreas_sound, and ox_fuel_assets must be started before ox_fuel; start ox_target first for the complete interaction set. Confirm both package folders retain their required names.

Targets, nozzles, or EV actions are missing
Checks

Verify ox_target is started and config.ox_target, config.nozzle.enabled, and config.electric.enabled remain true. The gasoline E-key fallback does not provide the complete physical, EV, and portable target workflows.

Fueling or charging sounds do not play
Checks

Confirm all seven OGG files were copied into san_andreas_sound/web/sounds, San Andreas Sound starts before ox_fuel, and the configured soundBaseUrl still targets cfx-nui-san_andreas_sound. Test a pickup, loop, stop, and return cue within the configured distance.

EV charger or connector models are missing
Checks

Install and ensure ox_fuel_assets before ox_fuel, then perform a full server restart. Do not repair this by live-stopping the companion; unloading its custom archetypes can crash connected clients.

An electric vehicle is treated as gasoline
Checks

The model must appear in electric.vehicles. Confirm the spawn name and required game build, then add an entry with batteryCapacityKwh and consumptionRate. Reconnect or restart the main resource after changing the profile.

A nozzle or connector mounts incorrectly
Checks

Use /ox_fuel_debugcaps to inspect the resolved mount, then enable nozzle.offsetDebug and run the gasoline or EV offset editor. Add the printed profile to nozzle_offsets.lua and verify both side handling and attachment on the exact addon model.

Bank does not appear as a payment option
Checks

The server only exposes payment methods with a readable balance. Start qbx_core, qb-core, or es_extended before the transaction, or register a custom setPaymentProvider bridge that returns balances and removes funds for the selected method.

The portable item cannot be used or retains no charge
Checks

Confirm the supplied item entry is in ox_inventory, its client export is ox_fuel.portableEvCharger, stack is false, and the image filename matches. Test purchase, deploy, partial transfer, pickup, reconnect, and recharge while inspecting the item's charge metadata.

A source remains occupied
Checks

Wait for the default lease timeout, confirm the client can send its five-second heartbeat and release events, and check source/vehicle distance limits. Repeated stale leases indicate a resource, event-routing, or cleanup problem rather than a reason to disable occupancy globally.

Unexpected damage or shutdowns occur
Checks

Check chaosMode.enabled first. The master switch defaults to false; when enabled, inspect admin logs, per-feature switches, percentages, the 900-second default player cooldown, and the one-major-event session guard before changing individual outcomes.

13 / REFERENCE

Reference

01

Vehicle fuel state

The public compatibility surface remains the replicated vehicle fuel state in the 0–100 range. Read the entity state first and fall back to the native when initializing; write authoritative changes with a replicated state-bag update.

Referenceserver integrationlua
local state = Entity(vehicle).state
local fuel = state.fuel or GetVehicleFuelLevel(vehicle)

state:set('fuel', math.clamp(newFuel, 0, 100), true)
02

Server payment provider

setPaymentProvider is the preferred custom economy API. Pass a table containing getBalance(playerId, methodId) and pay(playerId, amount, methodId), or pass those two functions separately. pay must return true on success.

Referencelua
exports.ox_fuel:setPaymentProvider(provider)
exports.ox_fuel:setPaymentProvider(getBalance, pay)
03

Legacy server payment callback

setPaymentMethod accepts a legacy charge callback receiving player ID, amount, and method ID. New bridges should use setPaymentProvider so checkout can obtain the available balance before beginning a session.

Referencelua
exports.ox_fuel:setPaymentMethod(function(playerId, amount, methodId)
    -- Charge the account and return true on success.
end)
04

Premium blend exports

getFuelPremiumRatio(vehicle) returns the normalized 0–1 blend stored on a vehicle. setFuelPremiumRatio(vehicle, ratio) clamps and replicates the value and returns whether the vehicle input was valid.

Referencelua
local ratio = exports.ox_fuel:getFuelPremiumRatio(vehicle)
local updated = exports.ox_fuel:setFuelPremiumRatio(vehicle, 0.5)
05

Resolved nozzle-mount export

The client getVehicleFuelNozzleMount(vehicle) export returns the cached resolved mount used by the physical interaction layer. It may come from a model profile, safe fuel bone, or configured body fallback.

Referencelua
local mount = exports.ox_fuel:getVehicleFuelNozzleMount(vehicle)
06

Portable inventory callback

portableEvCharger(data, item) is the client export referenced by the supplied ox_inventory item definition. Keep that export name aligned with the installed resource folder.

Referencelua
client = {
    export = 'ox_fuel.portableEvCharger',
}
07

Configuration and data files

config.lua owns runtime settings. data/stations.lua holds inherited gasoline station zones; vehicle_profiles.lua resolves tank and consumption data; electric_profiles.lua resolves configured EVs; fuel_grades.lua handles grades and blend math; nozzle_offsets.lua contains vehicle attachment profiles.

08

Internal callbacks and events

The ox_fuel:* callbacks and network events used for transactions, leases, destruction, sound, portable metadata, and cleanup are internal plumbing rather than a supported third-party API. Integrate through the documented exports and vehicle state.

  • Version 1.5.2-expanded.2 is the manifest and changelog version on the public main branch. The repository currently has no tag or GitHub release, so pin the tested commit rather than treating an automatically generated branch archive as a release artifact.
  • Keep the main resource named ox_fuel and the companion named ox_fuel_assets. A full restart is required for the first companion installation and whenever its streamed archetypes change.
  • The version checker still queries communityox/ox_fuel. Follow the ox_fuel-Expanded repository and changelog for Expanded updates until that runtime target changes.
  • Both packaged resources are GPL-3.0. Preserve LICENSE and THIRD_PARTY_NOTICES.md, CommunityOx attribution, CDN-Fuel asset and sound provenance, LC Fuel data provenance, and modification notices when redistributing the package.
  • San Andreas Sound is the supported shipped audio path. Although legacy InteractSound-compatible code remains internally, do not substitute another provider without reviewing and adapting the current runtime.
  • Do not document setMoneyCheck as a working integration hook in this snapshot: the export assigns a client function, but the active checkout path does not consume it.