A personal account is your framework’s own bank balance. Reading it and moving money work whether or not that player is connected.
Accounts
GetAccount
Returns an account, ornil when there is no such account.
string
required
A job or gang name, an account number, or a player identifier.
GetAccountBalance
Returns the balance, ornil when there is no such account.
string
required
The account to read.
GetPlayerAccounts
Returns every savings, society and shared account this player may use, each with theirrole and permissions.
A society the player holds through their job or gang only appears while they are connected.
string
required
The player’s identifier.
GetPlayerAccountNumber
Returns a player’s personal account number.string
required
The player’s identifier.
GetIdentifierByAccountNumber
The reverse: the identifier behind a personal account number, ornil.
string
required
A personal account number, with or without spacing.
CreateAccount
Opens a society, shared or business account. Returns the account, ornil and a reason (exists, invalid, invalid_name, database).
string
required
What the account is called.
string
"society", "shared" or "business". Defaults to "shared".string
Required for a society account: the job or gang name. Required for a business account: an id of your own, prefixed with your resource (
myshop:24_7), up to 50 characters. Shared accounts are given a number.string
The identifier of the player who owns it. A business account may have none while nobody owns it.
number
What it opens with. Defaults to
0.DeleteAccount
Closes an account. The balance is not returned to anyone: move it first.string
required
The account to close.
RenameAccount
string
required
The account to rename.
string
required
The new name.
SetAccountOwner
Hands a shared or business account to another player. A business account may be left with nobody (nil) while it is between owners; its money stays.
string
required
The account.
string
The new owner.
nil leaves a business account unowned; a shared account always has one.SetAccountFrozen
A frozen account can be seen but not used.string
required
The account to freeze or unfreeze.
boolean
required
true to freeze it.Money
AddAccountMoney
Pays into an account and records the move with your reason.string
required
The account to credit.
number
required
A positive whole amount.
string
What it was for. This is what shows in the history.
RemoveAccountMoney
Takes money out. Returnsfalse when the balance cannot cover it; the balance can never go negative.
string
required
The account to debit.
number
required
A positive whole amount.
string
What it was for.
TransferMoney
Moves money between any two accounts and writes both halves of the transfer. Returnsfalse and a message when it cannot.
string
required
The account paying.
string
required
The account being paid.
number
required
A positive whole amount.
string
What it was for.
Members
AddAccountMember
Gives a player access to a shared or business account.string
required
The account.
string
required
The player being added.
table
Any of
deposit, withdraw, transfer and manage. Deposit only by default. Members of a business account never get manage.UpdateAccountMember
Changes what an existing member may do.string
required
The account.
string
required
The member.
table
required
The permissions to set.
RemoveAccountMember
string
required
The account.
string
required
The member to remove.
ClearAccountMembers
Removes every member at once.string
required
The account.
GetAccountMembers
Returns everyone with access, with their names and permissions.string
required
The account to read.
Transactions
AddTransaction
Writes a line in the history without moving money, for scripts that move it themselves and want it labelled properly. When tracking already caught that move on a personal account, this names that line instead of adding a second one.string
required
The account the line belongs to.
string
required
deposit, withdraw, transfer_in, transfer_out, income or expense.number
required
A positive whole amount.
string
What it was for.
string
Who was on the other side.
GetTransactions
Returns a page of the history with its totals.string
required
The account to read.
number
Which page. Defaults to
1.number
Rows per page, up to
500. Defaults to 25.table
Any of
types, search, dateFrom and dateTo.Bills & loans
CreateBill
Sends a bill to a player. Returns its id, ornil and a reason.
string
required
Who pays: an identifier or an account number.
number
required
A positive whole amount.
string
Where the money lands when it is paid. Leave it out for a fine that leaves the economy.
string
What the bill is for.
string
The name on the bill. Defaults to the account’s name, or your resource.
number
Unix time. Defaults to the days set in
/bankadmin.PayBill
Pays a bill on the player’s behalf. The only export that needs them connected, because paying takes their transaction lock. Returnsfalse and a message when it cannot.
number
required
The bill id.
string
Which of their accounts pays. Defaults to their personal one.
CancelBill
Withdraws an unpaid bill.number
required
The bill id.
GetBills
Returns the bills sent to a player, newest first.string
required
The player.
string
unpaid, paid, declined, cancelled or expired. All of them when left out.GetLoan
Returns the loan a player is paying off, ornil.
string
required
The player.
Point of sale
A register’s menu belongs to a business listed in/bankadmin under Point of sale; accountId is that society’s id.
GetPosProducts
Returns a register’s menu.string
required
The business.
AddPosProduct
Adds a product to a register’s menu. Returns its id, ornil and a reason.
string
required
The business.
string
required
What the product is called on the register.
number
required
A whole amount.
0 lists it without a price, for a boss to set.string
The tab it sits under.
string
An inventory item, for the picture.
RemovePosProduct
number
required
The product id.
Other
OpenBank
Opens the bank for a player from the server.number
required
The player.
string
"bank", "atm", "admin", "bill" or "pos". Defaults to "bank"; "admin" is refused without the ACE permission.RequestPin
Shows the player the bank’s PIN pad and waits. Returnstrue when they enter the right PIN, and at once when PINs are off in /bankadmin or the account has none, so you can always call it and the server’s settings decide. Returns false when they close the pad, run out of the ATM’s three tries, or already have the bank open.
number
required
The player.
string
A shared or business account to check instead of the player’s own PIN.
GetConfig
Returns the live configuration as/bankadmin last saved it. Logging is not included.
string
One of
general, currency, banks, blip, atm, accounts, transfers, transactions, bills, requests, pos, savings or loans. Every section when left out.Events
lation_banking:transaction
Fires on the server for every movement the bank records, on any account, with the row as stored. This is how another resource keeps its own copy of a balance in step, see Business accounts.Hooks
Server hooks live inserver/utils/hooks.lua, which ships open under escrow. Edit the functions in place to add your own rules and reactions.
Looking for an export we don’t have listed here? Contact us and we’ll do what we can!
