đŸ”Ŧ
RX Scripts
STOREDISCORD
  • 👋Overview
  • Find us
    • 🔗Store
    • 🔗Discord
    • 🔗Youtube
  • 🌐Scripts
    • Garages
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Banking
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Reports PRO
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Mining
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Fishing
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Player Stores
      • đŸ› ī¸Installation
      • 🚚Jobs DLC
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Drug Labs
      • đŸ› ī¸Installation
      • âœˆī¸Operation DLC
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Hunting
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Plantation
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Gang Wars
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Events
    • Housing
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Events
    • Chopshop
      • đŸ› ī¸Installation
      • 📝Configurables
    • Death System
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Events
    • Recyclers
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Smelters
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Crates & Storages
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Exports
      • â†Šī¸Events
    • Black Markets
      • đŸ› ī¸Installation
      • 📝Configurables
    • Hazard Zones
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Report System
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Billing System
      • đŸ› ī¸Installation
      • â†Ēī¸Exports
      • â†Šī¸Events
Powered by GitBook
On this page
  • Config files
  • Opensource files
  1. Scripts
  2. Banking

Configurables

In this page, you can see everything that can be configured/changed within this script.

Config files

--[[
BY RX Scripts Š rxscripts.xyz
--]]

Config = {}

Config.Locale = 'en'
Config.MoneyTypes = { -- Account names from your framework
    money = 'money',
    bank = 'bank',
}

Config.Accounts = {
    --[[
        Checking accounts can be deposited into, withdrawn from, and transferred to other accounts
        1 checking account is created by default for each character, extra ones can be created by the player, if max is not reached
    --]]
    checking = {
        maxAccounts = 2, -- Max checking accounts per character (including the default one, excluding society checking accounts)
        openCost = 100,  -- Cost to create a new checking account
    },

    --[[
        Saving accounts can be transferred from & to other accounts.
        Saving accounts are not created by default, the player must create them, if max is not reached
        Saving accounts can give interest if enabled
    --]]
    saving = {
        maxAccounts = 2,    -- Max saving accounts per character
        openCost = 100,     -- Cost to create a new saving account
        interest = {
            enabled = true, -- Enable interest on saving accounts
            rate = 0.005,   -- Interest rate (0.5%)
            interval = 1,   -- Interval in hours
        }
    },
}

Config.Cards = {
    --[[
        Setting item.enabled to true, will make the card an actual item in the inventory
        This item will then be required to be in the inventory to open the ATM for the account this card belongs to
    --]]
    item = {
        enabled = true,
        name = 'rx_card', -- Name of the item in the inventory
    },
    --[[
        Allow that everyone can open anyone's account in an ATM, as long as they have the card in their inventory.
        To enable the robbing feature, you MUST set item.enabled option to true.
        Only checking accounts can be robbed, excluding personal accounts (accounts that are used for the default bank of the player)
    --]]
    robbing = true,
}

Config.Loans = {
    enabled = true,
    packages = {
        ["Personal Express Loan"] = {
            amount = 35000,  -- Total loan amount
            interest = 4.5, -- Interest rate percentage
            days = 25,      -- Duration in days
            description = "Quick access to small funds for personal expenses with minimal paperwork and fast approval."
        },
        ["Flexible Credit Line"] = {
            amount = 85000,
            interest = 8.75,
            days = 40,
            description = "Versatile financing solution for medium-sized projects with convenient repayment schedule."
        },
        ["Capital Investment Loan"] = {
            amount = 425000,
            interest = 12.25,
            days = 55,
            description = "Substantial funding for business growth and investment opportunities with competitive days."
        },
        ["Executive Financing Plan"] = {
            amount = 1250000,
            interest = 16.5,
            days = 75,
            description =
            "Premium financing package designed for major enterprises and significant capital requirements."
        }
    }
}

Config.Society = {
    enabled = true, -- Enable society accounts
    accounts = {
        ['police'] = {
            requiredGrades = {
                [2] = {
                    deposit = true,
                    withdraw = false,
                    transfer = false,
                },
                [3] = {
                    deposit = true,
                    withdraw = true,
                    transfer = true,
                },
            }
        }
    }
}

Config.Banks = {
    blip = {
        enabled = true,
        label = 'Bank',
        sprite = 108,
        color = 3,
        display = 2,
        scale = 0.7,
        shortrange = true,
    },
    markerDist = 5.0,
    openDist = 2.5,
    locations = {
        vector4(149.91, -1040.74, 29.374, 160),
        vector4(-1212.63, -330.78, 37.59, 210),
        vector4(-2962.47, 482.93, 15.5, 270),
        vector4(-113.01, 6470.24, 31.43, 315),
        vector4(314.16, -279.09, 53.97, 160),
        vector4(-350.99, -49.99, 48.84, 160),
        vector4(1175.02, 2706.87, 37.89, 0),
        vector4(246.63, 223.62, 106.0, 160),
    }
}

Config.ATMs = {
    openDist = 1.0,
    presetAmounts = { 1000, 5000, 10000, 20000, 50000, 100000 },
    models = {
        'prop_fleeca_atm',
        'prop_atm_01',
        'prop_atm_02',
        'prop_atm_03'
    }
}

Config.UI = {
    color = {
        primary = { -- Different shades of primary color
            [50] = "#FEDDE9",
            [100] = "#FCBAD3",
            [200] = "#FA76A6",
            [300] = "#F7317A",
            [400] = "#D80955",
            [500] = "#95063B",
            [600] = "#76052E",
            [700] = "#580423",
            [800] = "#3B0217",
            [900] = "#1D010C",
            [950] = "#0F0106"
        },
    }
}

--[[
    ONLY CHANGE THIS PART IF YOU HAVE RENAMED SCRIPTS SUCH AS FRAMEWORK, TARGET, INVENTORY ETC
    RENAME THE SCRIPT NAME TO THE NEW NAME
--]]
---@type table Only change these if you have changed the name of a resource
Resources = {
    FM = { name = 'fmLib', export = 'new' },
    -- OXTarget = { name = 'ox_target', export = 'all' },
    -- QBTarget = { name = 'qb-target', export = 'all' },
}
IgnoreScriptFoundLogs = false
ShowDebugPrints = true

Opensource files

--[[
BY RX Scripts Š rxscripts.xyz
--]]

Config.DiscordWebhooks = {
    moneyAdded = '',
    moneyRemoved = '',
}

function RemoveMoneyFromBankSQL(identifier, amount)
    local table = GetResourceState('es_extended') == 'started' and 'users' or 'players'
    local accountsColumn = GetResourceState('es_extended') == 'started' and 'accounts' or 'money'
    local identifierColumn = GetResourceState('es_extended') == 'started' and 'identifier' or 'citizenid'

    return MySQL.update.await(
        string.format('UPDATE %s SET %s = JSON_SET(%s, "$.bank", JSON_EXTRACT(%s, "$.bank") - @amount) WHERE %s = @identifier',
            table, accountsColumn, accountsColumn, accountsColumn, identifierColumn),
        {
            ['@amount'] = amount,
            ['@identifier'] = identifier,
        }
    )
end

function AddMoneyToBankSQL(identifier, amount)
    local table = GetResourceState('es_extended') == 'started' and 'users' or 'players'
    local accountsColumn = GetResourceState('es_extended') == 'started' and 'accounts' or 'money'
    local identifierColumn = GetResourceState('es_extended') == 'started' and 'identifier' or 'citizenid'

    return MySQL.update.await(
        string.format('UPDATE %s SET %s = JSON_SET(%s, "$.bank", JSON_EXTRACT(%s, "$.bank") + @amount) WHERE %s = @identifier',
            table, accountsColumn, accountsColumn, accountsColumn, identifierColumn),
        {
            ['@amount'] = amount,
            ['@identifier'] = identifier,
        }
    )
end

function GetMoneyFromBankSQL(identifier)
    local table = GetResourceState('es_extended') == 'started' and 'users' or 'players'
    local accountsColumn = GetResourceState('es_extended') == 'started' and 'accounts' or 'money'
    local identifierColumn = GetResourceState('es_extended') == 'started' and 'identifier' or 'citizenid'

    return MySQL.query.await(
        string.format('SELECT JSON_UNQUOTE(JSON_EXTRACT(%s, "$.bank")) AS bank FROM %s WHERE %s = @identifier',
            accountsColumn, table, identifierColumn),
        {
            ['@identifier'] = identifier,
        }
    )[1].bank
end

---@param account Account
RegisterNetEvent('rxbanking:onAccountCreated', function(account) end)

---@param account Account
---@param amount number
---@param transactionData? { type?: 'deposit' | 'withdraw' | 'transfer' | 'interest' | 'payment', reason?: string, toIban?: string }
RegisterNetEvent('rxbanking:onMoneyRemoved', function(account, amount, transactionData) end)

---@param account Account
---@param amount number
---@param transactionData? { type?: 'deposit' | 'withdraw' | 'transfer' | 'payment', reason?: string, fromIban?: string }
RegisterNetEvent('rxbanking:onMoneyAdded', function(account, amount, transactionData) end)

---@param account Account
---@param amount number
RegisterNetEvent('rxbanking:onInterestAdded', function(account, amount) end)

---@param authorization Authorization
RegisterNetEvent('rxbanking:onAuthorizationCreated', function(authorization) end)

---@param authorization Authorization
RegisterNetEvent('rxbanking:onAuthorizationRemoved', function(authorization) end)

---@param card Card
RegisterNetEvent('rxbanking:onCardCreated', function(card) end)

---@param card Card
---@param isFrozen boolean
RegisterNetEvent('rxbanking:onCardFreezeToggle', function(card, isFrozen) end)

---@param oldCard Card
---@param newCard Card
RegisterNetEvent('rxbanking:onNewCardRequested', function(oldCard, newCard) end)

---@param loan Loan
RegisterNetEvent('rxbanking:onLoanCreated', function(loan) end)

---@param loan Loan
---@param amount number
RegisterNetEvent('rxbanking:onLoanPayment', function(loan, amount) end)

---@param loan Loan
---@param amount number Amount that has been paid to pay off the loan
RegisterNetEvent('rxbanking:onLoanPaidOff', function(loan, amount) end)

---@param transaction Transaction
RegisterNetEvent('rxbanking:onTransactionCreated', function(transaction) end)
--[[
BY RX Scripts Š rxscripts.xyz
--]]

local function getATMTargetOpts()
    local opts = {}

    if OXTarget then
        opts = {
            {
                name = "Open ATM",
                label = "Open ATM",
                icon = "fas fa-money-bill",
                distance = Config.ATMs.openDist,
                canInteract = function()
                    local ped = PlayerPedId()
                    if not IsPedOnFoot(ped) then return false end

                    return true
                end,
                onSelect = function(data)
                    OpenATM()
                end,
            },
        }
    elseif QBTarget then
        opts = {
            options = {
                {
                    icon = "fas fa-money-bill",
                    label = "Open ATM",
                    canInteract = function()
                        local ped = PlayerPedId()
                        if not IsPedOnFoot(ped) then return false end

                        return true
                    end,
                    action = function(entity)
                        OpenATM()
                    end
                },
            },
            distance = Config.ATMs.openDist,
        }
    end

    return opts
end

---@param type 'open_bank'
function ShowMarker(type, coords)
    if type == 'open_bank' then
        DrawMarker(2, coords, 0, 0, 0, 0, 180.0, 0, 0.3, 0.3, 0.3, 128, 2, 49, 100, false, false, 2, true, false, false,
            false)
    end
end

function InitGlobalATMTarget(prop)
    if OXTarget then
        OXTarget:addModel(prop, getATMTargetOpts())
    elseif QBTarget then
        QBTarget:AddTargetModel(prop, getATMTargetOpts())
    end
end

local i = 0
function InitBankTargetZone(v3)
    if OXTarget then
        OXTarget:addSphereZone({
            coords = v3,
            radius = 0.8,
            debug = false,
            drawSprite = true,
            options = {
                {
                    icon = "fas fa-money-bill",
                    label = "Open Bank",
                    distance = Config.Banks.openDist,
                    canInteract = function()
                        local ped = PlayerPedId()
                        if not IsPedOnFoot(ped) then return false end

                        return true
                    end,
                    action = function(entity)
                        OpenBank()
                    end
                }
            }
        })
    elseif QBTarget then
        local name = 'open_bank_' .. i
        i = i + 1

        QBTarget:AddCircleZone(name, v3, 1.0, {
            name = name,
            debugPoly = false,
        }, {
            options = {
                {
                    icon = "fas fa-money-bill",
                    label = "Open Bank",
                    canInteract = function()
                        local ped = PlayerPedId()
                        if not IsPedOnFoot(ped) then return false end

                        return true
                    end,
                    action = function(entity)
                        OpenBank()
                    end
                },
            },
            distance = Config.Banks.openDist
        })
    end
end
PreviousInstallationNextExports

Last updated 17 days ago

🌐
📝