πŸ”₯All scripts on our website are 50% off!πŸ”₯
Logo

Configuration

[!NOTE] Don't touch this line:

Config, Lang, Noti, Blips, Fuel = {}, {}, {}, {}, {}

Configuration File

Framework Setup

Config.Framework = "esx" -- esx / qb
Config.Core = "esx:getSharedObject" -- core name for ESX / 'qb-core' for QBCore

Fuel Pricing

Configure the cost per fuel tick for each fuel type:

Config.fuelPriceTickElectric = 1 -- price per tick for electric charging
Config.fuelPriceTickGas95 = 1 -- price per tick for Gas95 (standard)
Config.fuelPriceTickGas98 = 1.2 -- price per tick for Gas98 (premium)
Config.fuelingTimeTick = 10000 -- time in milliseconds per fuel tick

Fuel Models

Config.electricmodel = "Electric" -- electric fuel display name
Config.gas95 = "Gas95" -- Gas95 fuel display name
Config.gas98 = "Gas98" -- Gas98 fuel display name (premium)

[!NOTE] Do not change these values unless you have modified the HTML file

Performance Boost

Config.gas98TorqueMultiplier = 5.0 -- acceleration multiplier for Gas98 premium fuel

Gas98 premium fuel provides enhanced vehicle performance with increased torque.

Payment Account

Config.bankaccount = "bank" -- account type to charge for fuel purchases

Petrol Can Configuration

Config.petrolCanPrice = 800 -- price for petrol can item
Config.keyToBuyCan = 47 -- key to purchase petrol can (default: G)

Inventory Systems

Config.useOXinventory = true -- enable OX Inventory integration
Config.useQSinventory = false -- enable QS-Inventory integration
Config.customInventory = false -- enable custom inventory integration

Alert Font

Config.alertFont = 4 -- font ID for alerts (set to 0 for Chinese characters)

Fuel Consumption

RPM-Based Fuel Usage

Fuel consumption varies based on engine RPM percentage:

Fuel.FuelUsage = {
    [1.0] = 1.4, -- 100% RPM
    [0.9] = 1.2, -- 90% RPM
    [0.8] = 1.0, -- 80% RPM
    [0.7] = 0.9, -- 70% RPM
    [0.6] = 0.8, -- 60% RPM
    [0.5] = 0.7, -- 50% RPM
    [0.4] = 0.5, -- 40% RPM
    [0.3] = 0.4, -- 30% RPM
    [0.2] = 0.2, -- 20% RPM
    [0.1] = 0.1, -- 10% RPM
    [0.0] = 0.0, -- 0% RPM (idle)
}

[!NOTE] Left value is RPM percentage, right value is fuel consumed per second divided by 10

Vehicle Class Multipliers

Customize fuel consumption for different vehicle classes:

Fuel.Classes = {
    [0] = 1.0,  -- Compacts
    [1] = 1.0,  -- Sedans
    [2] = 1.0,  -- SUVs
    [3] = 1.0,  -- Coupes
    [4] = 1.0,  -- Muscle
    [5] = 1.0,  -- Sports Classics
    [6] = 1.0,  -- Sports
    [7] = 1.0,  -- Super
    [8] = 1.0,  -- Motorcycles
    [9] = 1.0,  -- Off-road
    [10] = 1.0, -- Industrial
    [11] = 1.0, -- Utility
    [12] = 1.0, -- Vans
    [13] = 0.0, -- Cycles (no fuel consumption)
    [14] = 1.0, -- Boats
    [15] = 1.0, -- Helicopters
    [16] = 1.0, -- Planes
    [17] = 1.0, -- Service
    [18] = 1.0, -- Emergency
    [19] = 1.0, -- Military
    [20] = 1.0, -- Commercial
    [21] = 1.0, -- Trains
}

[!TIP] If you want SUVs to use less fuel, change the value to under 1.0 (e.g., 0.8)

Language Configuration

Lang.enter = "Press ~r~E~w~ to refuel"
Lang.enterelec = "Press ~r~E~w~ to recharge"
Lang.enterpetrolcan = "Press ~r~G~w~ to refill the tank"
Lang.buypetrolcan = "Press ~r~G~w~ to buy petrol can"
Lang.novehicle = "There is no vehicle nearby"
Lang.gasstationerror = "This gas station does not provide this service"
Lang.chargererror = "This power station does not offer this service"
Lang.noservice = "Service not available"
Lang.fueltypeerror = "Select a fuel type"
Lang.leavevehicle = "To fill the tank, you must leave the vehicle"
Lang.pay = "You have paid a total of $"
Lang.itemoninventory = "You already have this item in your inventory"
Lang.nospace = "You have no space in your inventory"
Lang.okpetrolcan = "You have purchased a petrol can for $"
Lang.refueling = "for refueling"
Lang.filled = "Fuel tank has been filled"

Notifications

Noti.error = "error" -- notification type for errors
Noti.success = "check" -- notification type for success
Noti.time = 5000 -- notification duration in milliseconds

function notifications(notitype, message, time)
    -- Customize your notification system here
    -- Example: TriggerEvent('okokNotify:Alert', '', message, time, notitype)
end

Blips Configuration

Blips.blip = 361 -- blip sprite ID for gas stations
Blips.blipColor = 59 -- blip color
Blips.blipScale = 0.5 -- blip size
Blips.blipText = "Gas Station" -- blip label text

Electric Vehicle Models

Define which vehicle models are electric (must be UPPERCASE):

electricModels = {
    ["AIRTUG"] = true,
    ["NEON"] = true,
    ["RAIDEN"] = true,
    ["CADDY"] = true,
    ["CADDY2"] = true,
    ["CADDY3"] = true,
    ["CYCLONE"] = true,
    ["DILETTANTE"] = true,
    ["DILETTANTE2"] = true,
    ["SURGE"] = true,
    ["TEZERACT"] = true,
    ["IMORGON"] = true,
    ["KHAMELION"] = true,
    ["VOLTIC"] = true,
    ["IWAGEN"] = true,
}

Custom Inventory Functions

Add Item Function

Example using ox_inventory to add petrol can:

function customInventoryAddItem(playerID, petrolcanPrice)
    local petrolCan = exports.ox_inventory:GetItem(source, 'WEAPON_PETROLCAN', false, true)
    if petrolCan ~= 0 then
        notifications(Noti.error, Lang.itemoninventory, Noti.time)
    else
        local canCarry = exports.ox_inventory:CanCarryItem(source, 'WEAPON_PETROLCAN', 1)
        if canCarry then
            exports.ox_inventory:AddItem(source, 'WEAPON_PETROLCAN', 1)
            notifications(Noti.success, Lang.okpetrolcan..petrolcanPrice, Noti.time)
        else
            notifications(Noti.error, Lang.nospace, Noti.time)
        end
    end
end

Remove Item Function

Example using ox_inventory to remove petrol can:

function customInventoryRemoveItem(playerID)
    local petrolCan = exports.ox_inventory:GetItem(source, 'WEAPON_PETROLCAN', false, true)
    if petrolCan ~= 0 then
        exports.ox_inventory:RemoveItem(source, 'WEAPON_PETROLCAN', 1)
    end
end

[!NOTE] Modify these functions to match your inventory system (QS-Inventory, ESX default, or custom)