> For the complete documentation index, see [llms.txt](https://docs.ak4y.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ak4y.com/scripts/ak4y-usedcarshop/configuration.md).

# Configuration

```lua
Config = {}

Config.locales = {}

Config.Locale = "en" -- [LANGUAGE] The active translation locale selected from the 'locales/' directory (e.g., 'en', 'tr', 'de', etc.)

Config.DefaultRoutingBucket = 0 -- [ROUTING] The default routing bucket ID for players and showroom vehicles when outside showroom sessions or test drive instances.

Config.BackEngineVehicles = {
    ["comet2"] = true,
    ["comet3"] = true,
    ["comet4"] = true,
    ["comet5"] = true,
    ["comet6"] = true,
    ["pfister811"] = true,
    ["neon"] = true,
    ["turismo2"] = true,
    ["turismo3"] = true,
    ["cheetah"] = true,
    ["cheetah2"] = true,
    ["tempesta"] = true,
    ["zentorno"] = true,
    ["vacca"] = true,
    ["infernus"] = true,
    ["infernus2"] = true,
    ["bullet"] = true,
    ["voltic"] = true,
    ["rocketvoltic"] = true,
    ["t20"] = true,
    ["osiris"] = true,
    ["fmj"] = true,
    ["nero"] = true,
    ["nero2"] = true,
    ["progengp1"] = true,
    ["tyrant"] = true,
    ["xa21"] = true,
    ["sc1"] = true,
    ["tezeract"] = true,
    ["autarch"] = true,
    ["taipan"] = true,
    ["entity2"] = true,
    ["entityxf"] = true,
    ["adder"] = true,
    ["vagner"] = true,
    ["reaper"] = true,
    ["furia"] = true,
    ["krieger"] = true,
    ["emerus"] = true,
    ["sultan2"] = true,
    ["banshee2"] = true,
    ["panthere"] = true,
    ["corsita"] = true,
    ["torero"] = true,
    ["torero2"] = true,
    ["ignus"] = true,
    ["ignus2"] = true,
    ["zorrusso"] = true,
    ["panto"] = true,
    ["bifta"] = true,
    ["raptor"] = true,
    ["italirsx"] = true,
    ["tenf"] = true,
}

Config.TestMode = true -- [DEVELOPMENT] Enables developer/test mode. Set to true if you are restarting the script frequently during live testing to avoid requiring players to relog to reload their UI/data cache.

Config.ShowroomPlateText = "FOR SALE"

Config.Shops = {
    [1] = {
        name = "Shop 1",
        location = "Los Santos bla bla",
        shopPrice = 1000000,
        blip = {
            enabled = true,
            blip = 408,
            sprite = 225,
            blipColor = 15,
            blipScale = 0.9,
            blipText = "Used Car Shop"
        },
        coords = vec4(674.61, 224.95, 93.09, 338.65),
        pedModel = "s_m_m_highsec_01",
        carSlots = {
            [1] = {
                coord = vec4(665.75, 234.24, 92.56, 240.98),
                isOccupied = false,
                vehicle = nil,
            },
            [2] = {
                coord = vec4(667.4, 237.08, 92.45, 240.01),
                isOccupied = false,
                vehicle = nil,
            },
            [3] = {
                coord = vec4(669.3, 239.59, 92.39, 241.96),
                isOccupied = false,
                vehicle = nil,
            },
            [4] = {
                coord = vec4(670.82, 242.3, 92.34, 239.9),
                isOccupied = false,
                vehicle = nil,
            },
            [5] = {
                coord = vec4(672.57, 245.13, 92.28, 239.71),
                isOccupied = false,
                vehicle = nil,
            },
            [6] = {
                coord = vec4(673.99, 247.99, 92.22, 242.24),
                isOccupied = false,
                vehicle = nil,
            },
            [7] = {
                coord = vec4(675.57, 250.61, 92.16, 238.87),
                isOccupied = false,
                vehicle = nil,
            },
            [8] = {
                coord = vec4(677.27, 253.52, 92.1, 240.38),
                isOccupied = false,
                vehicle = nil,
            },
            [9] = {
                coord = vec4(678.81, 256.05, 92.05, 238.24),
                isOccupied = false,
                vehicle = nil,
            },
            [10] = {
                coord = vec4(680.44, 258.97, 91.98, 240.76),
                isOccupied = false,
                vehicle = nil,
            },
            [11] = {
                coord = vec4(681.97, 261.87, 91.92, 241.25),
                isOccupied = false,
                vehicle = nil,
            },
            [12] = {
                coord = vec4(683.52, 264.59, 91.86, 238.04),
                isOccupied = false,
                vehicle = nil,
            },
            [13] = {
                coord = vec4(685.1, 267.39, 91.81, 240.87),
                isOccupied = false,
                vehicle = nil,
            },
            [14] = {
                coord = vec4(686.69, 270.3, 91.75, 239.11),
                isOccupied = false,
                vehicle = nil,
            },
            [15] = {
                coord = vec4(696.97, 260.37, 91.76, 61.17),
                isOccupied = false,
                vehicle = nil,
            },
            [16] = {
                coord = vec4(695.45, 257.64, 91.8, 59.94),
                isOccupied = false,
                vehicle = nil,
            },
            [17] = {
                coord = vec4(693.8, 254.88, 91.84, 59.32),
                isOccupied = false,
                vehicle = nil,
            },
            [18] = {
                coord = vec4(692.25, 252.15, 91.88, 59.47),
                isOccupied = false,
                vehicle = nil,
            },
            [19] = {
                coord = vec4(690.56, 249.45, 91.92, 59.56),
                isOccupied = false,
                vehicle = nil,
            },
            [20] = {
                coord = vec4(688.99, 246.51, 91.96, 61.32),
                isOccupied = false,
                vehicle = nil,
            },
            [21] = {
                coord = vec4(687.49, 243.76, 92.0, 59.98),
                isOccupied = false,
                vehicle = nil,
            },
            [22] = {
                coord = vec4(685.94, 240.89, 92.04, 59.65),
                isOccupied = false,
                vehicle = nil,
            },
            [23] = {
                coord = vec4(684.25, 238.15, 92.08, 58.81),
                isOccupied = false,
                vehicle = nil,
            },
            [24] = {
                coord = vec4(690.78, 234.49, 91.48, 239.56),
                isOccupied = false,
                vehicle = nil,
            },
            [25] = {
                coord = vec4(692.48, 237.38, 91.5, 242.31),
                isOccupied = false,
                vehicle = nil,
            },
            [26] = {
                coord = vec4(694.07, 240.1, 91.51, 239.79),
                isOccupied = false,
                vehicle = nil,
            },
            [27] = {
                coord = vec4(695.44, 242.86, 91.53, 239.58),
                isOccupied = false,
                vehicle = nil,
            },
            [28] = {
                coord = vec4(697.01, 245.76, 91.55, 238.19),
                isOccupied = false,
                vehicle = nil,
            },
            [29] = {
                coord = vec4(698.8, 248.31, 91.55, 241.6),
                isOccupied = false,
                vehicle = nil,
            },
            [30] = {
                coord = vec4(700.54, 251.17, 91.57, 239.38),
                isOccupied = false,
                vehicle = nil,
            },
            [31] = {
                coord = vec4(701.9, 253.99, 91.6, 241.8),
                isOccupied = false,
                vehicle = nil,
            },
            [32] = {
                coord = vec4(703.63, 256.73, 91.61, 241.0),
                isOccupied = false,
                vehicle = nil,
            },
            [33] = {
                coord = vec4(716.83, 252.56, 91.52, 60.36),
                isOccupied = false,
                vehicle = nil,
            },
            [34] = {
                coord = vec4(715.24, 249.98, 91.46, 58.07),
                isOccupied = false,
                vehicle = nil,
            },
            [35] = {
                coord = vec4(713.62, 247.18, 91.39, 60.81),
                isOccupied = false,
                vehicle = nil,
            },
            [36] = {
                coord = vec4(712.1, 244.23, 91.32, 59.24),
                isOccupied = false,
                vehicle = nil,
            },
            [37] = {
                coord = vec4(710.57, 241.62, 91.26, 61.46),
                isOccupied = false,
                vehicle = nil,
            },
            [38] = {
                coord = vec4(708.81, 238.89, 91.19, 60.5),
                isOccupied = false,
                vehicle = nil,
            },
            [39] = {
                coord = vec4(707.35, 236.09, 91.12, 60.67),
                isOccupied = false,
                vehicle = nil,
            },
            [40] = {
                coord = vec4(705.67, 233.33, 91.06, 57.9),
                isOccupied = false,
                vehicle = nil,
            },
            [41] = {
                coord = vec4(702.44, 227.76, 90.92, 58.11),
                isOccupied = false,
                vehicle = nil,
            },
            [42] = {
                coord = vec4(700.92, 225.02, 90.86, 61.97),
                isOccupied = false,
                vehicle = nil,
            },
            [43] = {
                coord = vec4(699.31, 222.2, 90.79, 59.34),
                isOccupied = false,
                vehicle = nil,
            }
        }
    }
}

Config.CanSellVehicleWithoutOwner = true -- [COMMERCE] If set to true, players are allowed to put up their vehicles for sale even if the shop has no owner.
Config.CanBuyShops = true -- [COMMERCE] Enables or disables the ability for players to purchase used car dealership shops.
Config.OwnerlessShopCommissionPercent = 20 -- [COMMERCE] The tax/commission percentage deducted from vehicle sales if the shop is ownerless.

Config.PhotoUpload = { -- [PHOTO UPLOAD] Configuration for uploading vehicle listing photos taken by players.
    provider = "discord", -- The upload service provider: 'discord' (webhook) or 'fivemanage'.
    discordWebhook = "https://discord.com/api/webhooks/1407668529603543154/K-lIDR7lQPcK1HTrPFBAPLqgp9Lz59KVB_XoIkznMVDr9OCOf0rR_sk8Vc-lb2Yj2DQH", -- Discord webhook URL for saving uploaded photos.
    fivemanageApiKey = "", -- API key if using FiveManage.
    fivemanageEndpoint = "https://api.fivemanage.com/api/image", -- Endpoint URL for FiveManage.
}

Config.TestDrive = { -- [TEST DRIVE] Configuration for the test drive feature.
    coord = vec4(-1620.71, -2979.79, 12.94, 239.54) -- Coordinates where the test drive vehicle is spawned.
}

Config.ListingExpiryDays = 7 -- [EXPIRATION] Number of days a listed vehicle remains in the showroom. If the vehicle is not sold or modified within this duration, it automatically expires and is returned to the owner's garage database. Set to 0 or false to disable auto-expiry entirely.
Config.ListingCleanupIntervalMs = 60 * 60 * 1000 -- [CLEANUP] Interval (in milliseconds) at which the server runs the background garbage-collection routine to scan for, process, and clean up expired vehicle listings (defaults to 1 hour).
Config.PromotionPrice = 5000 -- [PROMOTION] Cost in dollars ($) paid by a seller to promote their vehicle listing. Promoted vehicle listings are pinned to the absolute top of the dealership browse page with a sponsored golden badge.


function getLocale(index, key)
    local pack = Config.locales[Config.Locale]
    if type(pack) ~= "table" then
        return key
    end
    local section = pack[index]
    if type(section) ~= "table" then
        return key
    end
    local v = section[key]
    if v == nil or v == "" then
        return key
    end
    return v
end
```
