⚙️Exports
Comprehensive instructions on configuring files and utilizing export functions.
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.
You can use these exports from other resources with:
exports["crm-banking"]:functionName(args)
🔸getSocietyMoney
Returns the current balance of a society account.
local crm_balance = exports["crm-billing"]:getSocietyMoney(crm_owner)
Parameters
crm_owner
(string) – The society/job name (e.g."police"
).
Returns
(number| nil) – The current balance, or
nil
if the account doesn’t exist.
Example
local crm_balance = exports["crm-billing"]:getSocietyMoney("police")
print("Police Department - Bank Balance: "..tostring(crm_balance))
🔸setSocietyMoney
Sets the exact balance of a society account.
exports["crm-billing"]:setSocietyMoney(crm_owner, crm_amount)
Parameters
crm_owner
(string) – The society/job name.crm_amount
(number) – The new balance to set.
Returns
(boolean) –
true
if updated successfully,false
otherwise.
Example
if exports["crm-banking"]:setSocietyMoney("police", 20000) then
print("Police Department - Balance set to $20000")
end
🔸addSocietyMoney
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) –
true
if successful,false
otherwise.
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) –
true
if successful,false
otherwise.
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
nil
if not found.
Example
local crm_account = exports["crm-banking"]:getSocietyAccount("mechanic")
if crm_account then
print("Balance:", crm_account.crm_balance)
end
🔸getSocietyIban
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
nil
if 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) –
true
if logged successfully,false
otherwise.
Example
exports["crm-banking"]:addSocietyTransaction("police", 1000, "deposit", "Fine collected", source)
Last updated