Accessible code

Config = {
    locales = 'en',
    versionChecking = true, 
    
    useInventory = false,
    inventoryType = '', -- ox, qs, qb, core, lj, ps

    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 = nil,
            help = 'Redeem Promocode'
        },
    },

    InsertVehicleToDataBase = function(playerData, vehicle, plate, vehMod)
        if IsQBCore() then
            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
            })
        elseif IsESX() then
            MySQL.insert('INSERT INTO owned_vehicles (owner, plate, vehicle, stored, parking) VALUES (?, ?, ?, 1, ?)', {
                playerData.identifier, 
                plate, 
                json.encode(vehMod),
                'SanAndreasAvenue'
            })
        end
    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
}

Last updated