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.

1) Go to the fxmanifest.lua and look for shared_scripts.

2) You will find this on that spot:

shared_scripts {
    '@qb-core/shared/locale.lua',
    'locales/en.lua', --Choose a language, you can add some yourself if you want
    'config.lua'
}

3) On the 3th line you see locales/en.lua this stands for English. So if you want French for example you choose fr.lua instead of en.lua. This is possible because fr.lua is already present in the locales folder.

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 = {
    "neon",
    "voltic",
    "cyclone",
    "raiden",
    "tezeract",
    "dilettante",
    "imorgon",
    "surge",
    "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.BatteryLevelDriveSlow

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

Config.MaxSpeedLowBattery

The max speed the vehicle can drive when 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.

Config.Paid

If true people will pay to recharge, if false it's free

Config.BasePrice

Baseprice for each charge session

Config.Tax

Tax paid for recharging

(toCharge * Config.BasePrice) / 100 * Config.Tax

Charging zones

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

Config.Zones = {
    ["zone1"] = {
        showBlip = true,
        blipPoint = vector3(274.97940063477, -337.283203125, 30.75),
        label = 'Charge station',
        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,
    },
    ["zone2"] = {
        showBlip = true,
        blipPoint = vector3(250.0, 250.0, 25.0),
        label = 'Charge station 2',
        blipSprite = 354,
        blipColour = 28,
        blipScale = 0.8,
        zone = {
            vector2(250.0, 250.0),
            vector2(275.0, 250.0),
            vector2(250.0, 275.0),
            vector2(275.0, 275.0),
        },
        minZ = 20.0,
        maxZ = 30.0,
    },
}

Fueling dependency

We support LegacyFuel, gks-fuel and ps-fuel by default.

Config.FuelScript = 'ps-fuel' -- 'LegacyFuel', 'gks-fuel' or 'ps-fuel'

Last updated