All settings live in shared/config.lua. The file is in escrow_ignore
so it remains editable after install. Locale strings live in two places,
both editable: shared/locales/<lang>.lua covers notifications and
target labels, nui/js/locales/<lang>.js covers the ATM screen and the
bank app. Webhook URLs and the PIN secret live in server-config.lua,
which is never sent to players; its logging settings are documented at
the end of this page.
Behaviour you may want to change in code, such as notifications, blips,
bankers, target options, who counts as an admin or who may spend a
company's money, lives in the open files in bridge/. See
Customisation hooks at the end of this page.
Internal calibration (the 3D ATM panels and their IK geometry, animation dictionaries, camera offsets, cache TTLs, sound effect mapping) is set inside the encrypted resource and is not part of this file.
General#
Config.Localestring'en'Active locale, applied to both the ATM and the bank app. Shipped values: 'en', 'fi', 'de', 'fr', 'pt-br', 'es', 'tr', 'nl', 'it', 'pl'.
Config.UseTargetbooleantrueUse a targeting system (ox_target / qb-target) for ATM and bank-ped interactions. If false, falls back to proximity prompts.
Config.TargetSystemstring'ox_target'Target resource name. One of 'ox_target', 'qb-target', 'qtarget'.
Session#
Config.Session.timeoutSecondsnumber120Inactivity timeout before the ATM session is killed.
Config.Session.pinAttemptsnumber3Allowed wrong-PIN attempts before lockout.
Config.Session.lockoutDurationnumber300Lockout duration in seconds after exceeding pinAttempts.
3D ATM panels#
Accounts#
Config.Accounts.autoCreateDefaultbooleantrueWhen a player without a default account uses an ATM, create one automatically.
Config.Accounts.autoCreateAccountTypestring'personal'Type assigned to the auto-created default account.
Config.Accounts.autoCreateAccountNamestring'Personal Account'Display name assigned to the auto-created default account.
Config.Accounts.autoCreateLinkBankBalancebooleantrueIf true, mirror the framework's bank balance onto the linked personal account on login.
Config.Accounts.nameMinLengthnumber3Minimum allowed length for an account name.
Config.Accounts.nameMaxLengthnumber32Maximum allowed length for an account name.
Config.Accounts.allowOwnerClosebooleantrueOwners can close their own accounts.
Config.Accounts.allowOwnerFreezebooleanfalseOwners can freeze their own accounts.
Config.Accounts.adminGroupsstring[]{ 'admin', 'superadmin', 'mod' }Framework group names treated as bank admins.
Config.Accounts.adminPermissionsstring[]{ 'admin', 'god' }Additional QBCore permissions recognized as bank admins.
Config.Accounts.adminAcePermissionstring'command.nx_realbanking_admin'ACE permission checked for admin actions.
Shared accounts#
Inventory / cash item#
Config.Inventory.useOxInventoryForCashbooleanfalseWhen true, deposit and withdraw flows write the cash item directly through ox_inventory instead of calling the framework's AddMoney / RemoveMoney. Use this if your server renamed the cash item and the framework's auto-sync no longer fires.
Config.Inventory.moneyItemstring'money'ox_inventory item name that represents cash. Common values: 'money', 'cash'. Only used when useOxInventoryForCash is true.
PIN code#
Config.Pincode.enabledbooleantruefalse removes PINs completely: ATMs open straight on the player's first account, the bank app and nx_computer's Banking app show no PIN card, onboarding step or PIN fields, new accounts take no PIN, and SetInitialPin answers success without setting anything. PINs already set stay stored and apply again if you switch it back on.
Config.Pincode.changeCostnumber100Fee charged when the user changes their PIN. First creation is free.
Config.Pincode.resetCostnumber200Fee charged for a PIN reset (no old PIN required).
Config.Pincode.allowSequentialbooleanfalseWhether players may set a run of consecutive digits such as 1234 or 4321. Off means those PINs are refused.
Config.Pincode.allowRepeatedbooleanfalseWhether players may set the same digit four times, such as 1111. Off means those PINs are refused. PINs are always 4 digits; attempts and lockout are set under Config.Session.
The bank app checks a weak or repeated new PIN before sending it, so a refused PIN costs the player nothing. Two fixed limits protect PIN changes in the bank app. Creating, changing and resetting a PIN share a spam guard of 10 requests a minute. A wrong current PIN on a change is counted on its own: after 5 in 5 minutes the player has to wait, and the bank app tells them for how long. A successful change clears that count. The ATM's own wrong-PIN lockout is set under Session.
Fees#
Each fee block shares a shape: { enabled, type = 'percentage' | 'flat', value, minFee?, maxFee? }.
Config.Fees.withdrawaltable{ enabled=false, type='percentage', value=1.5, minFee=1.00, maxFee=50.00 }Charged on ATM withdrawals, on top of the amount requested: the player receives what they asked for and the account loses amount + fee. Ships disabled so updating does not change your economy.
Config.Fees.transfertable{ enabled=true, type='flat', value=2.50, sameBankFree=true }Charged on transfers. sameBankFree waives the fee for transfers between accounts of the same player.
Config.Fees.deposittable{ enabled=false, type='flat', value=0 }Taken out of the deposit: the player hands over the amount and the account is credited amount - fee. Ships disabled.
Transaction limits#
Config.LimitstablePer-account-tier limits: default, premium, business, savings. Each entry: { dailyWithdrawal, dailyDeposit, dailyTransfer, transactionMax, transactionMin }. Shipped defaults use a deliberately permissive ceiling. Tighten these for your economy.
Sounds#
Config.Sounds.volumenumber0.5Scales the whole ATM sound mix (0.0 to 1.0). 0.5 is the shipped level, 0.0 mutes the ATM.
Security#
Config.Security.logLevelstring'basic'One of 'none', 'basic', 'verbose', 'paranoid'. Controls how much detail is written to the security audit log. The bank app's Security Center reads from these logs, so 'basic' is the minimum if you want session and PIN events to appear there. Set to 'none' to silence all security logs.
Config.Security.restartFreezebooleantruePauses deposits, withdrawals, transfers and payments from the one-minute restart warning until the restart (txAdmin, or any restart manager that sends txAdmin's restart events), so no money moves after your framework's last save. A skipped restart lifts the pause. Missing counts as true.
Config.Security.anticheattable{ distanceChecks=true, teleportDetection=false, speedHackDetection=false, injectionDetection=false }Anti-exploit toggles. Distance checks are cheap and recommended. The movement checks are heuristics and ship off, because an admin teleport menu or a vehicle launcher will trip them. injectionDetection refuses malformed payloads from a client.
Config.Security.thresholdstable{ rapidTransactions=10, largeTransfer=50000, dailyLimitPercent=90 }Heuristic thresholds for flagging suspicious activity. These flag, they do not hard-block.
ATMs#
Config.ATMPropstableArray of ATM prop definitions. Each entry: { model = `hash`, type = 'standalone' | 'wall' | 'maze_bank' }. Shipped models: prop_atm_01, prop_atm_02, prop_fleeca_atm, v_5_b_atm1, v_5_b_atm2.
Blips#
Config.Blipstable{ enabled=false, sprite=207, color=2, scale=0.8, label='ATM', shortRange=true }Global toggle for ATM blips. Per-location visibility is still controlled by Config.ATMLocations[i].blip.
Config.ATMLocationstableATM marker / blip definitions at fixed coordinates. Each entry: { coords = vector3, name = string, blip = boolean }.
Bank locations#
Config.BankLocationstableArray of in-world bank-access points. Each entry: { coords = vector3, heading, type = 'fleeca' | 'pacific' | 'blaine' | 'maze', label, blip, ped }. Peds spawn with the given model and scenario. Targeting a banker triggers nx_realbanking:server:openBank.
Bank interactions#
Config.BankInteractions.targetOptionstable{ label='Access Bank', icon='fa-solid fa-building-columns', distance=2.5 }Options surfaced when a player targets a bank ped or counter.
Config.BankInteractions.markertableMarker placed at bank locations. Fields: enabled, type, color {r,g,b,a}, size, bobUpAndDown, faceCamera, rotate. Disabled by default in favor of target-based interaction.
Config.BankInteractions.drawDistancenumber15.0Maximum distance at which markers and 3D text are drawn.
Config.BankInteractions.text3dtable{ enabled=false, scale=0.35, color={r=255,g=255,b=255,a=255} }Optional 3D text prompt above bank peds.
Config.BankInteractions.keybindtable{ enabled=true, key=38, label='E' }Proximity keypress, used only when Config.UseTarget is false. If you turn targeting off, leave this on or players cannot reach the bank peds.
Societies (job invoicing)#
Config.SocietiestableMap of job name to { label, account, canBill, canInspect, finePresets, requireReason, payGrade }. Shipped jobs: police, sheriff, ambulance, mechanic, taxi, realestate, cardealer. Each finePresets is an array of { label, amount } quick-fill options surfaced in the invoice UI. payGrade (optional) is the lowest grade that may pay invoices sent to this company; bosses always can.
Every society here can also receive invoices. See Company invoices.
To add societies while the server runs, for example from a company script, use RegisterSociety. Entries written here always take priority.
Society accounts#
A job's society money appears in the bank app's account list as its own
account, for the players allowed to spend it (bosses, payGrades, the
society's payGrade and the Society funds grant, the same players who
may pay company invoices). They can see its balance
and history, deposit and withdraw cash at a bank, and transfer to and from
it. nx_computer's Banking app lists it too. The money stays in the
framework's society account.
Every company has an account number in the same ACC_… shape as a
personal account. The bank app and nx_computer show that number, and the
ATM accepts it for transfers. Anyone can pay a company by its number; only
the players above can move money out, and nobody else ever sees the
balance. An invoice sent to the number bills the company. Numbers are
created once per job and kept in the nx_realbanking_society_numbers
table. Scripts can look them up with
GetSocietyAccountNumber.
Config.SocietyAccounts.enabledbooleantrueShow society accounts in the bank app and accept company account numbers. Off hides them and refuses transfers to and from a company account.
Config.SocietyAccounts.depositbooleantrueCash deposits into the company account at a bank.
Config.SocietyAccounts.withdrawbooleantrueCash withdrawals from the company account at a bank.
Config.SocietyAccounts.transferbooleantrueTransfers to and from the company account, at the bank, the ATM and on the laptop. Off also stops other players paying the company by its number.
Config.SocietyAccounts.ignoreJobstable{ 'unemployed' }Jobs that mean 'no job'. They never get a company account, an account number, company invoices or payer notices. Without the key, unemployed is still ignored. Add your own 'no job' job names here.
Reports, Security and Members are not kept for a society account, and the bank app says so on those tabs.
Freelance billing#
Config.FreelanceBilling.enabledbooleantrueMaster toggle for freelance (player-to-player) invoicing.
Config.FreelanceBilling.maxAmountnumber10000Maximum amount for a single freelance invoice.
Config.FreelanceBilling.minAmountnumber10Minimum amount for a single freelance invoice.
Config.FreelanceBilling.requireDescriptionbooleantrueReject freelance invoices without a description.
Config.FreelanceBilling.cooldownSecondsnumber60Anti-spam cooldown between invoices issued by the same player.
Config.FreelanceBilling.allowOfflinePlayersbooleanfalseWhether freelance invoices can be addressed to offline players.
Invoices#
Config.Invoices.enablePersonalbooleantrueEnable player-to-player personal invoices.
Config.Invoices.enableSocietybooleantrueEnable job-issued society invoices.
Config.Invoices.allowSelfInvoicebooleantrueAllow a player to send an invoice to themselves.
Config.Invoices.personalRequireAcceptancebooleanfalsePersonal invoices require the receiver to accept before they can be paid. Only meaningful with allowDecline on.
Config.Invoices.allowDeclinebooleanfalseLet receivers, players and companies alike, refuse an invoice. Off removes the Decline buttons from the bank app, and the server refuses a decline from anywhere, including the DeclineCompanyInvoice export.
Config.Invoices.acceptanceTimeoutCheckIntervalnumber5Minutes between sweeps that expire un-accepted personal invoices.
Config.Invoices.onlyOnlineTargetsbooleantrueRestrict invoice creation to currently online recipients.
Company invoices#
Players can send an invoice to a company instead of a person: the bank app's
Send invoice form has a Company option next to Nearby and Server ID, and it
lists every society in Config.Societies except the sender's own. The company
pays it from its society account, so it never reaches anyone's personal bill
list, autopay or Pay all.
Who may pay a company invoice, checked on the server:
- a boss of that job (ESX grade name
boss, QBCore and Qboxisboss), always - a grade at or above
Config.Invoices.company.payGrades[job], or the society's ownpayGrade - a grade a boss gave Society funds in nx_employeemanagement's Permissions tab, or in nx_computer's Employees app when nx_employeemanagement is not running
That is the stock rule of
Custom.CanUseSocietyFunds, which you can
change. The same players may use the company's
society account.
Those players see the company's open invoices under Received invoices in
the bank app, with the company balance and a Pay from company button,
plus Decline when Config.Invoices.allowDecline is on. Nobody can
invoice their own employer, and a payer cannot pay an invoice they sent.
Players can also address an invoice to a company's account number. To
limit who may invoice which company, edit
Custom.CanInvoiceCompany.
Config.Invoices.company.enabledbooleantrueAllow invoices addressed to a company. Off hides the Company option and the server refuses them.
Config.Invoices.company.payGradestable{}Per job, the lowest grade that may pay the company's invoices, e.g. { mechanic = 3 }. Bosses can always pay.
Config.Invoices.company.employeeManagementbooleantrueGrades given Society funds in nx_employeemanagement may pay too. Ignored when nx_employeemanagement is not running.
Config.Invoices.company.maxPendingnumber25Open invoices one company can hold. Further invoices to it are refused until some are paid or declined.
Phone notifications#
A new invoice also lands on the receiver's phone when nx_phone runs, in the Wallet. For a company invoice every online member who may pay it gets one. The bank works the same without nx_phone, and a player without a phone or with Wallet notifications switched off simply gets none.
Config.PhoneNotifications.enabledbooleantrueSend new-invoice notifications to the phone.
Config.PhoneNotifications.resourcestring'nx_phone'Phone resource whose Notify export is called.
Config.PhoneNotifications.appIdstring'cards'Phone app that shows the notification and opens on tap (nx_phone's Wallet).
Invoice limits#
Config.InvoiceLimits.maxPendingtable{ received=20, sent=10 }Hard cap on simultaneously pending invoices per player, split by direction.
Config.InvoiceLimits.maxAmountnumber100000Maximum amount a single invoice may carry.
Config.InvoiceLimits.minAmountnumber1Minimum amount a single invoice may carry.
Config.InvoiceLimits.dailyLimittable{ enabled=true, maxCreated=50, maxAmount=500000 }Per-player daily cap on invoice count and total amount issued.
Config.InvoiceLimits.expirationtable{ enabled=true, days=30 }When enabled, invoices become overdue after `days`. This is the default due date when the sender does not choose one.
Invoice due dates#
Senders may choose when an invoice falls due: nx_computer's Banking app
offers a "Due in" choice, and the CreateInvoice and CreateFine exports
take dueDays or dueAt. A society billing as itself uses its own range,
so some societies can send longer-due bills than others.
Config.InvoiceDue.minDaysnumber1Shortest due date a sender may choose, in days.
Config.InvoiceDue.maxDaysnumber30Longest due date a sender may choose, in days.
Config.InvoiceDue.outOfRangestring'clamp''clamp' moves a date outside the range to its nearest edge. 'reject' refuses it with DUE_OUT_OF_RANGE. Fines always clamp.
Config.InvoiceDue.societiestable{}Per Config.Societies job: minDays, maxDays and defaultDays, e.g. { realestate = { maxDays = 90 } }. Fines from that job take its minDays and maxDays too, inside Config.Fines.maxDueDays.
VAT#
Config.VAT.enabledbooleanfalseApply VAT on top of invoice amounts.
Config.VAT.ratenumber10.0VAT percentage.
Config.VAT.govAccountstring'society_government'Society account that receives collected VAT.
Config.VAT.applyToSocietybooleantrueApply VAT to society-issued invoices.
Config.VAT.applyToFreelancebooleantrueApply VAT to freelance-issued invoices.
Config.VAT.showBreakdownbooleantrueDisplay VAT as a separate line in the invoice UI.
Commission#
Config.Commission.societyInvoicestable{ enabled=true, percent=5.0, minAmount=10, maxAmount=500 }Commission on society invoices, clamped between minAmount and maxAmount.
Config.Commission.freelanceInvoicestable{ enabled=false, percent=0.0, minAmount=0, maxAmount=0 }Commission on freelance invoices. Disabled by default.
Autopay#
Config.Autopay.enabledbooleanfalseAuto-debit invoices that pass their due date.
Config.Autopay.daysnumber7Days after the due date at which autopay attempts settlement.
Config.Autopay.checkIntervalnumber60Minutes between autopay sweeps.
Config.Autopay.notifyBeforetable{ enabled=true, daysBefore=1 }Notify the player before autopay runs against them.
Config.Autopay.onFailuretable{ applyInterest=true, interestRate=5.0, notifyPlayer=true }Behavior when autopay cannot collect funds. interestRate is the percentage added per failed attempt.
Fines#
Fines are bills issued by other resources on behalf of an agency, such as police tickets from nx_computer's MDT. The player pays them in the bank app like any other invoice. See Fines for the exports.
Config.Fines.enabledbooleantrueMaster switch. Off makes every fine export return fines_unavailable.
Config.Fines.allowedResourcesstring[]{ 'nx_computer' }Resources that may issue, cancel and read fines. Any other caller gets not_allowed.
Config.Fines.dueDaysnumber7Days to pay when the issuing resource does not say.
Config.Fines.maxDueDaysnumber90Longest due date a resource may set.
Config.Fines.maxAmountnumber1000000Largest single fine.
Config.Fines.autopaybooleantrueCollect overdue fines from an online player's bank, without interest.
Config.Fines.checkIntervalnumber5Minutes between checks that mark unpaid fines past their due date as overdue.
Config.Fines.notifyReceiverbooleanfalseSend the in-game new-invoice notice for a fine. Off by default because the issuing resource sends its own.
Credit cards#
Config.Credit.enabledbooleantrueMaster toggle. If false, all credit-card exports return CREDIT_DISABLED.
Config.Credit.itemstable{ givePhysicalCard=true, creditCardItem='credit_card' }ox_inventory item name that represents a credit card, and whether to give the physical item on approval.
Config.Credit.billingtableBilling cycle knobs: inGameDayMinutes, cycleDays, dueDays, checkIntervalSeconds, interestIntervalDays, minimumPaymentPercent, minimumPaymentFlat. In-game days compress real-world billing windows into a gameplay-friendly pace.
Config.Credit.scoretableCredit score model: min/max bounds, base score, stable-job bonus, bank-balance thresholds, account-age bonus, payment bonuses and penalties, usage bonus, and a usage-bonus cap (cardUsageBonusCap). These numbers drive tier eligibility.
Config.Credit.penaltiestable{ lateFeeFlat=250, lateFeePercent=2.5, collectionsThreshold=50000, autoSeizeEnabled=true }Late fees and collections behavior. autoSeizeEnabled will seize funds from linked accounts when debt exceeds collectionsThreshold.
Config.Credit.limitstable{ maxActiveCards=2, maxSingleCharge=25000 }Hard limits on cards per player and the maximum value of a single charge.
Config.Credit.atmCashAdvancetableATM cash-advance flow: enabled, autoFallbackOnInsufficient, requirePhysicalCard, merchant label, transactionType identifier.
Config.Credit.tierstableTier definitions keyed by tier id. Shipped: standard, gold, black. Each: label, creditLimit, interestRate, graceInterestRate, graceDays, minimumScore, requiresStableJob, whitelistedJobs. The black tier whitelists specific jobs.
Config.Credit.tierPrioritystring[]{ 'black', 'gold', 'standard' }Order used when auto-assigning a tier from score. Highest eligible tier wins.
Discord logging#
These live in server-config.lua, not shared/config.lua. A webhook URL
lets anyone holding it post as your server, so keep it in that file and
regenerate it in Discord if it ever leaks.
Config.Logging.enabledbooleantrueMaster switch for all Discord logging.
Config.Logging.defaultWebhookstring''Used by any enabled category that has no webhook of its own. Leave this and every category webhook empty and nothing is sent.
Config.Logging.botNamestring'NX Banking'Name shown on the messages. The category is appended, so a security message posts as 'NX Banking - Security'.
Config.Logging.botAvatarstring''Optional avatar image URL for the messages.
Config.Logging.mentionRoleIdstring''Role id pinged on critical events only. Empty means never ping. Everything else posts with notifications suppressed so a busy channel does not spam your staff.
Config.Logging.flushSecondsnumber3How long an event may wait to be grouped with others. Lower feels more live, higher is quieter. Critical events ignore this and send immediately.
Config.Logging.maxQueuedEventsnumber500Backlog limit per channel. If Discord cannot keep up, the oldest events are dropped and the next message reports how many were lost.
Config.Logging.categoriestableOne entry per category: transactions, security, invoices, credit, accounts, admin. Each takes enabled, webhook, label, mode and minSeverity. transactions also takes minAmount to ignore small movements.
Config.Logging.privacytable{ includeIp=false, includeIdentifiers=false }Citizen ids are always shortened in the message. These two opt in to also recording the player's IP address and full identifier list. An IP counts as personal data in most jurisdictions.
Categories#
Each category can point at its own channel. An empty webhook falls back
to defaultWebhook.
| Category | Covers | Volume | Default |
|---|---|---|---|
security | Exploit attempts, PIN lockouts, permission violations, money that failed to reconcile | Low | On |
accounts | Accounts created, closed, frozen, renamed, handed over, plus shared account membership | Low | On |
admin | Invoice deletions, player financial inspections, export-driven actions | Low | On |
invoices | Created, paid, cancelled, auto-paid, expired | Medium | Off |
credit | Applications, charges, statements, late fees, collections | Medium to high | Off |
transactions | Deposits, withdrawals, transfers | High | Off |
transactions and credit ship off because they are busy enough to
deserve a channel of their own. Turn them on once you have somewhere to
put them.
Modes#
mode controls how much room each event gets.
| Mode | Behaviour |
|---|---|
embed | One message block per event. Readable, best for low volume. |
digest | Many events collapsed into a single table. Best for transactions. |
off | Category disabled. |
Severity#
minSeverity drops anything below the level you set: info, warning
or critical. Auto-payments, credit interest and member removals are
warnings. Exploit attempts and debt seizures are critical.
Activity log#
Also in server-config.lua. One structured row per bank action (transfers,
ATM cash, company accounts, invoices and fines, cards, accounts and PINs,
staff actions, refused requests), handed to Format.SendLog at the bottom
of bridge/logs.lua, where you connect your own logging. It does nothing
until you do. Rows never hold a PIN, card number, IP or identifiers.
Config.Logs.EnabledbooleanfalseBuild rows and call Format.SendLog. Off means no rows are built at all.
Config.Logs.MinAmountnumber0Withdrawals, deposits and transfers below this are not logged.
Config.Logs.ContentbooleanfalseAlso include the memo players type on transfers.
Customisation hooks#
The files in bridge/ stay readable and editable in the escrowed release.
They hold the decisions a server usually wants to make its own: who is an
admin, who may spend a company's money, how notices and blips look, which
target options appear. The escrowed code calls each function at the point
its comment names, so keep the function names, arguments and return
values when you edit one.
| File | What it covers |
|---|---|
bridge/server.lua | Admins, company money, who may invoice a company, a check before and after every withdrawal, deposit and transfer, the credit-card item, phone notices |
bridge/client.lua | Notifications, extra checks before the ATM or bank opens, blips, bankers, target options, keybind-mode prompts |
bridge/logs.lua | How each event looks in Discord |
bridge/esx.lua, bridge/qbcore.lua | Framework calls: player data, money, items and society accounts |
bridge/init.lua | Framework detection. Set forceFramework to 'esx', 'qbcore' or 'qbox' to skip auto-detection |
If you keep your own copy of a bridge file across an update, compare it with the new one. See Updating.
Server#
Custom.IsAdminserverStaff check for frozen-account overrides, PIN resets for other players and the admin invoice tools. The server console always counts as admin and never reaches this. Stock rule: Config.Accounts.adminGroups, adminPermissions and adminAcePermission.
Parameters
- source number
- Server id of the player.
- player table
- The framework player object.
Returns
booleanfunction Custom.IsAdmin(source, player) return IsPlayerAceAllowed(source, 'group.admin')endCustom.CanUseSocietyFundsserverMay this player spend a company's money? Covers the company's society account in the bank app and on the laptop (withdraw, deposit, transfer out) and paying invoices addressed to the company. Paying into a company by its account number is open to anyone and does not ask this.
Parameters
- player table
- The framework player object.
- job string
- The company (job name).
Returns
boolean-- Stock rule: a member of the job who is boss, or at or above-- Config.Invoices.company.payGrades[job] (or the society's payGrade),-- or whose grade has Society funds in nx_employeemanagement / nx_computer.function Custom.CanUseSocietyFunds(player, job) local playerJob = NX_REALBANKING.Framework.GetJob(player) return playerJob and playerJob.name == job and playerJob.isBoss == trueendCustom.CanInvoiceCompanyserverMay this player send an invoice to a company? Asked when the Send Invoice form lists companies, and again when an invoice to a company is sent. The feature switches and the rule that nobody bills their own employer are checked first. Stock rule: anyone who may send invoices at all.
Parameters
- source number
- Server id of the sender.
- player table
- The framework player object.
- job string
- The company being billed.
- invoiceType 'personal' | 'society' | nil
- nil while listing companies; 'personal' for a freelance invoice, 'society' when billing as their own company.
Returns
boolean-- Only working businesses may bill the police departmentfunction Custom.CanInvoiceCompany(source, player, job, invoiceType) if job == 'police' then return invoiceType == 'society' end return trueendA refused company disappears from the Send Invoice form and from
GetBillingRights, and
sending to it anyway fails with NO_BILL_PERMISSION. If this function is
missing from your bridge/server.lua, or throws an error, every company
can be billed and the error is printed to the server console.
Custom.CanTransactserverRuns before every withdrawal, deposit and transfer, before anything is checked or moved. Return false and a message to refuse; the message is shown on the ATM screen or in the bank app exactly as you wrote it.
Parameters
- source number
- Server id of the player.
- kind 'withdraw' | 'deposit' | 'transfer'
- What the player is doing.
- data table
- withdraw and deposit: { accountId, amount }. transfer: { fromAccount, toAccount, amount, description }.
Returns
boolean ok, string|nil reasonfunction Custom.CanTransact(source, kind, data) if kind == 'withdraw' and Player(source).state.isCuffed then return false, 'You cannot use the bank while restrained' end return trueendCustom.OnTransactionserverRuns after every successful withdrawal, deposit and transfer, with the same kind and data as CanTransact. result.amount, result.fee and result.newBalance are the settled numbers.
Parameters
- source number
- Server id of the player.
- kind 'withdraw' | 'deposit' | 'transfer'
- What the player did.
- data table
- As for CanTransact.
- result table
- The result of the transaction.
function Custom.OnTransaction(source, kind, data, result) if kind == 'withdraw' and result.amount >= 50000 then TriggerEvent('my_police:largeWithdrawal', source, result.amount) endendBoth hooks cover the ATM, the bank app and transfers made on a laptop or
phone through OnlineTransfer,
for personal and company accounts alike. A company account arrives as its
account number (or society:<job> when a script passed that);
NX_REALBANKING.SocietyAccounts.JobOf(id) returns the job behind it. The
Integration API exports (AddMoney, RemoveMoney, Transfer), invoice
payments and phone card payments do not pass through them. An error
inside either hook is printed to the server console and the transaction
goes ahead.
Custom.NotifyPhoneserverA new invoice for a player, or for a company they may pay for. The stock version sends a Wallet notification through nx_phone's Notify export, following Config.PhoneNotifications. Point it at another phone here. Keep failures silent: the in-game notice is sent either way.
Parameters
- source number
- Server id of the player.
- title string
- Notification title.
- message string
- Notification text.
- threadKey string
- Groups notices about the same invoice.
The credit-card item has three hooks of its own in the same file:
| Function | Called when |
|---|---|
Custom.GiveCreditCard(source, itemName, card, info) | A card is issued. Gives the physical item with its metadata; return false if it could not be given, and the application is rolled back. |
Custom.HasCreditCard(source, itemName) | Before an ATM cash advance, when Config.Credit.atmCashAdvance.requirePhysicalCard is on. |
Custom.RegisterCardMetadata() | Once the credit system is on, to register the inventory labels for the card's metadata. Return true when done; it is retried otherwise. |
Client#
Custom.NotifyclientEvery notice the player sees from the ATM, the bank and invoices. The stock version calls lib.notify.
Parameters
- data table
- { title?, description, type? ('info' | 'success' | 'warning' | 'error'), duration? }
function Custom.Notify(data) exports['my_notify']:Show(data.description, data.type or 'info', data.duration)endCustom.CanUseATMclientRuns after the built-in checks (dead, cuffed, already at an ATM) and before the card goes in. Return false and a message to refuse.
Parameters
- atm table
- { entity, coords, hash }
Returns
boolean ok, string|nil reasonCustom.CanUseBankclientRuns before the bank app opens at a banker. Return false and a message to refuse.
Returns
boolean ok, string|nil reasonCustom.AddBankTargetclientPuts the target options on a banker, or on a box zone at the bank when it has no banker: Access Bank, My Open Invoices and Check a Person's Unpaid Invoices. Return 'entity' when the options sit on the ped itself, so they are added again when a banker respawns.
Parameters
- bank table
- The Config.BankLocations entry.
- index number
- Its position in Config.BankLocations.
- ped number|nil
- The banker, if one spawned.
- actions table
- { open, inspect, canInspect, myInvoices, canMyInvoices }. Call these from your options.
Returns
'entity' | 'zone' | nilMy Open Invoices tells the player how many open invoices they have and
the total, then opens the bank on the invoices page; with none open it just
says so. It is shown while invoices are switched on. The option comes from
actions.myInvoices, so a bridge/client.lua edited before this option
existed will not show it until you copy the myInvoices option from the
new Custom.AddBankTarget.
The rest of bridge/client.lua:
| Function | Called when |
|---|---|
Custom.CreateATMBlip(location) | Once per Config.ATMLocations entry. Return the blip, or nil for none. |
Custom.CreateBankBlip(bank) | Once per Config.BankLocations entry. Return the blip, or nil for none. |
Custom.SpawnBankPed(bank) | A banker is needed. Return the ped, or nil for none, in which case the target falls back to a box zone. A missing banker is respawned through this. |
Custom.SetupBankPed(ped, bank) | From the stock SpawnBankPed, and every 15 seconds for a banker that has been knocked loose. Freezes it and makes it ignore the world. |
Custom.DeleteBankPed(ped) | The resource stops. |
Custom.AddATMTarget(models, onUse, canUse) | Makes every Config.ATMProps model usable. Call onUse(entity, model) to start the ATM; canUse() is false while one is already open. |
Custom.RemoveATMTarget(models) | The resource stops. |
Custom.AddPlayerInvoiceTarget(onSelect) | Only with Config.Invoices.targetMenuEnabled on. Adds Send Invoice on other players; call onSelect(serverId). Return true once registered. |
Custom.ShowPrompt(kind, coords) / Custom.HidePrompt(kind) | Keybind mode only (Config.UseTarget = false): the player came within reach of an ATM or banker, or left. kind is 'atm' or 'bank'. The stock version shows nothing; lib.showTextUI is the usual choice. |
Custom.DrawBankMarker(bank) | Every frame within draw distance while Config.BankInteractions.marker is enabled. |
Custom.DrawBankText(coords, text) | Every frame near a banker while Config.BankInteractions.text3d is enabled. |
The stock target options support ox_target and qb-target, and the ATM
also qtarget, following Config.TargetSystem. Any other target resource
plugs in here.
Discord formatting#
bridge/logs.lua decides what each Discord message says. Delivery,
batching and Discord's rate limits are handled for you; webhooks and
categories stay in server-config.lua.
NX_REALBANKING.LogFormat.TransformserverEvery event headed for a webhook, before it is queued. Change the entry and return it, or return nil to keep it out of Discord. The nx_realbanking:server:bankEvent event has already fired by then, so returning nil does not hide the event from other resources.
Parameters
- entry table
- { event, category, severity, source?, citizenId?, playerName?, headline?, summary?, digest?, fields?, footer? }
Returns
table|nil entryfunction Format.Transform(entry) if entry.event == 'withdraw' and entry.severity == 'info' then return nil -- keep routine withdrawals out of Discord end return entryend| Function or table | What it controls |
|---|---|
Format.Embed(entry) | The embed for one event, in a category set to embed mode. |
Format.Digest(events, category) | One embed holding many events as lines, in a category set to digest mode. Each event brings its own line in entry.digest. |
Format.Message(category, label, highest) | The message around the embeds: bot name, avatar, the role mention on critical events, and silent delivery for everything else. |
Format.Colors | Embed colour per severity. |
Format.Limits | Discord's size limits. Discord rejects, rather than trims, anything longer, so cut text with the file's Truncate helper. |
Framework and society money#
bridge/esx.lua and bridge/qbcore.lua (Qbox uses the QBCore file) hold
every framework call: players, money, items and society accounts. If your
company money lives in a script other than esx_addonaccount,
qb-management or qbx_management, change GetSocietyBalance,
AddSocietyMoney and RemoveSocietyMoney there and every society feature
follows: invoices, fines, society accounts, company account numbers and
the Integration API.
