Overview
Britannia Banking puts working banks in your towns. Walk up to the counter, press G, and a black and gold bank window opens with four pages: your account, your statement, loans and your safe deposit box.
- Cash and gold accounts: pay in and take out, with a preview of the tax and what you'll get before you click.
- An account at every bank, or one account that every bank shares (one setting).
- Taxes set per state, on paying in, taking out and interest, or turned off completely.
- A statement of everything that went in and out.
- Daily interest on savings, with a cap.
- Loans with a due date, a late fee, and collection from the borrower's accounts when it's overdue.
- Safe deposit boxes in sizes you choose, with weekly rent taken from the account.
- A home bank: wages and payments from other scripts that use poggy_core's
bankmoney land there, even on VORP. - Clerks behind the counters, map blips and opening hours.
- English, Spanish and French.
The Lua is encrypted by Cfx.re; the settings, server settings and text stay editable.
Requirements
- poggy_core (free), version 0.17.0 or newer.
- oxmysql.
- One of VORP, RSG Core or QBCore RedM (poggy_core connects the script to it).
Install
- Download
Britannia_Bankingfrom your Cfx.re account (portal.cfx.re → Assets → Granted Assets). - Put the
Britannia_Bankingfolder in your server'sresourcesfolder. Don't rename it. - Add
ensure Britannia_Bankingtoserver.cfg, afterensure oxmysqlandensure poggy_core. - Stop any other bank script. Only one script can be poggy_core's bank, and two bank scripts would share the same counters.
- Restart the server. Its database tables are created automatically.
Items
The script adds no items. Safe deposit boxes are inventory containers.
Configuration
Settings are in shared/config.lua, and every option is commented. Text is in locales/.
| Setting | What it does | Default |
|---|---|---|
Config.Locale | Language file to use: en, es or fr | 'en' |
Config.Debug | Prints extra lines in the server and F8 consoles | false |
Config.Key | The key that opens the bank at a counter | 'G' |
Config.OpenDistance | How close (metres) a player must stand to the counter | 2.0 |
Config.NpcDistance | How close a player must be for a branch's clerk to appear | 60.0 |
Config.PerBranch | true = a separate account at every bank; false = one account every bank shares | true |
Config.Currencies | The currencies a bank holds: cash, gold | both |
Config.DefaultHome | Every character's home bank until they choose another | 'Valentine' |
Config.BankProvider | Lets other scripts use bank money through poggy_core (it lands in the home bank) | true |
Config.StatementLines | How many lines the statement shows | 30 |
Config.Hours | Opening hours in game time (a branch can set its own, or none) | 7:00 to 19:00 |
Config.TaxesEnabled | false = no tax anywhere | true |
Config.States | Tax % per state on paying in, taking out and interest | see below |
Config.Interest | Daily interest: Rate (%), Cap (only this much earns), Gold | 0.1%, $2000, no |
Config.Loans | Min, Max, Rate (% added), Days, LateFee (%), AutoCollect | $10 to $200, 10%, 7 days, 10%, on |
Config.Boxes | RentDays (0 = bought once) and the Tiers (label, slots, price) | 7 days; 10, 20, 40 slots |
Config.Branches | Your banks (see below) | 8 towns |
server/sv_config.lua holds a Discord webhook for a log of large deposits, withdrawals and loans (SvConfig.Webhook, SvConfig.LogOver), and how many days statements are kept (SvConfig.StatementDays).
Accounts: one per bank, or one for all
With Config.PerBranch = true, money paid in at Valentine only comes out at Valentine, and the Account page lists what the player holds at other banks. With false, every bank shares one account. You can change it later: on the next start, separate accounts are added together (true to false), or the shared account moves to each character's home bank (false to true).
Taxes
Config.TaxesEnabled = true
Config.States = {
['New Hanover'] = { deposit = 0, withdraw = 1, interest = 10 },
['Lemoyne'] = { deposit = 0, withdraw = 2, interest = 10 },
}Each bank names its state, and the tax is the rate of the state the player is standing in, even with one shared account. Interest tax is taken from the interest paid, not from the balance. Cash tax goes to the treasury when a treasury script is running; otherwise it leaves the economy. A bank can also set its own rates with taxes = { withdraw = 3 }.
Branches
{
id = 'Valentine', -- never change it later (accounts are saved under it)
label = 'Valentine Bank',
state = 'New Hanover', -- whose taxes apply
coords = vector4(-308.55, 776.01, 118.75, 198.64), -- where the player stands at the counter
npc = { model = 'S_M_M_BankClerk_01', coords = vector4(-307.98, 773.99, 118.75, 26.78) }, -- or false
blip = true,
-- hours = false, -- always open
}Commands and permissions
There are no player commands: players use the counter. In the server console, bank_balance <character id> prints a character's accounts and loan.
Other scripts can use these server exports:
exports.Britannia_Banking:GetBalance(charId, 'cash', branchId) -- branchId nil = the home bank
exports.Britannia_Banking:AddMoney(charId, 'cash', 25, branchId, 'reason')
exports.Britannia_Banking:RemoveMoney(charId, 'cash', 25, branchId, 'reason') -- false when it doesn't hold enoughHow it works
Paying in and taking out. Every check is made on the server: the player must be at the counter, have the money on them (or in the account), and the tax is worked out there. Taking out takes the amount from the account and the player gets it minus the tax.
Home bank. Each character has a home bank (Config.DefaultHome until they press "Make this my home bank"). Other scripts' bank money, such as wages, lands in its cash account.
Interest. Once a day (real time), each account earns Rate % of its balance, up to Cap.
Loans. One loan at a time. The cash is handed over at the counter, and the amount owed is the loan plus Rate %. Pay back any amount from the pocket or the account. When the due date passes, LateFee % is added once and, with AutoCollect, the bank takes what it can from the character's accounts every few minutes.
Safe deposit boxes. One box per character per bank. The first rent is paid at the counter; after that it's taken from that bank's account every RentDays. If the account can't pay, the box is locked until the rent is paid at the counter. Players can move up a size; giving a box up needs it empty.
Troubleshooting
Nothing happens at the counter
Stand closer (Config.OpenDistance). Outside opening hours the player is told when the bank opens.
"Could not register as poggy_core's bank"
Another bank script is running. Stop it, or set Config.BankProvider = false.
The clerk doesn't appear
Check the model name in npc. The F8 console prints a line for a model that isn't valid.
Version history
- 1.0.1: tidier config.
- 1.0.0: first release.
Still stuck?
Open a ticket on our Discord with your framework, your poggy_core version and what you see, and we'll help you get it running.
Get help on Discord