---
description: >-
  Below we have explained some of the key features found in our Config file
  within the EV Charging Script.
---

# Configuration

***

#### <mark style="color:$primary;">Framework</mark>

{% hint style="info" %}
Select your framework (by default the script will auto detect)

```lua
Config.Framework = 'auto' -- 'auto', 'esx', 'qbcore', 'standalone'
```
{% endhint %}

***

#### <mark style="color:$primary;">Locations</mark>

{% hint style="info" %}
If you wish to use our default locations ensure this is set to true for the <mark style="color:red;">First time</mark> running the script.



```
Config.UseLocations = false
```
{% endhint %}

***

#### <mark style="color:$primary;">Charging Radius</mark>

{% hint style="info" %}
This setting will determine how close a vehicle needs to be to the prop to trigger the <mark style="color:$success;">Charging UI</mark>.



```
Config.ChargingStationRadius = 5.0
```
{% endhint %}

***

#### <mark style="color:$primary;">Charging Characteristics</mark>

{% hint style="info" %}
The charging characteristics can be customised to your economy, Below is an example for how the script calculates the final charge to bill the player.\
\
<mark style="color:blue;">25% needed ÷ Percentage Per KWh (2.0) = 12.5 kWh × Charge Cost Per KWh (1.0) = £13 (Rounded up)</mark>\


```lua
Config.TimePerPercent = 0.3 -- Time in seconds per 1% charge
Config.MaxChargeLevel = 100
Config.ChargeCost = 1.0 -- Cost per kWh in currency
Config.MinChargeAmount = 1 -- Minimum charge amount percentage
Config.PercentagePerKWh = 2.0 -- Percentage of charge per kWh
Config.RequireDriverSeat = false
Config.FlashHazardsWhileCharging = true
```
{% endhint %}

***

#### <mark style="color:$primary;">Authorised Licenses</mark>

{% hint style="info" %}
You can set the Allowed members that will be authorised to place, edit and delete you EV Charging Stations. You can grab you License from your TxAdmin Console.\
\
<img src="https://4245362062-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7eimH2Ryydspchq7s65m%2Fuploads%2F0IfwIhSAEM8t7Ub0PicT%2Fimage.png?alt=media&#x26;token=401f4e02-a8f8-4be8-a0c9-124809a0f7ad" alt="" data-size="original">\


```
Config.AllowedLicenses = {
    ["license:############"] = true, -- Set to true to allow
    ["license:############"] = false, -- Set to false to disable
    ["license:############"] = false,
}
```
{% endhint %}

***

#### <mark style="color:$primary;">Edit Menu Autodetection</mark>

{% hint style="info" %}
The edit menu allows for autodetection if configured to do so, this will make it so you can walk within the set <mark style="color:blue;">Distance</mark> and it will automatically open the edit menu rather than using the /editEV command.\


```
Config.EnableAutoEditDetection = false
Config.AutoEditDistance = 2.0
```
{% endhint %}

***

#### <mark style="color:$primary;">Keybindings</mark>

{% hint style="info" %}
The Keybindings to move the prop around during placement and editing can be customised in the Config file to ensure it doesn't clash with other script you may have.  <mark style="color:blue;">The keybinds can be found here -></mark> [<mark style="color:blue;">CLICK HERE</mark>](https://docs.fivem.net/docs/game-references/controls/)\


```
Config.Buttons = {
    MoveForwards = 111,
    MoveBackwards = 112,
    MoveLeft = 108,
    MoveRight = 109,
    MoveUp = 172,
    MoveDown = 173,
    RotateForwards = 117,
    RotateBackwards = 118,
    RotateLeft = 175,
    RotateRight = 174,
    SnapToGround = 143,
    SaveProp = 176,
}
```
{% endhint %}

***

<mark style="color:$primary;">Vehicle Configuration</mark>

{% hint style="info" %}
In this section you can set the vehicles you wish to <mark style="color:$success;">ALLOW</mark> to charge at these locations, this could include Emergency vehicles if you have a modern fleet of EV service vehicles.\


```
Config.AllowedVehicles = {
    -- Electric Cars
    ["omnisegt"] = {name = "Obey Omnis e-GT"},
    ["imorgon"] = {name = "Imorgon"},
    ["neon2"] = {name = "Pfister Neon 2"},
    ["iwagen"] = {name = "Coil iWagen"},
    ["cyclone2"] = {name = "Coil Cyclone II"},
    ["neon"] = {name = "Pfister Neon"},
    ["raiden"] = {name = "Coil Raiden"},
    ["tezeract"] = {name = "Pegassi Tezeract"},
    ["voltic"] = {name = "Coil Voltic"},
    ["voltic2"] = {name = "Coil Voltic 2"},
    ["surge"] = {name = "Karin Surfer"},
    
    -- Emergency Vehicles (Electric)
    ["police"] = {name = "Police Cruiser"} --If Electric
}
```
{% endhint %}

***

## <mark style="color:$primary;">Config File before edits</mark>

```lua
Config = {}
Config.Debug = false
Config.Framework = 'auto' -- 'auto', 'esx', 'qbcore', 'standalone'
Config.UseLocations = false -- Pre-configured locations for charging stations to get you started.
Config.ChargingStationRadius = 5.0
Config.UseBlips = true
Config.FuelSystem = {
    enabled = true,
    type = 'auto', -- 'auto', 'legacyfuel', 'ox_fuel', 'cdn-fuel', 'ps-fuel', 'standalone'
    exportName = 'LegacyFuel' -- Export name for the fuel system
}

Config.Billing = {
    enabled = true,
    method = 'bank', -- 'bank', 'cash', 'both'
    checkFundsFirst = true, -- Check if player has enough money before allowing charging
    notifications = {
        enabled = true, -- Enable/disable billing notifications
        showOnComplete = true, -- Show notification when charging completes
        showOnCancel = true, -- Show notification when charging is cancelled
        showPaymentMethod = true -- Show which payment method was used (bank/cash)
    }
}

-- Charging Characteristics --
-- EXAMPLE -- 25% needed ÷ PercentagePerKWh (2.0) = 12.5 kWh × ChargeCost Per KWh (1.0) = £13 (rounded to next whole pound)--
Config.TimePerPercent = 0.3 -- Time in seconds per 1% charge
Config.MaxChargeLevel = 100
Config.ChargeCost = 1.0 -- Cost per kWh in currency
Config.MinChargeAmount = 1 -- Minimum charge amount percentage
Config.PercentagePerKWh = 2.0 -- Percentage of charge per kWh
Config.RequireDriverSeat = false
Config.FlashHazardsWhileCharging = true

-- Notification settings --
Config.Notifications = {
    type = 'qbcore', -- 'chat', 'mythic', 'ox_lib', 'esx', 'qbcore', 'okokNotify', 'pNotify', 'NotificationV2', 'custom'
    position = 'top-right', -- Position for certain notification systems
    duration = 5000, -- Duration in milliseconds (5 seconds)
    sound = true, -- Play sound with notifications (if supported)
    
    -- Notification filtering - only show important notifications
    showLevel = 'important', -- 'all', 'important', 'critical'
    -- 'all' = Show everything (inform, success, error, warning)
    -- 'important' = Show success, error, warning (skip basic info)
    -- 'critical' = Show only error and warning (critical issues only)
}

-- Placement Menu Options --
Config.AllowedLicenses = {
    ["license:############"] = true,
    ["license:############"] = false,
    ["license:############"] = false,
}
Config.EnableAutoEditDetection = false
Config.AutoEditDistance = 2.0
Config.Buttons = {
    MoveForwards = 111,
    MoveBackwards = 112,
    MoveLeft = 108,
    MoveRight = 109,
    MoveUp = 172,
    MoveDown = 173,
    RotateForwards = 117,
    RotateBackwards = 118,
    RotateLeft = 175,
    RotateRight = 174,
    SnapToGround = 143,
    SaveProp = 176,
}

-- Vehicle Configuration --
Config.AllowedVehicles = {
    -- Electric Cars
    ["omnisegt"] = {name = "Obey Omnis e-GT"},
    ["imorgon"] = {name = "Imorgon"},
    ["neon2"] = {name = "Pfister Neon 2"},
    ["iwagen"] = {name = "Coil iWagen"},
    ["cyclone2"] = {name = "Coil Cyclone II"},
    ["neon"] = {name = "Pfister Neon"},
    ["raiden"] = {name = "Coil Raiden"},
    ["tezeract"] = {name = "Pegassi Tezeract"},
    ["voltic"] = {name = "Coil Voltic"},
    ["voltic2"] = {name = "Coil Voltic 2"},
    ["surge"] = {name = "Karin Surfer"},
    
    -- Emergency Vehicles (Electric)
    ["police"] = {name = "Police Cruiser"} --If Electric
}

-- Localization
Config.Locale = {
    ['not_electric_vehicle'] = 'This vehicle is not electric!',
    ['already_charging'] = 'This vehicle is already charging!',
    ['too_far_from_station'] = 'You need to be closer to a charging station!',
    ['not_driver'] = 'You must be the driver to start charging!',
    ['charging_started'] = 'Charging started! Cost: £%.2f per kWh',
    ['charging_complete'] = 'Charging complete! Total cost: £%.2f',
    ['charging_cancelled'] = 'Charging cancelled!',
    ['insufficient_funds'] = 'Insufficient funds to pay for this charging session!',
    ['checking_funds'] = 'Checking available funds...',
    ['funds_check_failed'] = 'Unable to verify funds. Please try again.',
    ['vehicle_locked'] = 'Vehicle locked during charging',
    ['vehicle_unlocked'] = 'Vehicle unlocked',
    ['station_occupied'] = 'This charging station is occupied!',
    ['interact_to_charge'] = '[E] Open Charging UI',
    ['interact_to_stop'] = '[E] Open Charging UI'
}


---------------------------
---- OPTIONAL SETTINGS ----
---------------------------

Config.BlipSprite = 354
Config.BlipColor = 2
Config.BlipScale = 0.8
Config.BlipText = "EV Charging Station"

-- Charging stations locations -- DO NOT EDIT THIS UNLESS YOU KNOW WHAT YOU ARE DOING
Config.ChargingStations = {}


```
