Page cover image

🛠️Configuration

Let's configure your new script to your liking!

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.

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:

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

Older ESX version

Change Config.TranslateCap to true.

Config.EsxLegacy = true

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

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!

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:

Config.FuelLevelDriveSlow

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

Config.MaxSpeedLowFuel

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 is an example. Default value is 37km/h or 23mph.

Config.ChargeTime

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

Recharging configuration

Config.CheckIfCharged

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

Config.Paid

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

Config.CostMultiplier

This is basically some kind of tax.

Config.BasePrice

The price we start with before calculations. This may not be lower than 100!

(Config.BasePrice - fuelLevel) * Config.CostMultiplier

Config.Key

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.

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

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
            }
        }
    },
}

Last updated