Exports
This section is aimed at developers. Basic scripting knowledge will help you get the most out of it.
Banking Exports
These server-side exports let you interact with the banking system from any other resource.
Call them like this:
exports["crm-banking"]:functionName(args)getSocietyMoney
Returns the current balance of a society account.
local crm_balance = exports["crm-banking"]:getSocietyMoney(crm_owner)Parameters
crm_owner(string) – The society/job name (e.g."police").
Returns
- (number| nil) – The current balance, or
nilif the account doesn’t exist.
Example
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.
exports["crm-banking"]:setSocietyMoney(crm_owner, crm_amount)Parameters
crm_owner(string) – The society/job name.crm_amount(number) – The new balance to set.
Returns
- (boolean) –
trueif updated successfully,falseotherwise.
Example
if exports["crm-banking"]:setSocietyMoney("police", 20000) then
print("Police Department - Balance set to $20000")
endaddSocietyMoney
Adds a specific amount to a society’s balance.
exports["crm-banking"]:addSocietyMoney(crm_owner, crm_amount)Parameters
crm_owner(string) – The society/job name.crm_amount(number) – The amount to add.
Returns
- (boolean) –
trueif successful,falseotherwise.
Example
exports["crm-banking"]:addSocietyMoney("mechanic", 1500)removeSocietyMoney
Removes a specific amount from a society’s balance.
exports["crm-banking"]:removeSocietyMoney(crm_owner, crm_amount)Parameters
crm_owner(string) – The society/job name.crm_amount(number) – The amount to remove (must be greater than 0).
Returns
- (boolean) –
trueif successful,falseotherwise.
Example
exports["crm-banking"]:removeSocietyMoney("ambulance", 1000)createSocietyAccount
Creates a new society account.
exports["crm-banking"]:createSocietyAccount(crm_owner, crm_label, crm_budget)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
exports["crm-banking"]:createSocietyAccount("police", "LSPD Treasury", 10000)getSocietyAccount
Returns the full account data of a society account.
local crm_account = exports["crm-banking"]:getSocietyAccount(crm_owner)Parameters
crm_owner(string) – The society/job name.
Returns
- (table | nil) – Account data table or
nilif not found.
Example
local crm_account = exports["crm-banking"]:getSocietyAccount("mechanic")
if crm_account then
print("Balance:", crm_account.crm_balance)
endgetSocietyIban
Returns the IBAN of a society account.
local crm_iban = exports["crm-banking"]:getSocietyIban(crm_owner)Parameters
crm_owner(string) – The society/job name.
Returns
- (string | nil) – The IBAN, or
nilif the account doesn’t exist.
Example
local crm_iban = exports["crm-banking"]:getSocietyIban("police")
print("Police IBAN:", crm_iban)addSocietyTransaction
Creates a transaction entry for a society account.
exports["crm-banking"]:addSocietyTransaction(crm_owner, crm_amount, crm_type, crm_description, crm_by)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 leftnil
Returns
- (boolean) –
trueif logged successfully,falseotherwise.
Example
exports["crm-banking"]:addSocietyTransaction("police", 1000, "deposit", "Fine collected", source)getAccountByIban
Returns the full account table for a given IBAN.
exports["crm-banking"]:getAccountByIban(crm_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
local crm_account = exports["crm-banking"]:getAccountByIban("USA18SO410707070500")
if crm_account then
print(crm_account.crm_owner)
print(crm_account.crm_type)
endgetPlayerAccounts
Returns all banking accounts owned by a specific player.
exports["crm-banking"]:getPlayerAccounts(crm_owner)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
local crm_accounts = exports["crm-banking"]:getPlayerAccounts("Z4VNKWZ5")
for _, crm_account in ipairs(crm_accounts ) do
if crm_account.crm_type == "crm-saving" then
print(crm_account.crm_balance)
end
enddeletePlayerAccounts
Deletes all accounts belonging to a specific owner.
exports["crm-banking"]:deletePlayerAccounts(crm_owner, crm_source)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) –
trueif the process executed,falseifcrm_ownerwas invalid.
Example
local crm_deleted = exports["crm-banking"]:deletePlayerAccounts("Z4VNKWZ5")
if crm_deleted then
print("Accounts deleted.")
endaddTransaction
Creates a transaction entry for any account.
exports["crm-banking"]:addTransaction(crm_data)Parameters
crm_data(table) – The transaction details.
Example
exports["crm-banking"]:addTransaction({
crm_sender = "USA18SO410707070500",
crm_receiver = "USA18SO420709993466",
crm_amount = 1000,
crm_type = 'crm-transfer',
crm_description = 'Money transfer', -- optional
crm_by = source, -- optional
})