copy Copy chevron-down
💰 BankingExports Comprehensive instructions on configuring files and utilizing export functions.
triangle-exclamation
Prior experience as a developer or basic programming skills are recommended to effectively navigate this section of the documentation.
Banking Exports
This module provides a set of exports to interact with the banking system. (server side only)
You can use these exports from other resources with:
Copy exports[ " crm-banking " ]: functionName (args) 🔸getSocietyMoney
Returns the current balance of a society account.
Copy local crm_balance = exports[ " crm-banking " ]: getSocietyMoney (crm_owner) crm_owner (string) – The society/job name (e.g. "police").
(number| nil) – The current balance, or nil if the account doesn’t exist.
Copy local crm_balance = exports[ " crm-banking " ]: getSocietyMoney ( " police " )
print ( " Police Department - Bank Balance: " .. tostring (crm_balance)) 🔸setSocietyMoney
Sets the exact balance of a society account.
crm_owner (string) – The society/job name.
crm_amount (number) – The new balance to set.
( boolean) – true if updated successfully, false otherwise.
🔸addSocietyMoney
Adds a specific amount to a society’s balance.
Parameters
crm_owner (string) – The society/job name.
crm_amount (number) – The amount to add.
Returns
(boolean) – true if successful, false otherwise.
Example
🔸removeSocietyMoney
Removes a specific amount from a society’s balance.
Parameters
crm_owner (string) – The society/job name.
crm_amount (number) – The amount to remove (must be greater than 0).
Returns
(boolean) – true if successful, false otherwise.
Example
🔸createSocietyAccount
Creates a new society account.
Parameters
crm_owner (string) – The society/job name.
crm_label (string, optional) – The display label of the account.
crm_budget (number, optional) – The starting balance (default = 0).
Example
🔸getSocietyAccount
Returns the full account data of a society account.
Parameters
crm_owner (string) – The society/job name.
Returns
(table | nil) – Account data table or nil if not found.
Example
🔸getSocietyIban
Returns the IBAN of a society account.
Parameters
crm_owner (string) – The society/job name.
Returns
(string | nil) – The IBAN, or nil if the account doesn’t exist.
Example
🔸addSocietyTransaction
Creates a transaction entry for a society account.
Parameters
crm_owner (string) – The society/job name.
crm_amount (number) – The transaction amount.
crm_type (string) – The transaction type (e.g. "crm-deposit", "crm-withdraw").
crm_description (string) – A short reason for the transaction.
crm_by (number, optional) – Player server ID (source) who made the transaction. Optional, can be left nil
Returns
(boolean) – true if logged successfully, false otherwise.
Example
🔸getAccountByIban
Returns the full account table for a given IBAN.
Parameters
crm_iban(string) – The IBAN of the account you want to retrieve.
Returns
( table | nil) – The account table if found, otherwise nil.
Example
🔸getPlayerAccounts
Returns all banking accounts owned by a specific player.
Parameters
crm_owner (string) – The owner identifier (character identifier).
Returns
(table) – A table (array) of all matching account rows. Will return an empty table if the owner has no accounts.
Example
🔸deletePlayerAccounts
Deletes all accounts belonging to a specific owner.
Parameters
crm_owner (string) – The owner whose accounts should be deleted.
crm_source(number | nil) – (Optional) The source/player who triggered the deletion.
Used for logging purposes.
Returns
(boolean) – true if the process executed, false if crm_owner was invalid.
Example
🔸addTransaction
Creates a transaction entry for any account.
Parameters
crm_data (table) – The transaction details.
Example