RoviDev Studio

Vehicles
Core
Tools
Jobs
Audio
Economy
Bundles
$29.99

rd_fuel — Fuel Script (Fuel & Energy System)

⛽⚡ Every litre counts.

Fill up, plug in, run dry: your players will feel every litre. A complete fuel and EV system with realistic consumption, hose refuelling, a jerrycan minigame, chargers and a HUD. The server prices and charges every purchase.

Why it hits different

  • 🔥 Driving style matters: high revs, a trailer in tow or a battered engine drain the tank faster.
  • ⛽ Refuelling you can see: nozzle in hand, hose to the pump, a gauge rising over the tank.
  • 🔌 EVs are first-class: they charge, age and run flat.
  • 🔄 Drop-in friendly: keeps the fuel state bag updated and answers GetFuel / SetFuel calls.

What you get

  • The rd_fuel resource, v1.0, with English and Spanish texts.
  • 27 default gas stations at GTA V locations (approximate centres, copied to SQL on first start).
  • NUI with the jerrycan minigame and a fuel/battery HUD.
  • Items for ox_inventory and qb-core (add your own rd_ev_charger.png) and three auto-installed SQL tables.

Features

Consumption

  • Based on class, model, RPM, speed, gearbox, wear, passengers and towing, plus a global multiplier.
  • Low-fuel warning at 12%, coughing below 3%, then the engine cuts out.
  • Bicycles and any class, model or plate you list use no energy.

Gas stations

  • Price per litre or kWh, five time-of-day bands, per-station multiplier, pay by cash or bank.
  • Hose with nozzle and rope, a gauge over the tank and an optional skill check. Cancel and you get a refund.
  • Jerrycan (WEAPON_PETROLCAN, 20 L): fill it with a minigame where you pay what you pour.
  • Price cards on pumps, map blips and an optional attendant NPC selling jerrycans and chargers.

Electric vehicles

  • Chargers you place in game, fast charge, optional charging at gas stations.
  • Server-side battery ageing (fast charging wears it more) and a portable charger item.
  • Vanilla EVs listed by default; add yours to Config.ElectricModels.

Admin tools

  • /fuelstations: add stations in place or by aiming, edit them, place the attendant, scan for pump models, export a config block, reset. Saved to SQL and synced live.
  • /setfuel <0-100> [plate].

How it works

  • At a pump inside a station radius, next to your vehicle, press E.
  • Choose an account and an amount; the server works out litres and price and charges you.
  • Connect the hose. The level rises only because you paid.
  • On the road, the client simulates consumption and the server caps how fast the saved level can change.

Configuration

  • Accounts, currency, prices and time bands, tanks, batteries and EV models.
  • Consumption tables, purchase limits, cooldowns, jerrycan, chargers, pumps, hose, animations and skill check.
  • HUD, blips, price cards, attendant and stations. Purchase webhook goes in server.cfg.
  • Config.AllowExternalSetFuel: accept levels set by other scripts (default) or strict mode.

Requirements

  • ox_lib, oxmysql and rd_bridge (rd_bridge must start first).
  • Optional: ox_inventory (recommended; needed for the jerrycan and the portable charger).
  • Optional: floating holograms with rd_holo, sold separately.
  • Run only one fuel system at a time.

Install in 5 steps

  • 1. Put rd_fuel in your resources and stop any other fuel resource.
  • 2. Add the items: paste items/ox_inventory.lua into ox_inventory/data/items.lua (or items/qb-core.lua). The jerrycan is the native WEAPON_PETROLCAN your inventory already defines.
  • 3. SQL installs itself with Config.AutoInstallSQL = true (rd_fuel_vehicles, rd_fuel_stations, rd_fuel_meta), or import sql/install.sql.
  • 4. In server.cfg: ensure rd_bridge, then ensure rd_fuel, before scripts that call its exports.
  • 5. Optional: uncomment one provide line in the manifest to serve scripts that call GetFuel / SetFuel under another resource name.

Compatibility

QBCore · Qbox · ESX · standalone through rd_bridge (adapters reviewed against each resource's official documentation).

Uses the Entity(vehicle).state.fuel state bag. Its GetFuel / SetFuel exports match scripts written for LegacyFuel, cdn-fuel and ps-fuel (optional provide for each); their other exports are not covered.

Protected with Cfx.re Asset Escrow; config.lua, locales, SQL, items and the UI files stay editable.

First release — report any issue and we fix it.

Exports & events

  • Client: GetFuel(vehicle), SetFuel(vehicle, pct), EnsureVehicleMaxEnergy, ApplyMaxVehicleEnergy, GetHudEnergy, IsElectricVehicle.
  • Server: RefillByPlate(plate, level?, energyType?, model?), SetFuelByPlate, GetFuelByPlate, SetFuel(entity, pct), GetFuel(entity).
  • State bag Entity(vehicle).state.fuel (0-100).

FAQ

The pump does nothing.

Run "Scan nearby objects" in /fuelstations and add the model to Config.PumpProps. Check you are inside a station radius.

My garage spawns cars with random fuel.

Have it call SetFuel, or RefillByPlate from the server.

EVs won't charge.

Add a station with kind = 'electric' or keep chargeAtFuelStations on.

Is it cheat-proof?

Not fully. A modified client can change its local tank, and with the default AllowExternalSetFuel = true it can save a few free refills per minute. Set it to false for strict mode. A player who disconnects mid-refuel is not refunded.

Has it been run on live servers?

Not yet. This is v1.0, reviewed by hand. Report any issue and we fix it.

🇪🇸 En español

⛽⚡ Cada litro cuenta.

Reposta, enchufa, quédate seco: tus jugadores notarán cada litro. Un sistema completo de combustible y eléctricos con consumo realista, repostaje con manguera, bidón con minijuego, cargadores y HUD. El servidor calcula y cobra cada compra.

Por qué engancha

  • 🔥 Tu forma de conducir cuenta: revoluciones altas, un remolque o un motor tocado vacían antes el depósito.
  • ⛽ Un repostaje que se ve: pistola en la mano, manguera hasta el surtidor e indicador que sube sobre el depósito.
  • 🔌 Eléctricos de primera: se cargan, envejecen y se quedan sin batería.
  • 🔄 Fácil de encajar: mantiene al día el state bag fuel y responde a GetFuel / SetFuel.

Qué incluye

  • El recurso rd_fuel, v1.0, con textos en español e inglés.
  • 27 gasolineras por defecto en GTA V (centros aproximados, copiadas a SQL en el primer arranque).
  • NUI con el minijuego del bidón y HUD de combustible y batería.
  • Ítems para ox_inventory y qb-core (añade tu propio rd_ev_charger.png) y tres tablas SQL que se instalan solas.

Funciones

Consumo

  • Según clase, modelo, revoluciones, velocidad, caja de cambios, desgaste, pasajeros y remolque, más un multiplicador global.
  • Aviso de reserva al 12 %, el motor tose por debajo del 3 % y luego se cala.
  • Las bicicletas y las clases, modelos o matrículas que listes no gastan energía.

Gasolineras

  • Precio por litro o kWh, cinco franjas horarias, multiplicador por estación y pago en efectivo o banco.
  • Manguera con pistola y cuerda, indicador sobre el depósito y minijuego opcional. Si cancelas, se te devuelve el dinero.
  • Bidón (WEAPON_PETROLCAN, 20 L): se llena con un minijuego en el que pagas lo que echas.
  • Tarjetas de precio en los surtidores, iconos en el mapa y dependiente NPC opcional que vende bidones y cargadores.

Vehículos eléctricos

  • Cargadores que colocas en el juego, carga rápida y carga opcional en gasolineras.
  • Envejecimiento de la batería en el servidor (la carga rápida la desgasta más) y cargador portátil.
  • Eléctricos vanilla incluidos por defecto; añade los tuyos en Config.ElectricModels.

Herramientas de admin

  • /fuelstations: añade estaciones donde estás o apuntando, edítalas, coloca al dependiente, busca modelos de surtidor, exporta un bloque de config y restablece. Se guarda en SQL y se sincroniza al momento.
  • /setfuel <0-100> [matrícula].

Cómo funciona

  • En un surtidor dentro del radio de una estación, junto a tu vehículo, pulsa E.
  • Elige cuenta e importe; el servidor calcula litros y precio y te cobra.
  • Conecta la manguera. El nivel sube solo porque has pagado.
  • En carretera, el cliente simula el consumo y el servidor limita lo rápido que cambia el nivel guardado.

Configuración

  • Cuentas, moneda, precios y franjas, depósitos, baterías y modelos eléctricos.
  • Tablas de consumo, límites de compra, tiempos de espera, bidón, cargadores, surtidores, manguera, animaciones y minijuego.
  • HUD, iconos del mapa, tarjetas, dependiente y estaciones. El webhook de compras va en server.cfg.
  • Config.AllowExternalSetFuel: acepta los niveles que fijan otros scripts (por defecto) o modo estricto.

Requisitos

  • ox_lib, oxmysql y rd_bridge (rd_bridge debe arrancar antes).
  • Opcional: ox_inventory (recomendado; necesario para el bidón y el cargador portátil).
  • Opcional: hologramas flotantes con rd_holo, a la venta por separado.
  • Usa un solo sistema de combustible a la vez.

Instalación en 5 pasos

  • 1. Copia rd_fuel a tus recursos y para cualquier otro recurso de combustible.
  • 2. Añade los ítems: pega items/ox_inventory.lua en ox_inventory/data/items.lua (o items/qb-core.lua). El bidón es el arma nativa WEAPON_PETROLCAN, que tu inventario ya define.
  • 3. El SQL se instala solo con Config.AutoInstallSQL = true (rd_fuel_vehicles, rd_fuel_stations, rd_fuel_meta), o importa sql/install.sql.
  • 4. En server.cfg: ensure rd_bridge y luego ensure rd_fuel, antes de los scripts que usan sus exports.
  • 5. Opcional: descomenta una línea provide del manifest para atender a scripts que llaman a GetFuel / SetFuel con otro nombre de recurso.

Compatibilidad

QBCore · Qbox · ESX · standalone mediante rd_bridge (adaptadores revisados contra la documentación oficial de cada recurso).

Usa el state bag Entity(vehicle).state.fuel. Sus exports GetFuel / SetFuel encajan con scripts hechos para LegacyFuel, cdn-fuel y ps-fuel (con un provide opcional para cada uno); el resto de sus exports no se cubre.

Protegido con Cfx.re Asset Escrow; config.lua, locales, SQL, ítems y los archivos de la interfaz siguen siendo editables.

Primera versión: si encuentras cualquier fallo, avísanos y lo corregimos.

Exports y eventos

  • Cliente: GetFuel(vehicle), SetFuel(vehicle, pct), EnsureVehicleMaxEnergy, ApplyMaxVehicleEnergy, GetHudEnergy, IsElectricVehicle.
  • Servidor: RefillByPlate(plate, level?, energyType?, model?), SetFuelByPlate, GetFuelByPlate, SetFuel(entity, pct), GetFuel(entity).
  • State bag Entity(vehicle).state.fuel (0-100).

Preguntas frecuentes

El surtidor no responde.

Usa «Escanear objetos cercanos» en /fuelstations y añade el modelo a Config.PumpProps. Comprueba que estás dentro del radio de una estación.

Mi garaje saca coches con combustible aleatorio.

Haz que llame a SetFuel, o a RefillByPlate desde el servidor.

Los eléctricos no cargan.

Añade una estación con kind = 'electric' o deja activado chargeAtFuelStations.

¿Es a prueba de trampas?

No del todo. Un cliente modificado puede cambiar su depósito local y, con el valor por defecto AllowExternalSetFuel = true, guardar algunos rellenos gratis por minuto. Ponlo en false para el modo estricto. Si un jugador se desconecta a mitad del repostaje, no se le devuelve el dinero.

¿Se ha usado ya en servidores reales?

Todavía no. Es la v1.0, revisada a mano. Si encuentras algún fallo, avísanos y lo corregimos.

$29.99

RoviDev Studio

Apple PayGoogle PayMastercardVisaAmerican Express
© 2026 RoviDev Studio
The checkout process is owned & operated by Tebex Limited, who handle product fulfilment, billing support and refunds.
Impressum Terms & Conditions Privacy Policy