Development
Integration Flow
Section titled โIntegration FlowโExternal Resource โ โโโ rs_bank exports โโโโโ Player and business banking โโโ rs_billing exports โโ Invoice lookup and payment โ โโโ rs_mobile_bank โโโโโโ LB Phone frontend using both systemsRS Bank Server Exports
Section titled โRS Bank Server ExportsโGet a Playerโs Bank Balance
Section titled โGet a Playerโs Bank Balanceโlocal balance = exports['rs_bank']:GetBankBalance(source)Add Money to a Player
Section titled โAdd Money to a Playerโlocal success, newBalance = exports['rs_bank']:AddMoneyToBank( source, 2500, 'Payslip: Police Department')Remove Money from a Player
Section titled โRemove Money from a Playerโlocal success, newBalance = exports['rs_bank']:RemoveMoneyFromBank( source, 500, 'Vehicle Registration Fee')Read and Update Credit Score
Section titled โRead and Update Credit Scoreโlocal score = exports['rs_bank']:GetCreditScore(source)
-- Positive or negative adjustmentexports['rs_bank']:UpdateCreditScore(source, 5)exports['rs_bank']:UpdateCreditScore(source, -10)Business Funds
Section titled โBusiness Fundsโ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')Log a Custom Transaction
Section titled โLog a Custom Transactionโexports['rs_bank']:LogTransaction( citizenid, -- Use BUSINESS_jobname for business history 'custom_payment', -- Transaction type 750, -- Amount balanceAfter, 'Custom Service Payment', relatedCitizenId)RS Bank Client Exports
Section titled โRS Bank Client Exportsโ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()
RS Billing Server Exports
Section titled โRS Billing Server ExportsโBilling exports are available when Config.EnableExports = true.
Get Unpaid Invoices
Section titled โGet Unpaid Invoicesโlocal invoices = exports['rs_billing']:GetUnpaidInvoices(citizenid)Pay an Invoice
Section titled โPay an Invoiceโlocal result = exports['rs_billing']:PayInvoice(citizenid, invoiceId)
if result.success then print(('Paid %s'):format(result.amount))endThe player must be online for payment because the export validates and removes their live bank balance.
Get an Invoice
Section titled โGet an Invoiceโlocal invoice = exports['rs_billing']:GetInvoiceById(invoiceId)Get Bills for a Banking Interface
Section titled โGet Bills for a Banking Interfaceโlocal bills = exports['rs_billing']:GetBillsForBank(citizenid)Get Configured Categories
Section titled โGet Configured Categoriesโlocal categories = exports['rs_billing']:GetCategories()Editable Bridge Files
Section titled โEditable Bridge FilesโUse these files when integrating a custom framework, inventory, target, business-management, or phone resource.
| Resource | File | Purpose |
|---|---|---|
rs_bank | server/framework.lua | Server-side framework wrapper |
rs_bank | client/framework.lua | Client-side framework wrapper |
rs_bank | client/target.lua | Bank and ATM target logic |
rs_bank | shared/inventory.lua | Custom receipt and check inventory bridge |
rs_bank | shared/phonemail.lua | Phone mail and notification bridge |
rs_billing | server/framework.lua | Server-side framework wrapper |
rs_billing | client/framework.lua | Client-side framework wrapper |
rs_billing | shared/phonemail.lua | Invoice notification bridge |
rs_billing | bridge/rs_bank.lua | Banking and credit-score connection |
Custom Framework Notes
Section titled โCustom Framework Notesโ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.