> For the complete documentation index, see [llms.txt](https://fantasy-scripts.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fantasy-scripts.gitbook.io/docs/gas-pumps/configuration.md).

# Configuration

## Configuration

All settings are in the `config` folder. **Restart the resource after changing anything.**

| File                  | What is in it                                                   |
| --------------------- | --------------------------------------------------------------- |
| `config/config.lua`   | Fuels, prices, tanks, fuel use, payment, pumps, the engine fire |
| `config/stations.lua` | Where the gas stations are                                      |
| `config/themes.lua`   | The colours of the pump screen                                  |
| `locales/en.lua`      | Every word players see                                          |

***

### Framework

```lua
Config.Framework = 'auto'
```

`'auto'` finds ESX, QBCore or Qbox by itself. Set `'esx'`, `'qbcore'` or `'qbox'` to choose it yourself.

```lua
Config.Locale = 'en'
Config.Debug = false
```

`Config.Locale` must match a file in `locales/`. `Config.Debug = true` prints a line in the server console for every sale. Leave it off unless you are looking into a problem.

***

### Fuel grades

```lua
Config.Grades = {
    { name = 'regular',  label = 'Regular',   octane = '87', price = 3.00 },
    { name = 'midgrade', label = 'Mid Grade', octane = '89', price = 3.25 },
    { name = 'premium',  label = 'Premium',   octane = '93', price = 3.50 },
    { name = 'diesel',   label = 'Diesel',                   price = 3.10, classes = { 10, 11, 17, 19, 20 } },
}
```

| Field     | Meaning                                                                  |
| --------- | ------------------------------------------------------------------------ |
| `name`    | A short name of your own, used to tell grades apart                      |
| `label`   | What the pump screen calls it                                            |
| `octane`  | The small number next to the name (leave it out for none)                |
| `price`   | Dollars per litre                                                        |
| `classes` | Leave out for every vehicle, or list the vehicle classes that may use it |

The order here is the order on the screen. Add, change or remove grades as you like. There must be at least one.

#### The fuel the pump picks

```lua
Config.AutoGrade = {
    default = 'regular',
    classes = { [6] = 'premium', [7] = 'premium', [10] = 'diesel', ... },
}
```

The pump chooses this fuel before the player does. The screen shows it as **REGULAR (AUTO)**. Any class not listed gets `default`.

***

### Filling up

```lua
Config.LitresPerSecond = 1.2
Config.QuickAmounts = { 10, 20 }
```

How fast a pump fills a tank, and the two quick buttons on the amount screen. The third button is always **FULL**.

***

### Tank sizes

```lua
Config.Tanks = {
    classes = { [0] = 40, [1] = 60, [2] = 80, ... },
    models = {
        ['bati'] = 16,
    },
}
```

How many litres a full tank holds. A model listed under `models` uses its own size; anything else uses the size of its class.

| Class |          | Class |             | Class |            |
| ----- | -------- | ----- | ----------- | ----- | ---------- |
| 0     | Compacts | 8     | Motorcycles | 16    | Planes     |
| 1     | Sedans   | 9     | Off-road    | 17    | Service    |
| 2     | SUVs     | 10    | Industrial  | 18    | Emergency  |
| 3     | Coupes   | 11    | Utility     | 19    | Military   |
| 4     | Muscle   | 12    | Vans        | 20    | Commercial |
| 5     | Classics | 13    | Bicycles    | 21    | Trains     |
| 6     | Sports   | 14    | Boats       | 22    | Open wheel |
| 7     | Super    | 15    | Helicopters |       |            |

#### Electric vehicles

```lua
Config.Electric = { 'voltic', 'raiden', 'neon', ... }
```

Vehicles that never use fuel and that the pump will not fill. Bicycles and trains never take fuel, whatever is listed.

#### A vehicle's first fuel

```lua
Config.NewVehicleFuel = { min = 35, max = 85 }
```

How full a vehicle is the first time anybody sits in it, picked at random between the two.

***

### Fuel use while driving

```lua
Config.Consumption = {
    enabled = true,
    idle = 0.25,
    full = 3.0,
    classes = { [8] = 0.7, [7] = 1.4, ... },
    models = { ['adder'] = 1.5 },
}
```

| Field                | Meaning                                                                                   |
| -------------------- | ----------------------------------------------------------------------------------------- |
| `idle`               | Share of a full tank (0 to 100) burnt each minute with the engine running and no throttle |
| `full`               | The same, at the top of the revs                                                          |
| `classes` / `models` | Above 1.0 is thirstier, below 1.0 is thriftier                                            |

With the default numbers, a car driven hard goes from full to empty in about half an hour.

{% hint style="info" %}
Set `enabled = false` if another script on your server burns the fuel. The pumps keep working either way.
{% endhint %}

***

### Paying

```lua
Config.Payment = {
    cash = true,
    card = true,
    cardAccount = 'bank',
}
```

Cash takes from the pocket; card takes from the bank account named in `cardAccount`. Turn either one off to leave only the other.

{% hint style="info" %}
The full price is held when the player pays, the way a real pump holds it on a card. When the fuel stops, they are charged only for what went in and the rest goes straight back. If they leave the server in the middle, the change is saved in `data/ledger.json` and paid the next time they join.
{% endhint %}

***

### The pumps

```lua
Config.Pumps = {
    ['prop_gas_pump_1a'] = { display = BAND, sides = true, hose = vec3(0.62, 0.0, 1.35) },
    ...
}
Config.DrawDistance = 30.0
```

Every gas pump model in the game, and where its screen and hose are. These were measured off the game's own models. You only need to change this to add a pump model of your own.

| Field     | Meaning                                                   |
| --------- | --------------------------------------------------------- |
| `display` | Where the screen is painted on the pump                   |
| `sides`   | `true` when the pump is used from both its front and back |
| `hose`    | Where the hose leaves the pump                            |

`Config.DrawDistance` is how far away the pump screens are painted, in metres.

```lua
Config.PromptDistance = 1.6
Config.Key = 38
```

How close a player has to be to see the \[E] prompt, and the key for it when our ox\_lib is not installed (38 is E).

***

### The nozzle and hose

```lua
Config.Nozzle = {
    model = 'prop_cs_fuel_nozle',
    hoseLength = 7.0,
}
```

`hoseLength` is how far the hose reaches from the pump, in metres. Walk further with the nozzle and it goes back on the pump. Drive off with it in the car and the hose snaps.

***

### Engine left running

```lua
Config.EngineOn = {
    explode = true,
    seconds = 8,
}
```

The pump warns the player. If the engine is still running after `seconds`, the car catches fire. Set `explode = false` for just the warning.

***

### The close-up camera

```lua
Config.Camera = {
    zoom = 1.0,
    fov = 45.0,
}
```

`zoom` above 1.0 stands the camera further back from the pump screen, below 1.0 closer.

```lua
Config.Volume = 0.35
```

The pump's beeps, from 0 (silent) to 1.

***

### Gas stations

```lua
Config.Stations = {
    blips = true,
    sprite = 361,
    colour = 1,
    scale = 0.65,
    onlyAtStations = true,
    radius = 30.0,
}
```

The map blips, and a check that nobody buys fuel away from a station. With `onlyAtStations` on, the server refuses a sale more than `radius` metres from every station in `config/stations.lua`.

{% hint style="warning" %}
**Pumps in a custom map or MLO?** Add the middle of that station to `config/stations.lua`, or players there will be told the pump is out of service.
{% endhint %}

```lua
Config.LockPumps = true
```

Nobody can start a pump somebody else is already filling from. Each side of a pump is locked on its own, so two cars can still fill up at one pump.

***

### Colours

`config/themes.lua` holds every colour on the pump screen. Any colour a web page understands works: `'#eef2d6'`, `'rgb(238, 242, 214)'` or `'rgba(238, 242, 214, 0.95)'`. No rebuilding is needed — just restart the resource.

### Words

Every word on the pump screen, the prompts and the messages is in `locales/en.lua`. To translate, copy it to a new file (`de.lua` for German), change the words on the right, change the `'en'` at the top to match, and set `Config.Locale` to it. Keep every `%s` where it is.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://fantasy-scripts.gitbook.io/docs/gas-pumps/configuration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
