# Overview

## zcf\_fuel

`zcf_fuel` is an advanced fuel system for FiveM servers, designed for ESX-based roleplay communities that need a clean, optimized and configurable refueling experience.

The resource includes vehicle fuel consumption, fuel stations, jerry cans, optional station management, fuel stock, dynamic prices and developer exports.

### Features

* Optimized fuel consumption system
* Clean and modern NUI
* Configurable public fuel stations
* Configurable custom fuel stations
* Dynamic fuel prices
* Optional station stock system
* Optional job-based station management
* Jerry can support
* Optional `ox_target` integration
* Optional `ox_inventory` integration
* Optional `ox_lib` notifications
* Fuel persistence for owned vehicles
* Staff commands
* Developer exports
* Fully commented configuration
* Translation system included

### Compatibility

`zcf_fuel` is built for ESX Legacy servers.

#### Required

* `es_extended`
* `oxmysql`

#### Optional

* `ox_target`
* `ox_inventory`
* `ox_lib`

The optional resources are not required to start the script. If `ox_target` is disabled or not running, the script automatically uses classic 3D text interactions.

### Resource Name

The resource folder must be named:

```txt
zcf_fuel
```

Using a different folder name may break NUI callbacks, exports or event references.

### Performance

The script is designed to stay lightweight during gameplay.

Fuel consumption runs on a configurable tick interval and pump detection uses optimized distance checks.

Default consumption tick:

```
Config.Fueling.TickInterval = 1000
```

### Main Systems

#### Vehicle Fuel

Vehicles consume fuel based on RPM, vehicle class and optional custom model multipliers.

#### Fuel Stations

Public stations are generated from predefined GTA gas station coordinates.

Custom stations can be added with:

* custom labels
* custom prices
* custom stock
* job management
* NPC management
* custom radius

#### Jerry Can

The jerry can system supports both native GTA weapon behavior and `ox_inventory` metadata.

#### Station Management

Managed stations can allow specific jobs or staff groups to:

* change prices
* restock fuel
* manage fuel stock

### Developer Exports

Client exports:

```
exports['zcf_fuel']:GetFuel(vehicle)
exports['zcf_fuel']:SetFuel(vehicle, amount)
exports['zcf_fuel']:AddFuel(vehicle, amount)
exports['zcf_fuel']:RemoveFuel(vehicle, amount)
```

Server exports:

```
exports['zcf_fuel']:SaveFuelByPlate(plate, fuel)
exports['zcf_fuel']:GetSavedFuelByPlate(plate)
```

### Asset Escrow

The main client/server code is protected by Asset Escrow.

Editable files include:

```
config.lua
locales/*.lua
sql/*.sql
html/img/*.png
html/img/jerry/*.png
```

This allows server owners to customize the configuration, translations and images without accessing protected source code.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zcf-development.gitbook.io/zcf_dev/resources/zcf_fuel/overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
