T3 // Vehicles & Fleet

coe_fuel

Fuel & Gas Stations

Four fuels, pumps, jerry can, player stations and refinery

HEADLESS SERVICE (NO UI)
DEPENDS ON coe_corecoe_databasecoe_loggingcoe_inventorycoe_businessescoetarget
coe_fuel 6 exports · 3 commands

Runs without a NUI: nothing is rendered on the client and the resource stays idle until events arrive.

01 // OVERVIEW

COE fuel: vehicle consumption with four fuels (regular, premium, ethanol and diesel) mixed in the tank, every map station branded, pumps with payment and a jerry can. Player-owned stations have tiered tanks, a per-liter price set by the owner, a supply fleet (van → truck → tanker) loaded at the refinery and upgrades unlocked by money and liters sold.

On FiveM Enhanced

The tank stores the mix in liters of each fuel: consumption, power and engine wear are the real average of what was pumped.

02 // FEATURES

What the module delivers

01

Four Fuels

Own price, consumption, power and engine effect.

02

Tank Mix

What goes into the tank defines behavior.

03

Player Stations

Stock, price and fleet run by the owner.

04

Refinery & Upgrades

Progression by money and sales history.

ARCHITECTURAL LAYERS // CLEAN ARCHITECTURE

4-Layer Isolation with 0.00 ms Idle

Every COE Framework script strictly follows the principle of separation of concerns. Interact with the 3D stack below:

L4
Presentation & NUI
HTML5 · CSS tokens · CoE UI
CEF DX12
L3
Application & Server
Atomic locks · Rate limiting
Auth Server
L2
Platform & HAL
Core.Platform · Mock natives
Gen9 HAL
L1
Domain & ACID Database
Prepared SQL · MariaDB pool
ACID Pool
LAYER 04 // PRESENTATION & NUI

Responsive NUI & CoE UI Design System

Built with vanilla HTML5, CSS3 tokens, and modern JavaScript. No heavyweight frameworks (React/Vue/Electron). Rendered directly in FiveM DX12's Chromium Embedded Framework at 0.00 ms while closed.

Five themes supported in real time through CSS variables (--coe-accent, --coe-surface)
Fully keyboard-navigable (Tab, Esc, Enter) and ARIA-accessible
Secure asynchronous communication with the FiveM client via fetch("https://...")
ADMIN POWERS // OPERATION & MANAGEMENT

What this script delivers to Server Owners

Manage your city without relying on developers. Runtime parameters, auditing, and ACE-protected commands:

🛡️
ACE Permissions
Administrative operations strictly protected by coe.staff and coe.admin principals.
IsPlayerAceAllowed(src, "coe.admin")
📊
Ledger Auditing
Relevant actions write audit records to the database through coe_audit.
exports.coe_audit:Record(severity, category, event, context)
⚡
0.00ms Idle Telemetry
Event-driven thread dispatch that stays dormant until network events fire.
Clean Architecture & HAL
03 // EXPORTS

Public API 6

Typed contracts to call from other resources. Full types live in types.lua and in the docs reference.

exports['coe_fuel']:IsReady() → boolean

Returns whether migrations have been applied and station tanks have been loaded.

No parameters.

LUA
local result = exports['coe_fuel']:IsReady()
exports['coe_fuel']:GetFuel(vehicleId) → CoeFuelSummary|nil

Returns the fuel state for a registered vehicle currently in use, or nil.

ParameterType
vehicleIdstring|integer
LUA
local result = exports['coe_fuel']:GetFuel(vehicleId)
exports['coe_fuel']:GetEffects(vehicleId) → table|nil

Returns the engine effect of the fuel mix for coe_handling (power from ethanol and premium fuel). Returns nil when no tank is in use.

ParameterType
vehicleIdstring|integer
LUA
local result = exports['coe_fuel']:GetEffects(vehicleId)
exports['coe_fuel']:GetStationTanks(stationId) → table|nil

Returns a station's tanks (player-owned stations can sell only the fuel stored here), including each fuel type's level and capacity.

ParameterType
stationIdstring
LUA
local result = exports['coe_fuel']:GetStationTanks(stationId)
exports['coe_fuel']:IsStation(businessId) → boolean

Checks whether the business ID belongs to a coe_fuel station. Used by the business app to show the Station tab.

ParameterType
businessIdstring
LUA
local result = exports['coe_fuel']:IsStation(businessId)
exports['coe_fuel']:BusinessTablet(playerId, characterId, businessId, payload) → table

Handles the Station tab in the business app on the tablet. Only coe_businesses calls it (app access is checked there). payload.op: overview, price (fuel, price; false restores the table price), upgradeTank (fuel), or upgradeFleet. Errors: forbidden, not_ready, not_a_station, staff_station, invalid_price, not_enough_sales, insufficient_funds, max_level, no_fleet_garage.

ParameterType
playerIdinteger
characterIdstring
businessIdstring
payloadtable
LUA
local result = exports['coe_fuel']:BusinessTablet(playerId, characterId, businessId, payload)
04 // COMMANDS

In-game commands 3

/coe_fuel_fill [id do jogador] [combustível]

Staff tool: fills the tank of the vehicle the player is in (ACE).

/coe_fuel_tank <posto> <combustível> <litros>

Staff tool: sets a fuel stock at a station (tests and fixes, ACE).

/combustivel

Diagnostics: shows the current vehicle tank level and mix.