Configuration
Below we have explained some of the key features found in our Config file within the EV Charging Script.
Framework
Locations
Charging Radius
Charging Characteristics
Authorised Licenses
Edit Menu Autodetection
Keybindings
Vehicle Configuration
Config File before edits
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 = {}
Last updated