Legacy Banking
Integration
Exports and events for calling into legacy-banking from other resources, with working code samples.
Integration
Client exports
OpenBankAt(locationId)
Opens the windowed banking desktop UI for a specific bank location. No-ops if a UI is already open.
-- client-side, any resource
exports['legacy-banking']:OpenBankAt(5)
OpenAtm()
Opens the ATM UI (plays the card-insert scenario/progress first).
-- client-side
exports['legacy-banking']:OpenAtm()
Server exports
Checking balance
-- server-side, e.g. server/main.lua of your resource
local balance = exports['legacy-banking']:GetCheckingBalance(source)
exports['legacy-banking']:AddChecking(source, 250, 'Insurance payout')
exports['legacy-banking']:RemoveChecking(source, 100, 'Repair fee') -- returns false if insufficient funds
Open the desktop UI remotely
-- server-side
exports['legacy-banking']:OpenDesktop(source)
Fires the client event legacy-banking:openDesktop on that player, which calls OpenBankAt(nil).
Society (job) accounts
-- server-side
local bal = exports['legacy-banking']:GetSocietyMoney('police')
exports['legacy-banking']:AddSocietyMoney('police', 500, 'Fine payout')
exports['legacy-banking']:RemoveSocietyMoney('police', 200, 'Supplies')
local society = exports['legacy-banking']:GetSocietyAccount('police')
-- { balance = ..., iban = ..., name = ... }
The same calls also work unmodified via the Renewed-Banking-compatible alias exports (useful if you're integrating a resource that already expects Renewed-Banking):
exports['Renewed-Banking']:getAccountMoney('police')
exports['Renewed-Banking']:addAccountMoney('police', 500) -- reason defaults to 'Deposit'
exports['Renewed-Banking']:removeAccountMoney('police', 200) -- reason defaults to 'Withdrawal'
Boss-initiated society-to-IBAN transfer (e.g. from a bossmenu)
-- server-side
local result = exports['legacy-banking']:SocietyTransfer(source, 'police', {
amount = 1000,
recipient = 'LB123456789012345678', -- destination IBAN
memo = 'Payroll run',
})
-- result = { ok = true/false, reason = '...' }
The caller must be that job's boss — enforced downstream by the transfer pipeline. Routes through the same fee/audit/refund logic as UI-initiated transfers.
ox_lib callbacks
All of these are invoked from client code with lib.callback.await(name, false, params). Put the calling code in your resource's client script (e.g. client/main.lua).
-- Full bootstrap payload for a custom banking UI
local data = lib.callback.await('legacy-banking:getInitData', false)
-- Filtered transaction list (server forces filter.player_id to the caller)
local txs = lib.callback.await('legacy-banking:getTransactions', false, { category = 'ATM' })
-- Send a transfer (IBAN recipient only)
local result = lib.callback.await('legacy-banking:transfer', false, {
amount = 500, recipient = 'LB...', memo = 'Rent',
})
-- Resolve a recipient before sending
local resolved = lib.callback.await('legacy-banking:resolveRecipient', false, 'LB...')
Other available callbacks (all server-side, server/callbacks.lua), for reference:
| Callback | Purpose |
|---|---|
legacy-banking:freezeCard |
Freeze/unfreeze a card you own. |
legacy-banking:reportLostCard |
Mark a card lost. |
legacy-banking:cardDeposit / cardWithdraw |
In-person cash ↔ card-linked-account transfer. |
legacy-banking:orderCard |
Order a new physical debit card (requires a 4-digit pin). |
legacy-banking:changePin / viewPin |
Change or view a card's PIN. |
legacy-banking:atmInit / atmSelectCard / atmVerifyPin / atmWithdraw |
ATM flow steps. |
legacy-banking:openSavings |
Open a personal savings account. |
legacy-banking:openShared |
Open a shared account (charges Config.Shared.OpenCost). |
legacy-banking:sharedInvite / sharedRemove / sharedSetPerm |
Manage shared-account members (owner-only). |
legacy-banking:sharedDeposit / sharedWithdraw |
Move money between checking and a shared account. |
legacy-banking:societyDeposit / societyWithdraw |
Boss-only job-treasury deposit/withdraw. |
legacy-banking:getAdminInit / getLocations / saveLocation / deleteLocation |
Admin bank-placement management (admin-only). |
legacy-banking:getLocationList |
Public — bare location data for rendering peds/blips on every client. |
legacy-banking:phone:init |
lb-phone app bootstrap payload (player, accounts, cards, recent transactions, balance series). |
Events
Server → client
-- Listen for pushed data updates (e.g. to build your own overlay)
RegisterNetEvent('legacy-banking:push', function(payload)
-- payload = { action = 'balanceUpdated' | 'cardsUpdated' | ..., data = {...} }
end)
legacy-banking:openDesktop()— open the desktop UI (no location context).legacy-banking:openAtm— open the ATM UI.legacy-banking:openAdmin— open the admin placement UI (requires admin init to succeed).legacy-banking:notify(data)— shows alib.notify.data = { title = 'Bayview Bank', description, type = 'inform' }.legacy-banking:syncLocations()— re-fetches bank locations and respawns teller peds/blips. Fire this (server-side, broadcast to-1) after any change you make directly to bank location data so clients refresh without a restart.
Shared permission helpers
Loaded on both client and server (shared/). Use these when reasoning about a shared-account member's permission level rather than hardcoding string comparisons:
-- LBPerms.Full = 'full', LBPerms.WithdrawDeposit = 'withdraw_deposit',
-- LBPerms.DepositOnly = 'deposit_only', LBPerms.View = 'view'
if LBCanWithdraw(member.permissions) then
-- allow withdrawal
end
if LBCanManage(member.permissions) then
-- allow invite/remove/set-permission/delete-account (Full only)
end
Never pass a permission string other than one of the four LBPerms values exactly (e.g. 'full', not 'Full') — there is no partial/custom permission support.