Commands & Exports

This section lists all available commands, exports, and events included in the script. You’ll find client-side, server-side, and shared functions designed to help developers integrate, extend, or interact with the system easily within their own scripts or frameworks.


Server Exports

This section provides all available server exports for the script. These functions allow developers to interact with the system from the server side, manage data, trigger actions, and integrate with other resources. Each export includes a clear description and a practical example to simplify its implementation.

CreatePlayerAccount

The CreatePlayerAccount export creates a new bank account for a player with a specified name, initial balance, and list of authorized users. This is useful for initializing custom accounts such as business or shared accounts within your banking system.


How to Use

To create a new bank account for a player, pass their source ID, the desired account name, starting balance, and a table of authorized users:

-- Replace the values accordingly
local playerId = 1 -- Player's source ID
local accountName = "business_main"
local accountBalance = 10000
local accountUsers = {1, 2, 3} -- Source IDs of other authorized users

exports['qs-banking']:CreatePlayerAccount(playerId, accountName, accountBalance, accountUsers)

This export is ideal for creating custom bank accounts such as business wallets, gang funds, or faction accounts that multiple users can access.

CreateJobAccount

The CreateJobAccount export initializes a bank account tied to a specific job or organization. It sets up the account with a given name and starting balance. This is useful for scripts that need to create shared financial accounts for jobs like police, EMS, or mechanic shops.


How to Use

To create a job-linked account, provide the name of the account and the initial balance:

-- Replace with your job account name and starting balance
local accountName = "police_funds"
local accountBalance = 50000

exports['qs-banking']:CreateJobAccount(accountName, accountBalance)

This export is ideal for roleplay servers where factions or jobs need centralized funds, such as police departments, government groups, or business entities.

CreateGangAccount

The CreateGangAccount export creates a shared bank account for a gang or criminal group. You define the account's name and its initial balance. This is useful for systems where gangs manage shared money for operations like drug trafficking, weapon purchases, or laundering.


How to Use

To create a gang account, pass the account name and starting balance:

-- Replace with the gang account name and starting balance
local accountName = "ballas_account"
local accountBalance = 30000

exports['qs-banking']:CreateGangAccount(accountName, accountBalance)

This export is ideal for criminal roleplay systems that include gangs, mafias, or cartels needing centralized and trackable funds.

CreateBankStatement

The CreateBankStatement export logs a transaction into a player's bank account history. It includes the transaction amount, reason, type (deposit, withdrawal, etc.), and account type (personal, job, gang). This is useful for keeping an accurate record of player or faction financial activity.


How to Use

To add a new statement entry, provide the player's source ID, account name, amount, transaction reason, statement type, and account type:

-- Example usage:
local playerId = 1 -- Source ID of the player
local account = "personal_main"
local amount = 1500
local reason = "Vehicle purchase"
local statementType = "withdraw" -- "deposit" or "withdraw"
local accountType = "personal" -- "personal", "job", or "gang"

exports['qs-banking']:CreateBankStatement(playerId, account, amount, reason, statementType, accountType)

This export is ideal for systems that need detailed transaction logs for audits, UIs, or admin monitoring tools.

GetAccount

The GetAccount export retrieves detailed information about a specific bank account using its name. This includes current balance and other metadata. It’s useful for scripts that need to display or validate account data before performing operations.


How to Use

To fetch data from an account, simply pass the account name:

-- Example usage:
local accountName = "gang_vagos"
local accountData = exports['qs-banking']:GetAccount(accountName)

if accountData then
    print("Current balance: " .. accountData.balance)
else
    print("Account not found")
end

This export is ideal for scripted systems that automate income, such as completed tasks, job rewards, or scheduled payments.

GetAccountBalance

The GetAccountBalance export returns the current balance of a specified bank account by its name. It’s a quick and efficient way to retrieve just the numeric balance without extra account metadata.


How to Use

To get the balance of an account, pass the account name:

-- Example usage:
local accountName = "police_funds"
local balance = exports['qs-banking']:GetAccountBalance(accountName)

print("Current balance: $" .. balance)

This export is ideal for scripts that need to check an account's available funds before proceeding with purchases, payouts, or resource checks.

AddMoney

The AddMoney export adds a specified amount of money to a bank account, optionally including a reason for the transaction. This is useful for rewarding jobs, missions, or scripted events that require deposits into job, gang, or personal accounts.


How to Use

To deposit funds into an account, pass the account name, the amount to add, and an optional reason:

-- Example usage:
local accountName = "mechanic_funds"
local amount = 2000
local reason = "Job payout"

exports['qs-banking']:AddMoney(accountName, amount, reason)

This export is ideal for scripted systems that automate income, such as completed tasks, job rewards, or scheduled payments.

RemoveMoney

The RemoveMoney export withdraws a specific amount of money from a bank account, optionally including a reason. This is useful for deducting funds due to purchases, fines, service costs, or scripted penalties.


How to Use

To subtract money from an account, pass the account name, the amount to remove, and an optional reason:

-- Example usage:
local accountName = "business_main"
local amount = 1200
local reason = "Office furniture purchase"

exports['qs-banking']:RemoveMoney(accountName, amount, reason)

This export is ideal for shop systems, automated services, or penalties that require securely removing funds from personal, job, or shared accounts.

GetGangAccount

The GetGangAccount export retrieves detailed information about a specific gang bank account using its name. This includes current balance and other related data. It’s useful for managing and displaying gang finances in scripts involving criminal activities or gang systems.


How to Use

To get data from a gang account, pass the account name:

-- Example usage:
local accountName = "ballas_account"
local gangAccountData = exports['qs-banking']:GetGangAccount(accountName)

if gangAccountData then
    print("Gang balance: " .. gangAccountData.balance)
else
    print("Gang account not found")
end

This export is ideal for gang management systems, heist scripts, or any feature requiring real-time access to shared criminal funds.

AddGangMoney

The AddGangMoney export adds funds directly to a gang's shared bank account. You specify the account name, the amount to deposit, and an optional reason for the transaction. This is useful for scripts that reward gangs for activities like robberies, drug deals, or territory control.


How to Use

To deposit money into a gang account, pass the account name, amount, and an optional reason:

-- Example usage:
local accountName = "vagos_account"
local amount = 5000
local reason = "Territory payout"

exports['qs-banking']:AddGangMoney(accountName, amount, reason)

This export is ideal for criminal roleplay mechanics that automate income for gangs or factions, maintaining a clean transaction history.

RemoveGangMoney

The RemoveGangMoney export subtracts a specified amount of money from a gang's bank account, optionally including a reason. This is useful for gang-related systems where funds are spent on weapons, vehicles, bribes, or laundering processes.


How to Use

To withdraw money from a gang account, provide the account name, amount, and an optional reason:

-- Example usage:
local accountName = "mafia_funds"
local amount = 2500
local reason = "Weapon shipment"

exports['qs-banking']:RemoveGangMoney(accountName, amount, reason)

This export is ideal for managing gang expenses in criminal economy systems, ensuring transparent and trackable financial flows for roleplay or balancing purposes.