Config

You can check out default config

cfg = {}

cfg.Language = "en"

cfg.PlatePackageId = 0
cfg.ActionCooldown = 2500
cfg.showDistance = true
cfg.DistanceUnit = "KM" -- "KM" - Kilometers, "M" - Miles
cfg.FuelUnit = "L" -- "L" - Liters, "GAL" - Galons
cfg.MaximumSharedKeys = 5
cfg.MaximumSpawnedVehicles = 3
cfg.MaximumPlateLetters = 8

cfg.Commands = {
    convert = {name = "convertVehicles", group = "admin"},
    createVoucher = {name = "createVoucher", group = "admin"},
    garage = {name = "garage", group = nil, job = nil}, -- or Client-Side Event: is_garage:showInterface
    towing = {name = "towing", group = nil, job = {"police", "mechanic"}}, -- or Client-Side Event: is_garage:towVehicle
}

cfg.VehicleTypes = {
    [0] = "automobile", -- Compacts  
    [1] = "automobile", -- Sedans  
    [2] = "automobile", -- SUVs  
    [3] = "automobile", -- Coupes  
    [4] = "automobile", -- Muscle  
    [5] = "automobile", -- Sports Classics  
    [6] = "automobile", -- Sports  
    [7] = "automobile", -- Super  
    [8] = "bike", -- Motorcycles  
    [9] = "automobile", -- Off-road  
    [10] = "automobile", -- Industrial  
    [11] = "automobile", -- Utility  
    [12] = "automobile", -- Vans  
    [13] = "bike", -- Cycles  
    [14] = "boat", -- Boats  
    [15] = "heli", -- Helicopters  
    [16] = "plane", -- Planes  
    [17] = "automobile", -- Service  
    [18] = "automobile", -- Emergency  
    [19] = "automobile", -- Military  
    [20] = "automobile", -- Commercial  
    [21] = nil, -- Trains  
    [22] = "automobile", -- Open Wheel
}

cfg.CustomVehicles = {
    [-1032122474] = { -- vehicle hash
        model = "benze55", -- model name
        name = "Mercedes E55 AMG", -- display name
        class = 1, -- vehicle class (Sedans)
        image = {
            src = "images/e55amg.png", -- image path source
            -- src = "https://w7.pngwing.com/pngs/291/323/png-transparent-2009-mercedes-benz-e-class-2009-mercedes-benz-clk-class-2003-mercedes-benz-e-class-car-benz-compact-car-sedan-car.png", -- image path url
            size = 85, -- image size
        },
    },
}

cfg.Impound = {
    vehicle = {
        ["Los Santos Vehicle Impound Lot"] = {
            DailyParkingCharge = 200,
            places = {
                vector4(417.39, -1627.53, 28.67, 320.87),
                vector4(419.88, -1629.35, 28.66, 319.47),
                vector4(421.03, -1635.86, 28.66, 269.21),
                vector4(421.12, -1638.91, 28.67, 269.53),
                vector4(421.18, -1641.96, 28.66, 268.66),
                vector4(418.74, -1646.57, 28.66, 229.51),
                vector4(410.39, -1656.88, 28.67, 140.25),
                vector4(407.91, -1654.99, 28.67, 140.19),
                vector4(405.36, -1652.89, 28.67, 140.36),
                vector4(402.84, -1651.01, 28.67, 140.54),
                vector4(400.47, -1649.06, 28.67, 141.04),
                vector4(398.13, -1646.95, 28.66, 139.84),
                vector4(395.63, -1645.03, 28.67, 139.63),
            },
        },
    },
    plane = {
        ["Los Santos Aircraft Impound Yard"] = {
            DailyParkingCharge = 500,
            places = {
                vector4(-1295.54, -3396.21, 14.87, 330.11),
                vector4(-1281.35, -3404.43, 14.87, 329.87),
                vector4(-1268.25, -3412.91, 14.89, 322.95),
            },
        },
    },
    helicopter = {
        ["Los Santos Helicopter Impound Pad"] = {
            DailyParkingCharge = 400,
            places = {
                vector4(-1646.56, -3133.02, 13.37, 330.02),
                vector4(-1667.8, -3137.78, 13.37, 271.75),
                vector4(-1643.82, -3154.54, 13.36, 20.87),
            },
        },
    },
    boat = {
        ["Los Santos Boat Impound Dock"] = {
            DailyParkingCharge = 300,
            places = {
                vector4(-791.51, -1447.85, 0.3, 143.0),
                vector4(-783.19, -1437.58, 0.29, 141.25),
                vector4(-773.88, -1427.33, 0.3, 138.8),
            },
        },
    },
}

cfg.DefaultSpawn = {
    vehicle = {
        vector4(21.02, -876.01, 29.68, 339.16),
        vector4(19.34, -880.63, 29.6, 338.95),
        vector4(22.64, -881.82, 29.6, 341.58),
        vector4(24.23, -877.26, 29.67, 340.0),
        vector4(25.85, -883.15, 29.59, 340.77),
        vector4(27.56, -878.38, 29.67, 339.33),
        vector4(38.02, -887.52, 29.57, 339.61),
        vector4(39.69, -882.96, 29.64, 339.1),
        vector4(41.42, -888.72, 29.56, 339.94),
        vector4(43.05, -884.24, 29.63, 340.01),
        vector4(44.57, -889.87, 29.55, 339.9),
        vector4(46.24, -885.32, 29.62, 339.93),
        vector4(47.86, -891.15, 29.54, 340.58),
        vector4(49.53, -886.53, 29.61, 339.79),
        vector4(51.13, -892.24, 29.54, 340.39),
        vector4(52.75, -887.77, 29.61, 339.68),
    },
    plane = {
        vector4(-907.55, -3196.37, 14.59, 59.58),
        vector4(-952.48, -3170.17, 14.58, 59.83),
        vector4(-1002.18, -3141.44, 14.58, 60.13),
    },
    helicopter = {
        vector4(-745.52, -1468.65, 4.39, 319.23),
        vector4(-724.91, -1444.43, 4.39, 321.33),
        vector4(-701.34, -1447.04, 4.39, 226.7),
        vector4(-745.52, -1433.77, 4.39, 139.02),
        vector4(-762.19, -1453.86, 4.39, 140.16),
        vector4(-722.46, -1472.54, 4.39, 230.49),
    },
    boat = {
        vector4(-762.49, -1372.45, -0.1, 227.65),
        vector4(-767.2, -1377.54, -0.11, 228.4),
        vector4(-769.85, -1379.52, -0.05, 231.95),
        vector4(-773.47, -1383.81, -0.13, 231.56),
    },
}

function clientNotify(message, duration, style)
    if GetResourceState("is_ui") == "started" then
        exports["is_ui"]:Notify(false, message, duration, style)
    elseif GetResourceState("qb-core") == "started" then
        if style == "info" then style = "primary" end

        TriggerEvent("QBCore:Notify", message, style, duration)
    elseif GetResourceState("es_extended") == "started" then
        TriggerEvent("esx:showNotification", message, style, duration)
    else
        print("No notifications detected, set them in config.lua")
    end
end

function serverNotify(source, message, duration, style)
    if GetResourceState("is_ui") == "started" then
        TriggerClientEvent("is_ui:Notify", source, false, message, duration, style)
    elseif GetResourceState("qb-core") == "started" then
        if style == "info" then style = "primary" end
        
        TriggerClientEvent("QBCore:Notify", source, message, style, duration)
    elseif GetResourceState("es_extended") == "started" then
        TriggerClientEvent("esx:showNotification", source, message, style, duration)
    else
        print("No notifications detected, set them in config.lua")
    end
end

translations = json.decode(LoadResourceFile(GetCurrentResourceName(), "locales/"..cfg.Language..".json"))
translations = translations.lua

function translate(key)
    if translations[key] then
        return translations[key]
    else
        return print("Something went wrong with translations")
    end
end

Last updated