Skip to content

Development

External Resource
โ”‚
โ”œโ”€โ”€ rs_bank exports โ”€โ”€โ”€โ”€โ”€ Player and business banking
โ”œโ”€โ”€ rs_billing exports โ”€โ”€ Invoice lookup and payment
โ”‚
โ””โ”€โ”€ rs_mobile_bank โ”€โ”€โ”€โ”€โ”€โ”€ LB Phone frontend using both systems
local balance = exports['rs_bank']:GetBankBalance(source)
local success, newBalance = exports['rs_bank']:AddMoneyToBank(
source,
2500,
'Payslip: Police Department'
)
local success, newBalance = exports['rs_bank']:RemoveMoneyFromBank(
source,
500,
'Vehicle Registration Fee'
)
local score = exports['rs_bank']:GetCreditScore(source)
-- Positive or negative adjustment
exports['rs_bank']:UpdateCreditScore(source, 5)
exports['rs_bank']:UpdateCreditScore(source, -10)
exports['rs_bank']:AddBusinessMoney(
'police',
5000,
'Government Funding',
citizenid
)
exports['rs_bank']:RemoveBusinessMoney(
'police',
1000,
'Equipment Purchase',
citizenid
)
local businessBalance = exports['rs_bank']:GetBusinessMoney('police')
exports['rs_bank']:LogTransaction(
citizenid, -- Use BUSINESS_jobname for business history
'custom_payment', -- Transaction type
750, -- Amount
balanceAfter,
'Custom Service Payment',
relatedCitizenId
)

These callbacks are used internally by rs_mobile_bank and can also support custom interfaces.

exports['rs_bank']:GetBankData(function(data)
print(json.encode(data))
end)
exports['rs_bank']:Transfer(transferData, function(result)
print(result.success)
end)
exports['rs_bank']:Deposit(amount, accountId, function(result)
print(result.success)
end)
exports['rs_bank']:Withdraw(amount, accountId, function(result)
print(result.success)
end)
exports['rs_bank']:VerifyPIN(pin, function(result)
print(result.success)
end)

Additional client exports include:

  • GetTransactions(callback)
  • GetAccountTransactions(accountType, accountId, callback)
  • UpdateCardStyle(data, callback)
  • IsBankOpen()
  • IsATMOpen()

Billing exports are available when Config.EnableExports = true.

local invoices = exports['rs_billing']:GetUnpaidInvoices(citizenid)
local result = exports['rs_billing']:PayInvoice(citizenid, invoiceId)
if result.success then
print(('Paid %s'):format(result.amount))
end

The player must be online for payment because the export validates and removes their live bank balance.

local invoice = exports['rs_billing']:GetInvoiceById(invoiceId)
local bills = exports['rs_billing']:GetBillsForBank(citizenid)
local categories = exports['rs_billing']:GetCategories()

Use these files when integrating a custom framework, inventory, target, business-management, or phone resource.

ResourceFilePurpose
rs_bankserver/framework.luaServer-side framework wrapper
rs_bankclient/framework.luaClient-side framework wrapper
rs_bankclient/target.luaBank and ATM target logic
rs_bankshared/inventory.luaCustom receipt and check inventory bridge
rs_bankshared/phonemail.luaPhone mail and notification bridge
rs_billingserver/framework.luaServer-side framework wrapper
rs_billingclient/framework.luaClient-side framework wrapper
rs_billingshared/phonemail.luaInvoice notification bridge
rs_billingbridge/rs_bank.luaBanking and credit-score connection

Both core resources contain custom framework branches, but those branches are placeholders. A custom framework requires you to implement the expected player, callback, money, item, and notification functions in the editable framework bridge files.