# Configuration

## Language

There are a few default languages that come with the script. You can easily add your own language or just translate one of the default ones. Let me show you how to choose your language.

### Newer ESX version

Go to the `config.lua` and look for `Config.Locale`. Once you found that you can change the letters according to the file in the `locales directory`. Leave `Config.EsxLegacy` on `false`.

```lua
Config.EsxLegacy = false --EsxLegacy = older ESX that doesn't have translatecap yet
Config.Locale = GetConvar('esx:locale', 'en')
```

For example if you want it to use Dutch, do this:

```lua
Config.Locale = GetConvar('esx:locale', 'nl')
```

### Older ESX version

Change `Config.TranslateCap` to `true`.

```lua
Config.EsxLegacy = true
```

Find this and choose your language, all languages found in `locales` folder.

```lua
Config.Lang = 'en'
```

## Adding a new vehicle to charge

In the `config.lua` you'll find a list of electric vehicles, these vehicles are able to charge but not able to get refuelled. If you want to add a vehicle you simply add a new line with your vehicle!

```lua
Config.ElectricCars = {
    "surge",
    "iwagen",
    "voltic",
    "voltic2",
    "raiden",
    "cyclone",
    "tezeract",
    "neon",
    "omnisegt",
    "caddy",
    "caddy2",
    "caddy3",
    "airtug",
    "rcbandito",
    "imorgon",
    "dilettante",
    "khamelion",
    "tesla", --This is a new vehicle
}
```

## Vehicle behaviour

In the config we can adjust how the vehicle behaves. There are 3 configurable parameters:

<details>

<summary>Config.FuelLevelDriveSlow</summary>

At what fuel/battery level the vehicle will start driving slower. Default value is 5%.

</details>

<details>

<summary>Config.MaxSpeedLowFuel</summary>

The max speed the vehicle can drive when fuel/battery level is at the low level (previous parameter). This is in meters per second, you can easily convert it with any converter online, [here ](https://www.metric-conversions.org/speed/meters-per-second-to-miles-per-hour.htm)is an example. Default value is 37km/h or 23mph.

</details>

<details>

<summary>Config.ChargeTime</summary>

The time it takes to charge a vehicle, this is in miliseconds. Default value is 30000ms or 30sec.

</details>

## Recharging configuration

<details>

<summary>Config.CheckIfCharged</summary>

Check if vehicle is already charged or not (true or false), default is true.

</details>

<details>

<summary>Config.Paid</summary>

Pay to charge your vehicle or not (true or false), default is true.

</details>

<details>

<summary>Config.CostMultiplier</summary>

This is basically some kind of tax.&#x20;

</details>

<details>

<summary>Config.BasePrice</summary>

The price we start with before calculations. <mark style="background-color:red;">**This may not be lower than 100!**</mark>

`(Config.BasePrice - fuelLevel) * Config.CostMultiplier`

</details>

<details>

<summary>Config.Key</summary>

Shouldn't touch this if you don't know what you are doing. This is to define the key players need to press when refueling. Controls found [here](https://docs.fivem.net/docs/game-references/controls/).

</details>

## Charging zones

There is only one default zone, this because the map comes with only one chargepoint. You can easily add new zones.

* `zone = {}` -> The big zone of the whole chargestation
* `chargers = {}` -> Zone of the chargers where control is enabled to charge

```lua
Config.Zones = {
    ["zone1"] = {
        showBlip = true,
        blipPoint = vector3(274.97940063477, -337.283203125, 30.75),
        label = 'Chargestation',
        blipSprite = 354, --https://docs.fivem.net/docs/game-references/blips/
        blipColour = 28, -- ^ at the bottom
        blipScale = 0.8,
        zone = {
            vector2(295.9765625, -348.94812011719),
            vector2(273.72085571289, -340.7600402832),
            vector2(274.97940063477, -337.283203125),
            vector2(263.0862121582, -332.81060791016),
            vector2(268.76885986328, -316.66125488281),
            vector2(303.35650634766, -329.41555786133),
        },
        minZ = 40.919868469238,
        maxZ = 46.919887542725,
        debugPoly = false,
        chargers = {
            [1] = {
                zone = {
                    vector2(304.30792236328, -330.07797241211),
                    vector2(297.73263549805, -348.62664794922),
                    vector2(296.65606689453, -348.09194946289),
                    vector2(303.08889770508, -329.78271484375)
                },
                minZ = 44.0,
                maxZ = 48.0,
                debugPoly = false
            },
            [2] = {
                zone = {
                    vector2(283.54205322266, -329.98635864258),
                    vector2(285.05841064453, -330.43246459961),
                    vector2(280.70397949219, -342.53076171875),
                    vector2(279.36154174805, -342.03057861328)
                },
                minZ = 44.0,
                maxZ = 48.0,
                debugPoly = false
            },
            [3] = {
                zone = {
                    vector2(262.54244995117, -332.62448120117),
                    vector2(261.49066162109, -332.16995239258),
                    vector2(267.09771728516, -316.97903442383),
                    vector2(268.49868774414, -317.50799560547)
                },
                minZ = 44.0,
                maxZ = 48.0,
                debugPoly = false
            }
        }
    },
}
```


---

# 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://lumio-studio.gitbook.io/intro/evs-esx/configuration.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.
