pScripts
  • INFORMATION
    • FiveM Asset Escrow System
    • Assets Updates
    • Discord Roles
  • Assets & Guides
    • 🏛️Banking
      • 👋Installation Guide
      • ⚙️Editable Files
      • Client Exports
      • Server Exports
    • 👨‍⚖️DOJ Job
      • 👋Installation Guide
      • ⚙️Config Files
      • Client Exports
      • Server Exports
    • 💻DOJ MDT
      • 👋Installation Guide
      • ⚙️Config Files
      • Client Exports
      • Server Exports
    • 🌿Weed Plants
      • 👋Installation Guide
      • ⚙️Config Files
      • Client Exports
      • Server Exports
    • 🚗Car Sale Job
      • 👋Installation Guide
      • ⚙️Config File
      • Client Exports
      • Server Exports
    • 📙Job Core
      • ⚙️Config File
      • Exports
    • 👮Police Job
      • 👋Installation Guide
      • ⚠️Common Issues
      • ⁉️Setup Server
      • ⚙️Config Files
      • Client Exports
        • Bodycam
        • Evidence System
        • Duty GPS
        • Interactions
        • Jail System
        • Police Objects
        • Speed Camera
        • Manage Traffic
        • Misc
      • Server Exports
        • Evidence System
        • Interactions
        • Jail System
        • Misc
    • 💻Police MDT
      • ⁉️Setup Server
      • ⚙️Config File
      • Client Exports
      • Server Exports
      • Dispatch System
    • 🚑Ambulance Job
      • 👋Installation Guide
      • ⁉️Setup Server
      • ⚙️Config Files
      • Client Exports
      • Server Exports
    • 💻Ambulance MDT
      • 👋Installation Guide
      • ⚙️Config File
      • Exports and Events
      • Dispatch System
    • 🛠️Mechanic Job
      • ⚙️Config Files
      • Mileage System
      • Nitro System
      • Lifters System
      • Misc
    • 💻Mechanic MDT
      • ⚙️Config File
      • Exports
      • Dispatch System
      • Licenses System
    • 💵Fleeca Robbery
      • 👋Installation Guide
      • ⚙️Config File
    • ⌚Jewelry Robbery
      • 👋Installation Guide
      • ⚙️Config File
    • 💇Appearance
      • ⚙️Config Files
      • Client Exports
    • 👀Hints
      • Exports
    • 👋Helper
      • Exports
    • 🔧Tuning Menu
      • Exports and Events
      • ⚙️Config Files
    • 🆔Documents
      • ⚙️Config File
      • Exports and Events
    • 📱Phone
      • ⤵️INSTALLATION
      • ⚙️CONFIG FILES
      • 📃FEATURES
      • 📱APPS
      • 📇SIM CARDS
      • 📳NOTIFICATIONS
      • 📨MESSAGES
      • 🚘GARAGES
      • 🪙CRYPTO
      • 🔪DARK CONNECT
      • ⌨️FUNCTIONS
      • 🌎LANGUAGE
      • ⚠️COMMON ISSUES
    • 🪙Casino Games
      • 🎰Slot Machine
      • 🏐Roulette
      • ♣️Poker
    • 💻GCT
      • 📨EXPORTS
    • 💻Civil MDT
      • ⤵️INSTALLATION
      • 📱APPS
      • 🏎️BOOSTING
      • 🏅ACHIEVEMENTS
      • ⚠️COMMON ISSUES
Powered by GitBook
On this page
  1. Assets & Guides
  2. Banking

Editable Files

Config
Config = {}
Config.Debug = true -- ENABLE DEBUG MODE? [SHOWS MORE INFO IN CONSOLE]
Config.Language = 'en' -- [en, de, pl, ru, es, fr, tr, ar]
Config.Logs = true -- ENABLE DISCORD LOGS? [SERVER/EDITABLE_FUNCTIONS.LUA]
Config.Bank = {
    IBANLength = 10, -- IBAN LENGTH [AUTO-GENERATED]
    societyAccounts = true, -- ENABLE SOCIETY ACCOUNTS? [FOR JOBS]
    sharedAccountsLimit = 3, -- MAXIMUM NUMBER OF SHARED ACCOUNTS
    accountLogs = true, -- ENABLE ACCOUNT LOGS?
    locations = {
        {coords = vec3(149.7, -1041.32, 29.7), radius = 0.65, blip = {name = "Fleeca Bank", sprite = 108, color = 2, scale = 0.8}}, -- FLEECA BANK [COORDS AND RADIUS OF TARGET]
        {coords = vec3(-1212.7, -330.5, 37.8), radius = 0.65, blip = {name = "Fleeca Bank", sprite = 108, color = 2, scale = 0.8}}, -- FLEECA BANK [COORDS AND RADIUS OF TARGET]
        {coords = vec3(-351.5, -49.5, 49.0), radius = 0.65, blip = {name = "Fleeca Bank", sprite = 108, color = 2, scale = 0.8}}, -- FLEECA BANK [COORDS AND RADIUS OF TARGET]
        {coords = vec3(-2962.5, 482.5, 15.7), radius = 0.65, blip = {name = "Fleeca Bank", sprite = 108, color = 2, scale = 0.8}}, -- FLEECA BANK [COORDS AND RADIUS OF TARGET]
        {coords = vec3(-112.5, 6469.5, 31.6), radius = 0.65, blip = {name = "Fleeca Bank", sprite = 108, color = 2, scale = 0.8}}, -- FLEECA BANK [COORDS AND RADIUS OF TARGET]
        {coords = vec3(1175.5, 2706.5, 38.0), radius = 0.65, blip = {name = "Fleeca Bank", sprite = 108, color = 2, scale = 0.8}}, -- FLEECA BANK [COORDS AND RADIUS OF TARGET]
    }
}

Config.ATM = {
    allowDeposit = true, -- ALLOW PLAYERS TO DEPOSIT MONEY IN ATM
    allowWithdraw = true, -- ALLOW PLAYERS TO WITHDRAW MONEY FROM ATM
    models = {'prop_fleeca_atm', 'prop_atm_02', 'prop_atm_03', 'prop_atm_01'}, -- MODELS OF ATMS [FOR TARGET]
    locations = {}, -- YOU CAN OPTIONALLY ADD ATM FOR COORDS [SAME LIKE BANK LOCATIONS :)]
    onOpen = function(atmEntity) -- THIS FUNCTION IS EXECUTED WHEN PLAYER OPENS ATM
        if atmEntity == 0 or not DoesEntityExist(atmEntity) then
            return
        end

        local plyCoords = GetEntityCoords(cache.ped)
        if #(plyCoords - GetEntityCoords(atmEntity)) > 2.5 then
            return
        end

        local offset = GetOffsetFromEntityInWorldCoords(atmEntity, 0.0, -0.55, 0.0)
        SetEntityCoordsNoOffset(cache.ped, offset.x, offset.y, plyCoords.z, true, true, true)
        SetEntityHeading(cache.ped, GetEntityHeading(atmEntity))
        TaskStartScenarioInPlace(cache.ped, 'PROP_HUMAN_ATM', 0, true)
        Citizen.Wait(2000) -- WAIT FOR ANIMATION
    end,
    onClose = function() -- THIS FUNCTION IS EXECUTED WHEN PLAYER CLOSES ATM
        ClearPedTasks(cache.ped)
    end
}

Config.Invoices = {
    menuCommand = 'createInvoice', -- COMMAND TO OPEN INVOICE MENU, set to false to disable
    allowDebt = true, -- ALLOW PLAYERS TO PAY INVOICES IF THEY DOESNT HAVE ENOUGH MONEY
}

Config.Loans = {
    isEnabled = true, -- ENABLE LOANS SYSTEM?
    maxLoans = 1, -- MAXIMUM NUMBER OF LOANS PLAYER CAN HAVE
    defaultCreditScore = 500, -- DEFAULT CREDIT SCORE FOR NEW PLAYERS [MAXIMUM 1000]
    availableLoans = {
        {
            name = 'Bronze Loan', 
            amount = 10000, 
            repayment = 1.2, -- 120% repayment
            requiredScore = 350, 
            duration = 30 -- 30 days
        }, 
        {
            name = 'Silver Loan', 
            amount = 25000, 
            repayment = 1.1, -- 110% repayment
            requiredScore = 550, 
            duration = 30 -- 30 days
        }, 
        {
            name = 'Gold Loan', 
            amount = 50000, 
            repayment = 1.05, -- 105% repayment
            requiredScore = 700, 
            duration = 30 -- 30 days
        }, 
        {
            name = 'Diamond Loan', 
            amount = 250000, 
            repayment = 1.1, -- 110% repayment
            requiredScore = 900, 
            duration = 30 -- 30 days
        },
    }
}

Config.BankCards = {
    isEnabled = true, -- ENABLE BANK CARDS SYSTEM? [PLAYER WILL NEED TO HAVE BANK CARD TO USE ATM]
    maxCardsPerAccount = 3, -- MAXIMUM NUMBER OF CARDS PER ACCOUNT
    cardHacking = true, -- ENABLE BANK CARD HACKING? [PLAYER CAN HACK BANK CARDS FROM OTHER PLAYERS]
    requiredHackItems = {
        -- ['atm_device'] = 1
    },
    stoleAmount = {min = 100, max = 5000}, -- AMOUNT OF MONEY PLAYER CAN STEAL FROM HACKED CARD
    cooldownType = 'global', -- global / account [global cooldown for all players or cooldown for hacked account]
    cooldownTime = 30 * 60, -- COOLDOWN TIME IN SECONDS [30 MINUTES]
    removeCardAfterHack = true, -- REMOVE BANK CARD AFTER HACKING? [PLAYER WILL NEED TO GET NEW CARD]
    cardHackGame = function()
        if lib.progressBar({
            duration = 10000,
            label = locale('preparing_device'),
            useWhileDead = false,
            canCancel = true,
            disable = {car = true, move = true, combat = true},
            anim = {dict = 'anim@scripted@player@mission@tunf_hack_keypad@heeled@', clip = 'hack_loop'},
        }) then
            if GetResourceState('p_minigames') == 'started' then
                return exports['p_minigames']:StartGame('MathGame', {
                    preset = 'easy', -- easy / medium / hard / impossible
                    questionsAmount = 20,
                    maxFails = 3,
                    fallTime = 5000
                })
            else
                return lib.skillCheck({'easy', 'easy', {areaSize = 60, speedMultiplier = 2}, 'hard'}, {'w', 'a', 's', 'd'})
            end
        else
            return false
        end
    end
}
Editable Client Functions
Editable = {
    showNotify = function(text, type)
        lib.notify({
            title = locale('notification'),
            description = text,
            type = type or 'inform'
        })
    end,
    getPlayerCards = function()
        local cards = {}
        if GetResourceState('ox_inventory') == 'started' then
            local items = exports['ox_inventory']:GetPlayerItems()
            for k, v in pairs(items) do
                if v.name == 'bank_card' then
                    cards[#cards + 1] = {iban = v.metadata.iban, card_number = v.metadata.card_number}
                end
            end
        elseif QBCore then
            local items = QBCore.PlayerData.items
            for k, v in pairs(items) do
                if v.name == 'bank_card' then
                    cards[#cards + 1] = {iban = v.info.iban, card_number = v.info.card_number}
                end
            end
        end
        return cards
    end,
    addCoordsInteraction = function(data)
        if GetResourceState('ox_target') == 'started' then
            exports['ox_target']:addSphereZone({
                coords = data.coords,
                radius = data.radius or 0.75,
                debug = Config.Debug or false,
                drawSprite = false, -- [true/false] Draw a sprite at the center of the zone
                options = data.options
            })
        elseif GetResourceState('qb-target') == 'started' then
            for i = 1, #data.options, 1 do
                if data.options[i].onSelect then
                    data.options[i].action = data.options[i].onSelect
                end
                if data.options[i].groups then
                    data.options[i].job = data.options[i].groups
                end
                if data.options[i].items then
                    data.options[i].item = data.options[i].items
                end
            end
            local name = 'p_banking_'..tostring(math.random(11111111, 99999999))
            exports['qb-target']:AddCircleZone(name, data.coords, data.radius, {
                name = name,
                debugPoly = Config.Debug or false,
            }, {
                options = data.options,
                distance = data.options[1].distance or 2
            })
        end
    end,
    addModelInteraction = function(models, options)
        if GetResourceState('ox_target') == 'started' then
            exports['ox_target']:addModel(models, options)
        elseif GetResourceState('qb-target') == 'started' then
            for i = 1, #options, 1 do
                if options[i].onSelect then
                    options[i].action = options[i].onSelect
                end
                if options[i].groups then
                    options[i].job = options[i].groups
                end
                if options[i].items then
                    options[i].item = options[i].items
                end
            end
            exports['qb-target']:AddTargetModel(models, {
                options = options,
                distance = options[1].distance or 1.75
            })
        end
    end
}
Editable Server Functions
lib.locale(Config.Language or 'en')

Editable = {
    --@param playerId: number
    --@param text: string
    --@param type: inform | error | success
    showNotify = function(playerId, text, type)
        TriggerClientEvent('ox_lib:notify', playerId, {title = locale('notification'), description = text, type = type or 'inform'})
    end,
    addPlayerItem = function(playerId, itemName, itemCount, itemData)
        if GetResourceState('ox_inventory') == 'started' then
            exports['ox_inventory']:AddItem(playerId, itemName, itemCount, itemData)
        elseif GetResourceState('qb-inventory') == 'started' then
            exports['qb-inventory']:AddItem(playerId, itemName, itemCount, nil, itemData)
        elseif GetResourceState('ps-inventory') == 'started' then
            exports['qb-inventory']:AddItem(playerId, itemName, itemCount, nil, itemData)
        elseif GetResourceState('jpr-inventory') == 'started' then
            exports['jpr-inventory']:AddItem(playerId, itemName, itemCount, nil, itemData)
        elseif GetResourceState('qs-inventory') == 'started' then
            exports['qs-inventory']:AddItem(playerId, itemName, itemCount, nil, itemData)
        elseif GetResourceState('tgiann-inventory') == 'started' then
            exports['tgiann-inventory']:AddItem(playerId, itemName, itemCount, nil, itemData)
        elseif GetResourceState('codem-inventory') == 'started' then
            exports['codem-inventory']:AddItem(playerId, itemName, itemCount, nil, itemData)
        end
    end,
    removePlayerItem = function(playerId, itemName, itemCount, metadata)
        if GetResourceState('ox_inventory') == 'started' then
            exports['ox_inventory']:RemoveItem(playerId, itemName, itemCount, metadata)
        elseif GetResourceState('qb-inventory') == 'started' then
            exports['qb-inventory']:RemoveItem(playerId, itemName, itemCount, nil, metadata)
        elseif GetResourceState('ps-inventory') == 'started' then
            exports['qb-inventory']:RemoveItem(playerId, itemName, itemCount, nil, metadata)
        elseif GetResourceState('jpr-inventory') == 'started' then
            exports['jpr-inventory']:RemoveItem(playerId, itemName, itemCount, nil, metadata)
        elseif GetResourceState('qs-inventory') == 'started' then
            exports['qs-inventory']:RemoveItem(playerId, itemName, itemCount, nil, metadata)
        elseif GetResourceState('tgiann-inventory') == 'started' then
            exports['tgiann-inventory']:RemoveItem(playerId, itemName, itemCount, nil, metadata)
        elseif GetResourceState('codem-inventory') == 'started' then
            exports['codem-inventory']:RemoveItem(playerId, itemName, itemCount, nil, metadata)
        end
    end,
    getItemCount = function(playerId, itemName)
        if GetResourceState('ox_inventory') == 'started' then
            return exports['ox_inventory']:Search(playerId, 'count', itemName) or 0
        elseif GetResourceState('qb-inventory') == 'started' then
            return exports['qb-inventory']:GetItemCount(playerId, itemName) or 0
        elseif GetResourceState('ps-inventory') == 'started' then
            return exports['ps-inventory']:GetItemByName(playerId, itemName)?.amount or 0
        elseif GetResourceState('jpr-inventory') == 'started' then
            return exports['jpr-inventory']:GetItemByName(playerId, itemName)?.amount or 0
        elseif GetResourceState('qs-inventory') == 'started' then
            return exports['qs-inventory']:GetItemTotalAmount(playerId, itemName) or 0
        elseif GetResourceState('tgiann-inventory') == 'started' then
            return exports['tgiann-inventory']:GetItemCount(playerId, itemName) or 0
        elseif GetResourceState('codem-inventory') == 'started' then
            return exports['codem-inventory']:GetItemsTotalAmount(playerId, itemName) or 0
        end
        return 0
    end,
    getItemData = function(playerId, itemName, metadata)
        if GetResourceState('ox_inventory') == 'started' then
            local items = exports['ox_inventory']:Search(playerId, 'slots', itemName, metadata)
            return items and items[1] or nil
        elseif GetResourceState('qs-inventory') == 'started' then
            local items = exports['qs-inventory']:GetInventory(playerId)
            for _, item in pairs(items) do
                if item.info then
                    item.metadata = item.info
                end
                if item.name == itemName and item.metadata and item.metadata.iban == metadata.iban then
                    local row = MySQL.single.await('SELECT * FROM p_bank_cards WHERE iban = ? AND card_number = ?', {
                        item.metadata.iban, item.metadata.card_number
                    })
                    if row then
                        return item
                    end
                end
            end
        elseif GetResourceState('tgiann-inventory') == 'started' then
            local items = exports["tgiann-inventory"]:GetPlayerItems(playerId)
            for _, item in pairs(items) do
                if item.info then
                    item.metadata = item.info
                end
                if item.name == itemName and item.metadata and item.metadata.iban == metadata.iban then
                    local row = MySQL.single.await('SELECT * FROM p_bank_cards WHERE iban = ? AND card_number = ?', {
                        item.metadata.iban, item.metadata.card_number
                    })
                    if row then
                        return item
                    end
                end
            end
        elseif GetResourceState('codem-inventory') == 'started' then
            local items = exports['codem-inventory']:GetInventory(playerId)
            for _, item in pairs(items) do
                if item.info then
                    item.metadata = item.info
                end
                if item.name == itemName and item.metadata and item.metadata.iban == metadata.iban then
                    local row = MySQL.single.await('SELECT * FROM p_bank_cards WHERE iban = ? AND card_number = ?', {
                        item.metadata.iban, item.metadata.card_number
                    })
                    if row then
                        return item
                    end
                end
            end
        elseif QBCore then
            local player = QBCore.Functions.GetPlayer(playerId)
            if player then
                local items = player.PlayerData.items
                for _, item in pairs(items) do
                    if item.info then
                        item.metadata = item.info
                    end
                    if item.name == itemName and item.metadata and item.metadata.iban == metadata.iban then
                        local row = MySQL.single.await('SELECT * FROM p_bank_cards WHERE iban = ? AND card_number = ?', {
                            item.metadata.iban, item.metadata.card_number
                        })
                        if row then
                            return item
                        end
                    end
                end
            end
        end
        return 0
    end,
    sendDiscordLog = function(playerId, message)
        local DISCORD_WEBHOOK = 'WEBHOOK HERE' -- SET ONLY WEBHOOK DISCORD HERE
        Citizen.CreateThread(function()
            if not Config.Logs or DISCORD_WEBHOOK == 'WEBHOOK_HERE' --[[DONT TOUCH IT!!!!!!!]] then return end
            local steamName, steamHex, discordId = 'Unknown', 'Unknown', 'Unknown'
            if playerId then
                steamName = GetPlayerName(playerId)
                local identifiers = GetPlayerIdentifiers(playerId)
                for i = 1, #identifiers do
                    if string.find(identifiers[i], 'steam:') then
                        steamHex = identifiers[i]
                    elseif string.find(identifiers[i], 'discord:') then
                        discordId = string.gsub(identifiers[i], 'discord:', '')
                    end
                end
            end
    
            message = message..'\nID: '..(playerId or 'Server')..'\nSteam Name: '..steamName..'\nSteam HEX: '..steamHex..'\nDiscord: <@'..discordId..'>'
            local embedData = { {
                ['title'] = 'Banking',
                ['color'] = 14423100,
                ['footer'] = {
                    ['text'] = "Banking | pScripts | " .. os.date(),
                    ['icon_url'] = "https://r2.fivemanage.com/xlufCGKYLtGfU8IBmjOL9/LOGO3.png"
                },
                ['description'] = message,
                ['author'] = {
                    ['name'] = "pScripts",
                    ['icon_url'] = "https://r2.fivemanage.com/xlufCGKYLtGfU8IBmjOL9/LOGO3.png"
                }
            } }
            PerformHttpRequest(DISCORD_WEBHOOK, nil, 'POST', json.encode({
                username = 'pScripts',
                embeds = embedData
            }), {
                ['Content-Type'] = 'application/json'
            })
        end)
    end
}
PreviousInstallation GuideNextClient Exports

Last updated 4 days ago

🏛️
⚙️