Configs, Locales & SQL

Codesign resources contain various editable/unobscured files such as client/server functions etc.

Config = {}
function L(cd) if Locales[Config.Language][cd] then return Locales[Config.Language][cd] else print('Locale is nil ('..cd..')') end end
--███████╗██████╗  █████╗ ███╗   ███╗███████╗██╗    ██╗ ██████╗ ██████╗ ██╗  ██╗
--██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██║    ██║██╔═══██╗██╔══██╗██║ ██╔╝
--█████╗  ██████╔╝███████║██╔████╔██║█████╗  ██║ █╗ ██║██║   ██║██████╔╝█████╔╝ 
--██╔══╝  ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝  ██║███╗██║██║   ██║██╔══██╗██╔═██╗ 
--██║     ██║  ██║██║  ██║██║ ╚═╝ ██║███████╗╚███╔███╔╝╚██████╔╝██║  ██║██║  ██╗
--╚═╝     ╚═╝  ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝╚══════╝ ╚══╝╚══╝  ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝


--WHAT DOES 'auto_detect' DO?
--The 'auto_detect' feature automatically identifies your framework, notifications resource and SQL database resource, and applies the appropriate default settings.

Config.Framework = 'auto_detect' --[ 'auto_detect' / 'other' ]   If you select 'auto_detect', only ESX and QBCore frameworks will be detected. Use 'other' for custom frameworks.
Config.Database = 'auto_detect' --[ 'auto_detect' ]   If you select 'auto_detect', only MySQL, GHMattimysql, and Oxmysql SQL database resources will be detected.
Config.AutoInsertSQL = false --Would you like the script to insert the necessary SQL tables into your database automatically? If you have already done this, please set it to false.
Config.Notification = 'esx' --[ 'auto_detect' / 'other' ]   If you select 'auto_detect', only ESX, QBCore, cd_notifications, okokNotify, ps-ui and ox_lib notifications will be detected. Use 'other' for custom notification resources.
Config.Language = 'EN' --[ 'EN' ]   You can add your own locales to locales.lua, but be sure to update the Config.Language to match it.

Config.FrameworkTriggers = {
    esx = { --If you have modified the default event names in the [es_extended] resource, change them here.
        resource_name = 'es_extended',
        main = 'esx:getSharedObject',
        load = 'esx:playerLoaded',
        job = 'esx:setJob'
    },
    qbcore = { --If you have modified the default event names in the [qb-core] resource, change them here.
        resource_name = 'qb-core',
        main = 'QBCore:GetObject',
        load = 'QBCore:Client:OnPlayerLoaded',
        job = 'QBCore:Client:OnJobUpdate',
        gang = 'QBCore:Client:OnGangUpdate',
        duty = 'QBCore:Client:SetDuty'
    }
}


--██╗███╗   ███╗██████╗  ██████╗ ██████╗ ████████╗ █████╗ ███╗   ██╗████████╗
--██║████╗ ████║██╔══██╗██╔═══██╗██╔══██╗╚══██╔══╝██╔══██╗████╗  ██║╚══██╔══╝
--██║██╔████╔██║██████╔╝██║   ██║██████╔╝   ██║   ███████║██╔██╗ ██║   ██║   
--██║██║╚██╔╝██║██╔═══╝ ██║   ██║██╔══██╗   ██║   ██╔══██║██║╚██╗██║   ██║   
--██║██║ ╚═╝ ██║██║     ╚██████╔╝██║  ██║   ██║   ██║  ██║██║ ╚████║   ██║   
--╚═╝╚═╝     ╚═╝╚═╝      ╚═════╝ ╚═╝  ╚═╝   ╚═╝   ╚═╝  ╚═╝╚═╝  ╚═══╝   ╚═╝


Config.IdentifierType = 'license' --[ 'license' / 'steam' ] Choose the identifier type that your server uses.
Config.PlateFormats = 'mixed' --[ 'trimmed' /  'with_spaces' / 'mixed' ] CHOOSE CAREFULLY! Read our documentation website for more info on this if you are unsure! [https://docs.codesign.pro/paid-scripts/garage#step-6-vehicle-plate-format].
Config.NewPlateFormat = 'AAAA1111' --Customise the plate formats of newly purchased vehicles. ['A'] = Random Letter, ['1'] = Random Number, [' '] = Whitespace, ['-'] = Dash. Maximun length is 8 including symbols and whitespaces.
Config.Debug = false --To enable debug prints.


--███╗   ███╗ █████╗ ██╗███╗   ██╗
--████╗ ████║██╔══██╗██║████╗  ██║
--██╔████╔██║███████║██║██╔██╗ ██║
--██║╚██╔╝██║██╔══██║██║██║╚██╗██║
--██║ ╚═╝ ██║██║  ██║██║██║ ╚████║
--╚═╝     ╚═╝╚═╝  ╚═╝╚═╝╚═╝  ╚═══╝


Config.PurchaseCommand = 'tebex_purchase' --DONT CHANGE IF YOU DON'T KNOW WHAT YOU ARE DOING. This is the command for the tebex transactions.
Config.BlacklistedWords = {'changeme', 'changeme'} --If a word from a plate change/character name change contains a blacklisted word the transaction will be canceled.
Config.cd_multicharacter_maxslots = 6 --If you are using the using the Codesign Multicharacter script, what is the maximum amount of character slots you will allow vip's to have?


--████████╗███████╗██████╗ ███████╗██╗  ██╗    ██╗    ██╗███████╗██████╗ ███████╗██╗████████╗███████╗    ██████╗ ██████╗  ██████╗ ██████╗ ██╗   ██╗ ██████╗████████╗███████╗
--╚══██╔══╝██╔════╝██╔══██╗██╔════╝╚██╗██╔╝    ██║    ██║██╔════╝██╔══██╗██╔════╝██║╚══██╔══╝██╔════╝    ██╔══██╗██╔══██╗██╔═══██╗██╔══██╗██║   ██║██╔════╝╚══██╔══╝██╔════╝
--   ██║   █████╗  ██████╔╝█████╗   ╚███╔╝     ██║ █╗ ██║█████╗  ██████╔╝███████╗██║   ██║   █████╗      ██████╔╝██████╔╝██║   ██║██║  ██║██║   ██║██║        ██║   ███████╗
--   ██║   ██╔══╝  ██╔══██╗██╔══╝   ██╔██╗     ██║███╗██║██╔══╝  ██╔══██╗╚════██║██║   ██║   ██╔══╝      ██╔═══╝ ██╔══██╗██║   ██║██║  ██║██║   ██║██║        ██║   ╚════██║
--   ██║   ███████╗██████╔╝███████╗██╔╝ ██╗    ╚███╔███╔╝███████╗██████╔╝███████║██║   ██║   ███████╗    ██║     ██║  ██║╚██████╔╝██████╔╝╚██████╔╝╚██████╗   ██║   ███████║
--   ╚═╝   ╚══════╝╚═════╝ ╚══════╝╚═╝  ╚═╝     ╚══╝╚══╝ ╚══════╝╚═════╝ ╚══════╝╚═╝   ╚═╝   ╚══════╝    ╚═╝     ╚═╝  ╚═╝ ╚═════╝ ╚═════╝  ╚═════╝  ╚═════╝   ╚═╝   ╚══════╝


Config.TebexListings = { --These are the products that you will list for sale on your tebex website.
    {
        ProductName = 'Bronze Package', --You can change this, but this ProductName must be identical to the name of the product on your tebex website.
        Amount = 10, --This is the amount of vip tokens the player will recieve when he purchases this product (you can change this).
    },
    {
        ProductName = 'Silver Package',
        Amount = 20,
    },
    {
        ProductName = 'Gold Package',
        Amount = 30,
    },
    {
        ProductName = 'Platinum Package',
        Amount = 40,
    },
    -- {
    --     ProductName = 'ADD_MORE_PRODUCTS_HERE',
    --     Amount = 50,
    -- },
}


--███╗   ███╗ █████╗ ██╗███╗   ██╗    ██╗      ██████╗  ██████╗ █████╗ ████████╗██╗ ██████╗ ███╗   ██╗███████╗
--████╗ ████║██╔══██╗██║████╗  ██║    ██║     ██╔═══██╗██╔════╝██╔══██╗╚══██╔══╝██║██╔═══██╗████╗  ██║██╔════╝
--██╔████╔██║███████║██║██╔██╗ ██║    ██║     ██║   ██║██║     ███████║   ██║   ██║██║   ██║██╔██╗ ██║███████╗
--██║╚██╔╝██║██╔══██║██║██║╚██╗██║    ██║     ██║   ██║██║     ██╔══██║   ██║   ██║██║   ██║██║╚██╗██║╚════██║
--██║ ╚═╝ ██║██║  ██║██║██║ ╚████║    ███████╗╚██████╔╝╚██████╗██║  ██║   ██║   ██║╚██████╔╝██║ ╚████║███████║
--╚═╝     ╚═╝╚═╝  ╚═╝╚═╝╚═╝  ╚═══╝    ╚══════╝ ╚═════╝  ╚═════╝╚═╝  ╚═╝   ╚═╝   ╚═╝ ╚═════╝ ╚═╝  ╚═══╝╚══════╝


Config.InteriorType = 'ipl' --[ 'ipl' / 'mlo' ] Choose the type of interior you would like to use. ['ipl'] will teleport you into the ipl, ['mlo'] will not teleport you as the mlo can be walked into.
Config.Locations = {
    ['ipl'] = {
        {coords = vector4(-1394.81, -3265.03, 13.93, 339.85),  distance = 10.0, event_name = 'cd_vipshop:Enter', text = L('enter')}, --The entrance to the vip shop.
        {coords = vector4(-1266.89, -2965.47, -48.48, 179.08), distance = 10.0, event_name = 'cd_vipshop:Exit',  text = L('exit')}, --The exit to the vuip shop.
        {coords = vector4(-1246.55, -2984.19, -48.49, 0.0),    distance = 10.0, event_name = 'cd_vipshop:Menu',  text = L('menu')} --The main vip shop UI.
    },

    ['mlo'] = {
        {coords = vector4(-1246.55, -2984.19, -48.49, 0.0), distance = 10.0, event_name = 'cd_vipshop:Menu',  text = L('menu')} --The main vip shop UI.
    }
}


-- ██████╗██╗  ██╗ █████╗ ████████╗     ██████╗ ██████╗ ███╗   ███╗███╗   ███╗ █████╗ ███╗   ██╗██████╗ ███████╗
--██╔════╝██║  ██║██╔══██╗╚══██╔══╝    ██╔════╝██╔═══██╗████╗ ████║████╗ ████║██╔══██╗████╗  ██║██╔══██╗██╔════╝
--██║     ███████║███████║   ██║       ██║     ██║   ██║██╔████╔██║██╔████╔██║███████║██╔██╗ ██║██║  ██║███████╗
--██║     ██╔══██║██╔══██║   ██║       ██║     ██║   ██║██║╚██╔╝██║██║╚██╔╝██║██╔══██║██║╚██╗██║██║  ██║╚════██║
--╚██████╗██║  ██║██║  ██║   ██║       ╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚═╝ ██║██║  ██║██║ ╚████║██████╔╝███████║
-- ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝   ╚═╝        ╚═════╝ ╚═════╝ ╚═╝     ╚═╝╚═╝     ╚═╝╚═╝  ╚═╝╚═╝  ╚═══╝╚═════╝ ╚══════╝


Config.RedeemCommand = 'redeem' --The command players who have purchased items on tebex can use to redeem their purchase in-game.

Config.StaffCommands = {
    VIP_Balance = {
        ENABLE = true, --Do you want to allow staff to modify a players VIP balance?
        add = 'viptokens_add', --The staff command to manually add tokens to a players VIP balance.
        remove = 'viptokens_remove', --The staff command to manually remove tokens to a players VIP balance.
        check = 'viptokens_check', --The staff command to check a players VIP balance.
    },

    Perms = {
        ['esx'] = {'superadmin', 'admin'},
        ['qbcore'] = {'god', 'admin'},
        ['other'] = {'change_me'}
    }
}


--██╗   ██╗███████╗██╗  ██╗██╗ ██████╗██╗     ███████╗███████╗
--██║   ██║██╔════╝██║  ██║██║██╔════╝██║     ██╔════╝██╔════╝
--██║   ██║█████╗  ███████║██║██║     ██║     █████╗  ███████╗
--╚██╗ ██╔╝██╔══╝  ██╔══██║██║██║     ██║     ██╔══╝  ╚════██║
-- ╚████╔╝ ███████╗██║  ██║██║╚██████╗███████╗███████╗███████║
--  ╚═══╝  ╚══════╝╚═╝  ╚═╝╚═╝ ╚═════╝╚══════╝╚══════╝╚══════╝


Config.VehiclePurchaseCoords = vector4(-1394.81, -3265.03, 13.93, 339.85) --This is the location where your vehicle will spawn after you purchase or test drive a display vehicle.
Config.VehicleStock = true --Do you want to limit the amount of VIP vehicles that can be purchased?

Config.DisplayVehicles = {
    ENABLE = true, --Do you want to display purchasable vehicles in the vip shop?

    RandomizeVehicles = {
        ENABLE = false, --Do you want the display vehicles to be randomly changed after x amount of minutes?
        display_vehicle_count = 5, --How many vehicles do you want to be on display?
        display_vehicle_timer = 1 --(in minutes) How often do you want the display vehicles to be changed?
    },

    VehicleTest = {
        ENABLE = true, --Do you want players to be able to test drive vehicles?
        check_balance = false, --Should players be required to have sufficient funds to purchase the vehicle they wish to test drive?
        spawn_max = true, --Do you want the vehicles to spawn with max performance upgrades?
        timer = 30 --(in seconds) How long does the player have to test drive the vehicle?
    },
    
    Vehicles = {
        --model = The spawn name of a vehicle.
        --label = The name of the vehicle that will be displayed on the UI.
        --garage_type = The garage type ('car' / 'boat' / 'air').
        --vip_price = The amount of vip tokens the vehicle will cost.
        --bank_price = The amount of in-game $ from your bank balance the vehicle will cost.
        --description = The description displayed on the UI.
        --sale = Is this product on sale? (will display a 'sale' tag on the product).
        [1] =  {model = 'adder',    label = 'Adder',    garage_type = 'car', vip_price = 20, bank_price = 100, sale = {ENABLED = true, vip = 10, bank = 50}, description = 'What colour is your bugatti'},
        [2] =  {model = 'rebel',    label = 'Rebel',    garage_type = 'car', vip_price = 20, bank_price = 100, sale = {ENABLED = false, vip = 10, bank = 50}, description = 'Mericaaaa'},
        [3] =  {model = 'sultan',   label = 'Sultan',   garage_type = 'car', vip_price = 20, bank_price = 100, sale = {ENABLED = false, vip = 10, bank = 50}, description = 'Getaway driverrr'},
        [4] =  {model = 'vagner',   label = 'Vagner',   garage_type = 'car', vip_price = 20, bank_price = 100, sale = {ENABLED = false, vip = 10, bank = 50}, description = 'TRUMP 4 PRESIDENT'},
        [5] =  {model = 'sanchez',  label = 'Sanchez',  garage_type = 'car', vip_price = 20, bank_price = 100, sale = {ENABLED = false, vip = 10, bank = 50}, description = '2 wheels > 4'},
        [6] =  {model = 'alpha',    label = 'Alpha',    garage_type = 'car', vip_price = 20, bank_price = 100, sale = {ENABLED = false, vip = 10, bank = 50}, description = 'Im a long boi'},
        [7] =  {model = 'cyclone',  label = 'Cyclone',  garage_type = 'car', vip_price = 20, bank_price = 100, sale = {ENABLED = false, vip = 10, bank = 50}, description = 'Greta Thunberg...'},
        [8] =  {model = 'bf400',    label = 'BF 400',   garage_type = 'car', vip_price = 20, bank_price = 100, sale = {ENABLED = false, vip = 10, bank = 50}, description = 'i own the road'},
        [9] =  {model = 'tezeract', label = 'Tezeract', garage_type = 'car', vip_price = 20, bank_price = 100, sale = {ENABLED = false, vip = 10, bank = 50}, description = 'Elon 2 the MOON'},
        [10] = {model = 'taipan',   label = 'Taipan',   garage_type = 'car', vip_price = 20, bank_price = 100, sale = {ENABLED = false, vip = 10, bank = 50}, description = 'big pepe'},
        --[11] = {model = 'CHANGEME', label = 'CHANGEME', garage_type = 'car', vip_price = 20, bank_price = 100, sale = {ENABLED = false, vip = 10, bank = 50}, description = 'CHANGEME'},
    },

    vehicle_coords_method = 'automatically_set', --[ 'automatically_set' / 'manually_set' ] Do you want the dipslay vehicles to be placed automatically or manually? ['automatically_set'] will automatically place the vehicles around the 'automatically_set' coords below. ['manually_set'] will use the coords you have entered in 'manually_set' below.
    VehicleCoords = {
        ['automatically_set'] = vector4(-1266.83, -3013.54, -48.49, 180.0),
        ['manually_set'] = { --Make sure you add enough coordinates to match the amount of vehicles you have added above. If you are using the [RandomizeVehicles] feature make sure you have enough coordinates for amount of vehicles you have set to be on display in [display_vehicle_count].
            [1] =  vector4(0.0, 0.0, 0.0, 0.0),
            [2] =  vector4(0.0, 0.0, 0.0, 0.0),
            [3] =  vector4(0.0, 0.0, 0.0, 0.0),
            [4] =  vector4(0.0, 0.0, 0.0, 0.0),
            [5] =  vector4(0.0, 0.0, 0.0, 0.0),
            [6] =  vector4(0.0, 0.0, 0.0, 0.0),
            [7] =  vector4(0.0, 0.0, 0.0, 0.0),
            [8] =  vector4(0.0, 0.0, 0.0, 0.0),
            [9] =  vector4(0.0, 0.0, 0.0, 0.0),
            [10] = vector4(0.0, 0.0, 0.0, 0.0),
            --[11] = vector4(0.0, 0.0, 0.0, 0.0),
        }
    }
}

Config.DefaultVehicleProps = { --Set default props to be added to the database when a player purchases a vehicle. The plate and model will be added automatically.
    engineHealth = 1000.0,
    bodyHealth = 1000.0,
    fuelLevel = 100.0,
    modEngine = -1,
    modTransmission = -1,
    modSuspension = -1,
    modTurbo = false,
    modArmor = -1,
    modBrakes = -1,
    color1 = 0,
    color2 = 0,
    pearlescentColor = 0,
}


--███████╗██╗  ██╗ ██████╗ ██████╗     ██╗   ██╗██╗
--██╔════╝██║  ██║██╔═══██╗██╔══██╗    ██║   ██║██║
--███████╗███████║██║   ██║██████╔╝    ██║   ██║██║
--╚════██║██╔══██║██║   ██║██╔═══╝     ██║   ██║██║
--███████║██║  ██║╚██████╔╝██║         ╚██████╔╝██║
--╚══════╝╚═╝  ╚═╝ ╚═════╝ ╚═╝          ╚═════╝ ╚═╝


Config.Prop = { --The prop to mark the location where players can access the main shop UI.
    Model = 'xm_prop_base_staff_desk_01',
    Coords = vector4(-1242.32, -2988.77, -49.49, 180.0),
}

Config.Shop = {
    {
        --Product Display Info
        title = '10k Money',                                                -- Title - THIS MUST BE UNIQUE.
        category = 'money',                                                 -- The category this product will be displayed in.
        description = 'A briefcase with $10,000 cash inside',               -- Product description.
        image = 'money.png',                                                -- The display image (must be a .png and 512 x 512 size).
        is_new = false,                                                     -- Is this product new? (will display a 'new' tag on the product).
        --Input Field Details
        input_description = '1 = $10000',                                   -- The help text inside the input box.
        input_type = 'number',                                              -- DONT change this.
        min_length = 1,                                                     -- The minimum amount of characters required.
        max_length = 2,                                                     -- The max amount of characters allowed.
        pattern = '[^0-9]',                                                 -- DONT change this.
        --Purchase Details
        purchase_type = 'money',                                            -- DONT change this.
        purchase_price = {
            vip = 5,                                                        -- The amount of VIP tokens required to purchase 1 of these.
            bank = 100,                                                     -- The amount of $ in your in-game bank required to purchase 1 of these.
        },
        sale = {
            ENABLED = true,                                                -- Is this product on sale? (will display a 'sale' tag on the product).
            vip = 2.5,                                                      -- The amount of $ in your in-game bank required to purchase 1 of these.
            bank = 50                                                       -- The amount of VIP tokens required to purchase 1 of these.
        },
        amount = 10000                                                      -- The amount of money to add. (10000 would give the player $10,000 to their bank).
    },

    {
        --Product Display Info
        title = 'Gold Bars',                                                -- Title - THIS MUST BE UNIQUE.
        description = 'x5 Gold bars',                                       -- Product description.
        image = 'goldbar.png',                                              -- The display image (must be a .png and 512 x 512 size).
        is_new = false,                                                     -- Is this product new? (will display a 'new' tag on the product).
        --Input Field Details
        input_description = '1 = x5 items',                                 -- The help text inside the input box.
        input_type = 'number',                                              -- DONT change this.
        min_length = 1,                                                     -- The minimum amount of characters required.
        max_length = 2,                                                     -- The max amount of characters allowed.
        pattern = '[^0-9]',                                                 -- DONT change this.
        --Purchase Details
        purchase_type = 'item',                                             -- DONT change this.
        purchase_price = {
            vip = 5,                                                        -- The amount of VIP tokens required to purchase 1 of these.
            bank = 100,                                                     -- The amount of $ in your in-game bank required to purchase 1 of these.
        },
        sale = {
            ENABLED = false,                                                -- Is this product on sale? (will display a 'sale' tag on the product).
            vip = 2.5,                                                      -- The amount of $ in your in-game bank required to purchase 1 of these.
            bank = 50                                                       -- The amount of VIP tokens required to purchase 1 of these.
        },
        item_table = {                                                      -- The item(s) to give the player.
            {name = 'water', label = 'Gold Bar', amount = 5},
            {name = 'bread', label = 'Bread', amount = 5},
        }                    
    },

    {
        --Product Display Info
        title = 'Assault Rifle',                                            -- Title - THIS MUST BE UNIQUE.
        description = 'Carbine Rifle with 250 rounds of ammunition',        -- Product description.
        image = 'weapon.png',                                               -- The display image (must be a .png and 512 x 512 size).
        is_new = false,                                                     -- Is this product new? (will display a 'new' tag on the product).
        --Input Field Details
        input_description = '1 = x1 weapon with x250 ammo',                 -- The help text inside the input box.
        input_type = 'number',                                              -- DONT change this.
        min_length = 1,                                                     -- The minimum amount of characters required.
        max_length = 2,                                                     -- The max amount of characters allowed.
        pattern = '[^0-9]',                                                 -- DONT change this.
        --Purchase Details
        purchase_type = 'weapon',                                           -- DONT change this.
        purchase_price = {
            vip = 5,                                                        -- The amount of VIP tokens required to purchase 1 of these.
            bank = 100,                                                     -- The amount of $ in your in-game bank required to purchase 1 of these.
        },
        sale = {
            ENABLED = false,                                                -- Is this product on sale? (will display a 'sale' tag on the product).
            vip = 2.5,                                                      -- The amount of $ in your in-game bank required to purchase 1 of these.
            bank = 50                                                       -- The amount of VIP tokens required to purchase 1 of these.
        },
        weapon_table = {                                                    -- The weapon(s) to give the player.
            {name = 'WEAPON_CARBINERIFLE', label = 'Carbine Rifle', amount = 1, ammo = 250},
            {name = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, ammo = 250},
        }
    },

    {
        --Product Display Info
        title = 'Vehicle Pack',                                             -- Title - THIS MUST BE UNIQUE.
        description = 'Contains x1 adder, x1 golf cart and x1 jetski',      -- Product description.
        image = 'vehicle.png',                                              -- The display image (must be a .png and 512 x 512 size).
        is_new = false,                                                     -- Is this product new? (will display a 'new' tag on the product).
        --Input Field Details
        input_description = '1 = x1 vehicle pack',                          -- The help text inside the input box.
        input_type = 'number',                                              -- DONT change this.
        min_length = 1,                                                     -- The minimum amount of characters required.
        max_length = 2,                                                     -- The max amount of characters allowed.
        pattern = '[^0-9]',                                                 -- DONT change this.
        --Purchase Details
        purchase_type = 'vehicle',                                          -- DONT change this.
        purchase_price = {
            vip = 5,                                                        -- The amount of VIP tokens required to purchase 1 of these.
            bank = 100,                                                     -- The amount of $ in your in-game bank required to purchase 1 of these.
        },
        sale = {
            ENABLED = false,                                                -- Is this product on sale? (will display a 'sale' tag on the product).
            vip = 2.5,                                                      -- The amount of $ in your in-game bank required to purchase 1 of these.
            bank = 50                                                       -- The amount of VIP tokens required to purchase 1 of these.
        },
        vehicle_table = {                                                   -- Add the spawn name of the vehicles included in this vehicle pack to this table. Use the same format as the example.
            {model = 'adder', label = 'Adder', garage_type = 'car'},
            {model = 'seashark', label = 'Jet Ski', garage_type = 'boat'},
            {model = 'buzzard2', label = 'Golf Cart', garage_type = 'air'},
        }
    },

    {
        --Product Display Info
        title = 'Plate Change',                                             -- Title - THIS MUST BE UNIQUE.
        description = 'Buy a custom plate',                                 -- Product description.
        image = 'plate_change.png',                                         -- The display image (must be a .png and 512 x 512 size).
        is_new = false,                                                     -- Is this product new? (will display a 'new' tag on the product).
        --Input Field Details
        input_description = '8 characters long (including whitespaces)',    -- The help text inside the input box.
        input_type = 'pin',                                                 -- DONT change this.
        min_length = 1,                                                     -- The minimum amount of characters required.
        max_length = 8,                                                     -- The max amount of characters allowed.
        pattern = '[^a-zA-Z0-9]',                                           -- DONT change this.
        --Purchase Details
        purchase_type = 'plate_change',                                     -- DONT change this.
        purchase_price = {
            vip = 5,                                                        -- The amount of VIP tokens required to purchase 1 of these.
            bank = 100,                                                     -- The amount of $ in your in-game bank required to purchase 1 of these.
        },
        sale = {
            ENABLED = false,                                                -- Is this product on sale? (will display a 'sale' tag on the product).
            vip = 2.5,                                                      -- The amount of $ in your in-game bank required to purchase 1 of these.
            bank = 50                                                       -- The amount of VIP tokens required to purchase 1 of these.
        },
    },

    {
        --Product Display Info
        title = 'Phone Number',                                             -- Title - THIS MUST BE UNIQUE.
        description = 'Buy a custom phone number',                          -- Product description.
        image = 'phone_number.png',                                         -- The display image (must be a .png and 512 x 512 size).
        is_new = false,                                                     -- Is this product new? (will display a 'new' tag on the product).
        --Input Field Details
        input_description = 'Enter a number between 1-8 characters',        -- The help text inside the input box.
        input_type = 'pin',                                                 -- DONT change this.
        min_length = 1,                                                     -- The minimum amount of characters required.
        max_length = 8,                                                     -- The max amount of characters allowed.
        pattern = '[^0-9\\-]',                                              -- DONT change this.
        --Purchase Details
        purchase_type = 'phone_number',                                     -- DONT change this.
        purchase_price = {
            vip = 5,                                                        -- The amount of VIP tokens required to purchase 1 of these.
            bank = 100,                                                     -- The amount of $ in your in-game bank required to purchase 1 of these.
        },
        sale = {
            ENABLED = false,                                                -- Is this product on sale? (will display a 'sale' tag on the product).
            vip = 2.5,                                                      -- The amount of $ in your in-game bank required to purchase 1 of these.
            bank = 50                                                       -- The amount of VIP tokens required to purchase 1 of these.
        },
    },

    {
        --Product Display Info
        title = 'Character Name',                                           -- Title - THIS MUST BE UNIQUE.
        description = 'Change your character name',                         -- Product description.
        image = 'character_name.png',                                       -- The display image (must be a .png and 512 x 512 size).
        is_new = false,                                                     -- Is this product new? (will display a 'new' tag on the product).
        --Input Field Details
        input_description = 'eg., John Smith',                              -- The help text inside the input box.
        input_type = 'text',                                                -- DONT change this.
        min_length = 1,                                                     -- The minimum amount of characters required.
        max_length = 30,                                                    -- The max amount of characters allowed.
        pattern = '[^a-zA-Z\\s]',                                           -- DONT change this.
        --Purchase Details
        purchase_type = 'character_name',                                   -- DONT change this.
        purchase_price = {
            vip = 5,                                                        -- The amount of VIP tokens required to purchase 1 of these.
            bank = 100,                                                     -- The amount of $ in your in-game bank required to purchase 1 of these.
        },
        sale = {
            ENABLED = false,                                                -- Is this product on sale? (will display a 'sale' tag on the product).
            vip = 2.5,                                                      -- The amount of $ in your in-game bank required to purchase 1 of these.
            bank = 50                                                       -- The amount of VIP tokens required to purchase 1 of these.
        },
    },

    { --This will only work with cd_multicharacter by default unless you edit the code.
        --Product Display Info
        title = 'Character Slot',                                           -- Title - THIS MUST BE UNIQUE.
        description = 'Add 1 extra character slot',                         -- Product description.
        image = 'character_slot.png',                                       -- The display image. (must be a .png and 512 x 512 size)
        is_new = false,                                                     -- Is this product new? (will display a 'new' tag on the product).
        --Input Field Details
        input_description = '1 = x1 extra character slot',                  -- The help text inside the input box.
        input_type = 'number',                                              -- DONT change this.
        min_length = 1,                                                     -- The minimum amount of characters required.
        max_length = 2,                                                     -- The max amount of characters allowed.
        pattern = '[^a-zA-Z\\s]',                                           -- DONT change this.
        --Purchase Details
        purchase_type = 'character_slot',                                   -- DONT change this.
        purchase_price = {
            vip = 5,                                                        -- The amount of VIP tokens required to purchase 1 of these.
            bank = 100,                                                     -- The amount of $ in your in-game bank required to purchase 1 of these.
        },
        sale = {
            ENABLED = false,                                                -- Is this product on sale? (will display a 'sale' tag on the product).
            vip = 2.5,                                                      -- The amount of $ in your in-game bank required to purchase 1 of these.
            bank = 50                                                       -- The amount of VIP tokens required to purchase 1 of these.
        },
    },

    {
        --Product Display Info
        title = 'Bundle',                                                   -- Title - THIS MUST BE UNIQUE.
        description = 'Starter bundle',                                     -- Product description.
        image = 'bundle.png',                                               -- The display image (must be a .png and 512 x 512 size).
        is_new = false,                                                     -- Is this product new? (will display a 'new' tag on the product).
        --Input Field Details
        input_description = '1 = x1 bundle',                                -- The help text inside the input box.
        input_type = 'number',                                              -- DONT change this.
        min_length = 1,                                                     -- The minimum amount of characters required.
        max_length = 2,                                                     -- The max amount of characters allowed.
        pattern = '[^0-9]',                                                 -- DONT change this.
        --Purchase Details
        purchase_type = 'bundle',                                           -- DONT change this.
        purchase_price = {
            vip = 100,                                                      -- The amount of VIP tokens required to purchase 1 of these.
            bank = 1000,                                                    -- The amount of $ in your in-game bank required to purchase 1 of these.
        },
        sale = {
            ENABLED = false,                                                -- Is this product on sale? (will display a 'sale' tag on the product).
            vip = 2.5,                                                      -- The amount of $ in your in-game bank required to purchase 1 of these.
            bank = 50                                                       -- The amount of VIP tokens required to purchase 1 of these.
        },
        bundle_table = {
            ['money'] = 20000,
            ['item'] = {
                {name = 'water', label = 'Gold Bar', amount = 5},
                {name = 'bread', label = 'Bread', amount = 5},
            },
            ['weapon'] = {
                {name = 'WEAPON_CARBINERIFLE', label = 'Carbine Rifle', amount = 1, ammo = 250},
                {name = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, ammo = 250},
            },
            ['vehicle'] = {
                {model = 'adder', label = 'Adder', garage_type = 'car'},
                {model = 'seashark', label = 'Jet Ski', garage_type = 'boat'},
                {model = 'buzzard2', label = 'Golf Cart', garage_type = 'air'},
            },
        },
    },

    {
        --Product Display Info
        title = 'Mystery Box',                                              -- Title - THIS MUST BE UNIQUE.
        description = 'Mystery boxs can contain money, items or weapons',   -- Product description.
        image = 'random.png',                                               -- The display image (must be a .png and 512 x 512 size).
        is_new = false,                                                     -- Is this product new? (will display a 'new' tag on the product).
        --Input Field Details
        input_description = '1 = x1 mystery box',                           -- The help text inside the input box.
        input_type = 'number',                                              -- DONT change this.
        min_length = 1,                                                     -- The minimum amount of characters required.
        max_length = 2,                                                     -- The max amount of characters allowed.
        pattern = '[^0-9]',                                                 -- DONT change this.
        --Purchase Details
        purchase_type = 'random',                                           -- DONT change this.
        purchase_price = {
            vip = 10,                                                       -- The amount of VIP tokens required to purchase 1 of these.
            bank = 0,                                                       -- The amount of $ in your in-game bank required to purchase 1 of these.
        },
        sale = {
            ENABLED = false,                                                -- Is this product on sale? (will display a 'sale' tag on the product).
            vip = 2.5,                                                      -- The amount of $ in your in-game bank required to purchase 1 of these.
            bank = 50                                                       -- The amount of VIP tokens required to purchase 1 of these.
        },
        random_table = {                                                    -- The table of money/items/weapons that can be randomly selected.
            ['money'] = {
                {amount = 5000, percentage = 70}, --The percentage chance of this item being given per random crate.
                {amount = 10000, percentage = 10}
            },
            ['item'] = {
                {name = 'water', label = 'Gold Bar', amount = 5, percentage = 10},
                {name = 'bread', label = 'Bread', amount = 5, percentage = 90},
            },
            ['weapon'] = {
                {name = 'WEAPON_CARBINERIFLE', label = 'Carbine Rifle', amount = 1, ammo = 250, percentage = 5},
                {name = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, ammo = 250, percentage = 10},
            },
        },
    },
}


-- ██████╗ ████████╗██╗  ██╗███████╗██████╗ 
--██╔═══██╗╚══██╔══╝██║  ██║██╔════╝██╔══██╗
--██║   ██║   ██║   ███████║█████╗  ██████╔╝
--██║   ██║   ██║   ██╔══██║██╔══╝  ██╔══██╗
--╚██████╔╝   ██║   ██║  ██║███████╗██║  ██║
-- ╚═════╝    ╚═╝   ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝


function Round(cd) return math.floor(cd+0.5) end
function Trim(cd) return cd:gsub('%s+', '') end

function GetConfig()
    return Config
end

function GetCorrectPlateFormat(plate)
    if Config.PlateFormats == 'trimmed' then
        return Trim(plate)

    elseif Config.PlateFormats == 'with_spaces' then
        return plate

    elseif Config.PlateFormats == 'mixed' then
        return string.gsub(plate, "^%s*(.-)%s*$", "%1")
    end
end


-- █████╗ ██╗   ██╗████████╗ ██████╗     ██████╗ ███████╗████████╗███████╗ ██████╗████████╗
--██╔══██╗██║   ██║╚══██╔══╝██╔═══██╗    ██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝
--███████║██║   ██║   ██║   ██║   ██║    ██║  ██║█████╗     ██║   █████╗  ██║        ██║   
--██╔══██║██║   ██║   ██║   ██║   ██║    ██║  ██║██╔══╝     ██║   ██╔══╝  ██║        ██║   
--██║  ██║╚██████╔╝   ██║   ╚██████╔╝    ██████╔╝███████╗   ██║   ███████╗╚██████╗   ██║   
--╚═╝  ╚═╝ ╚═════╝    ╚═╝    ╚═════╝     ╚═════╝ ╚══════╝   ╚═╝   ╚══════╝ ╚═════╝   ╚═╝   
        

-----DO NOT TOUCH ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
if Config.Framework == 'auto_detect' then
    if GetResourceState(Config.FrameworkTriggers.esx.resource_name) == 'started' then
        Config.Framework = 'esx'
    elseif GetResourceState(Config.FrameworkTriggers.qbcore.resource_name) == 'started' then
        Config.Framework = 'qbcore'
    end
    if Config.Framework == 'esx' or Config.Framework == 'qbcore' then
        for c, d in pairs(Config.FrameworkTriggers[Config.Framework]) do
            Config.FrameworkTriggers[c] = d
        end
        Config.FrameworkTriggers.esx, Config.FrameworkTriggers.qbcore = nil, nil
    end
end

if Config.Database == 'auto_detect' then
    if GetResourceState('mysql-async') == 'started' then
        Config.Database = 'mysql'
    elseif GetResourceState('ghmattimysql') == 'started' then
        Config.Database = 'ghmattimysql'
    elseif GetResourceState('oxmysql') == 'started' then
        Config.Database = 'oxmysql'
    end
end

if Config.Notification == 'auto_detect' then
    if GetResourceState('cd_notifications') == 'started' then
        Config.Notification = 'cd_notifications'
    elseif GetResourceState('okokNotify') == 'started' then
        Config.Notification = 'okokNotify'
    elseif GetResourceState('ps-ui') == 'started' then
        Config.Notification = 'ps-ui'
    elseif GetResourceState('ox_lib') == 'started' then
        Config.Notification = 'ox_lib'
    else
        if Config.Framework == 'esx' or Config.Framework == 'qbcore' then
            Config.Notification = Config.Framework
        else
            Config.Notification = 'chat'
        end
    end
end

if Config.Framework == 'esx' then
    Config.FrameworkSQLtables = {
        vehicle_table = 'owned_vehicles',
        vehicle_identifier = 'owner',
        vehicle_props = 'vehicle',
        users_table = 'users',
        users_identifier = 'identifier',
    }
elseif Config.Framework == 'qbcore' then
    Config.FrameworkSQLtables = {
        vehicle_table = 'player_vehicles',
        vehicle_identifier = 'citizenid',
        vehicle_props = 'mods',
        users_table = 'players',
        users_identifier = 'citizenid',
    }
end

if IsDuplicityVersion() then
    if GetResourceState('cd_garage') == 'started' then
        Config.PlateFormats = exports['cd_garage']:GetConfig().PlateFormats
    end
end
-----DO NOT TOUCH ANYTHING ABOVE THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----

Last updated