Config File

Config file for "Advanced Promocode Creator"

ESX

Config = {
    locales = 'en',
    versionChecking = true, 
    OxInventory = true,

    moneyTypes = {
        ['money'] = 'Cash',
        ['bank'] = 'Bank',
    },

    fullTune = {
        modEngine = 3,
        modBrakes = 2,
        modTransmission = 2,
        modSuspension = 3,
        modArmor = true,
        windowTint = 1
    },

    commands = {
        {
            name = 'promocodes',
            permission = 'group.admin',
            help = 'Promo codes menu (create code, codes list, delete code)'
        },
        {
            name = 'redeemcode',
            permission = 'group.user',
            help = 'Redeem Promocode'
        },
    },

    InsertVehicleToDataBase = function(playerData, vehModel, plate, vehMod)
        MySQL.insert('INSERT INTO owned_vehicles (owner, plate, vehicle, stored, parking) VALUES (?, ?, ?, 1, ?)', {
            playerData.identifier, 
            plate, 
            json.encode(vehMod),
            'SanAndreasAvenue'
        })
    end,

    GeneratePlate = function()
        local StringCharset = {}
        local NumberCharset = {}

        for i = 48, 57 do NumberCharset[#NumberCharset + 1] = string.char(i) end
        for i = 65, 90 do StringCharset[#StringCharset + 1] = string.char(i) end
        for i = 97, 122 do StringCharset[#StringCharset + 1] = string.char(i) end

        function RandomStr(length)
            if length <= 0 then return '' end
            return RandomStr(length - 1) .. StringCharset[math.random(1, #StringCharset)]
        end

        function RandomInt(length)
            if length <= 0 then return '' end
            return RandomInt(length - 1) .. NumberCharset[math.random(1, #NumberCharset)]
        end

        return RandomInt(1) .. RandomStr(2) .. RandomInt(3) .. RandomStr(2)
    end
}

QBCORE

Config = {
    locales = 'en',
    versionChecking = true, 
    
    moneyTypes = {
        ['cash'] = 'Cash',
        ['bank'] = 'Bank',
    },

    fullTune = {
        modEngine = 3,
        modBrakes = 2,
        modTransmission = 2,
        modSuspension = 3,
        modArmor = true,
        windowTint = 1
    },

    commands = {
        {
            name = 'promocodes',
            permission = 'group.admin',
            help = 'Promo codes menu (create code, codes list, delete code)'
        },
        {
            name = 'redeemcode',
            permission = 'group.user',
            help = 'Redeem Promocode'
        },
    },

    InsertVehicleToDataBase = function(playerData, vehicle, plate, vehMod)
        MySQL.insert('INSERT INTO player_vehicles (license, citizenid, vehicle, hash, mods, plate, garage, state) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', {
            playerData.license,
            playerData.citizenid,
            vehicle,
            GetHashKey(vehicle),
            json.encode(vehMod),
            plate,
            'pillboxgarage',
            1
        })
    end,

    GeneratePlate = function()
        return QBCore.Shared.RandomInt(1) .. QBCore.Shared.RandomStr(2) .. QBCore.Shared.RandomInt(3) .. QBCore.Shared.RandomStr(2)
    end
}

Last updated