Bridges & integrations ​
np_billiards talks to the framework, the inventory and the society banking through bridges in bridge/, and to
every np_* sibling directly. np_prophandler is required; every other integration is optional, detected with GetResourceState and called through
pcall, so a missing resource or export degrades a feature instead of breaking a handler.
Framework ​
| Bridge | Resource | Character id | Jobs (owners, referees) | Money |
|---|---|---|---|---|
esx |
es_extended | xPlayer.identifier |
Job, grade, grade_name = 'boss', onDuty |
money (cash), bank |
qbx |
qbx_core | citizenid | Job, grade, boss flag, duty | cash, bank |
qb |
qb-core | citizenid | Job, grade, boss flag, duty | cash, bank |
standalone |
none | the np_character character, else the license | np_admin nodes np_billiards.job.<job>[.<grade>], np_billiards.boss.<job> |
In-memory wallet from Config.StandaloneMoney (lost on restart) |
Auto-detection order (Config.Framework = 'auto'): es_extended → qbx_core → qb-core → standalone. es_extended is the
first target. Names come from the framework (or np_character). Loading, unloading and job changes come from the
framework events and from np_character:loaded / np_character:unloaded; a character switch leaves the match.
Inventory ​
| Bridge | Resource | Metadata | Items | Use |
|---|---|---|---|---|
np_inventory |
np_inventory | yes | Registered at runtime (RegisterItem) |
server.export = 'np_billiards.useItem' |
ox |
ox_inventory | yes | Add them to data/items.lua (Items) |
server.export = 'np_billiards.useItem' |
qb |
qb-inventory | yes (item info) | Add them to the shared items | CreateUseableItem |
esx |
the ESX inventory | no | sql/items_esx.sql |
RegisterUsableItem |
none |
none | no | – | Everybody plays with the house cue |
Auto-detection order (Config.Inventory = 'auto'): np_inventory → ox_inventory → qb-inventory → the ESX inventory
→ none. Without metadata an owned cue is always Config.DefaultOwnedCue.
Society ​
Bar income (fees, house cut, rake, cup rake) and the cloth recovery cost go through the society bridge.
| Bridge | Resource | Account |
|---|---|---|
esx |
esx_addonaccount | society_<society> shared account (esx_society) |
qb |
qb-banking, else qb-management | Job account <society> |
renewed |
Renewed-Banking | Job account <society> |
none |
none | Income is only tracked in np_billiards_revenue |
Table fees charged through np_payments name the society as the payee, so np_payments credits it itself and they don't go through this bridge.
np_prophandler ​
A hard dependency (1.1.0+), no fallback: np_billiards creates no objects of its own.
| Use | How | Exports |
|---|---|---|
Spawned and runtime tables (no world) |
Streamed props np_billiards:<table> registered by the server, removed with RemoveTable and registered again on np_prophandler:ready. The client binds to the prop once it has spawned. Vanilla tables are map objects and need nothing |
registerProps, removeProps (server); getPropEntity (client) |
| Balls | Immediate local props, no collision, moved and rolled by the replay | createLocal, getLocalEntity, deleteLocal |
| Cue in the hand | Synced attachment (key cue), so the bar sees it |
attach, getAttachedEntity, detach |
| Cue on the aim line | An immediate local prop moved every frame; the hand cue is hidden from your own view meanwhile | createLocal, getLocalEntity, deleteLocal |
| Vanilla balls on a bound table | World model hides np_billiards:hide_<table>_<n> (3 m, one per model of Config.VanillaBallModels) with keepScriptObjects = true, so np_billiards' own balls and cue of the same models stay visible. Removed with the table, registered again on np_prophandler:ready |
hideWorldModel, removeWorldModel (server) |
np_* siblings ​
Config.UseNp<Name> = false (or Config.Payments = false) forces the fallback.
| Sibling | Used for | Exports | Without it |
|---|---|---|---|
| np_admin | Permission nodes (npAdmin.can), Resource settings, staff actions, audit log (npAdmin.log), staff alerts (npAdmin.notifyStaff), the server theme |
the vendored lib bridge/np_admin.lua |
Console, np_admin_fallback identifiers, ESX groups in np_admin_fallback_groups; plain Nimbus |
| np_inventory | Item definitions, cue metadata, busy lock while playing | RegisterItem, GetItemCount, GetSlotsWithItem, AddItem, RemoveItem, SetMetadata, CanCarryItem; client isOpen, setBusy |
Another inventory bridge, or the house cue |
| np_payments | Fees, stakes, bet and cup entries; refunds | Charge, CanAfford, Refund |
The framework account Config.PayAccount |
| np_hud | Toasts (challenge invites with Accept / Decline actions), the table prompt, HUD zone claims while playing or spectating | Notify, ShowPrompt, HidePrompt, ClaimZones |
np_billiards' own NUI toasts, prompt and invite card |
| np_phone | The Pool League app, pushes, the Dynamic Island | registerStoreApp, registerAppRpc, notify, setIsland, clearIsland, sendAppMessage |
Toasts only; no app |
| np_menu | Play pool and Owner tablet context options on the table props | addContextOption |
The E prompt and /poolroom |
| np_drugs | Blood alcohol for the aim sway | GetBodyState |
esx_status drunk, state bags, SetDrinks |
| np_discord | Logs to Config.DiscordChannel |
Log |
np_admin audit log only |
| np_character | Standalone character ids and names | getActiveCharacter, getCharacter |
The license and the FiveM name |
| np_minigames | Guards your turn: games other resources start for you are refused (or let through with the clock held), and the input pauses while any game is open. See below | RegisterHook; client IsActive |
Nothing to guard |
np_payments in detail ​
exports.np_payments:Charge(src, Config.PayAccount, amount, {
merchant = { id = 'np_billiards:<bar>', label = '<bar label>', sub = 'Billiards', icon = 'circle-dot', tint = 'green' },
payee = { type = 'society', id = '<society>' }, -- table fees; stakes and bets: { type = 'none' }
category = 'other', reason = 'Table fee', metadata = { resource = 'np_billiards', kind, ref },
})
No sheet opens: the player agreed in the lobby or the bet panel. A failed charge answers Not enough money. Refunds
use exports.np_payments:Refund(ref); payouts go to the framework account (Config.PayoutAccount), because
np_payments has no credit export. See np_payments → Charge and
Stakes, fees & escrow.
np_admin in detail ​
- Nodes
np_billiards.admin,np_billiards.owner,np_billiards.refereeunder Billiards (Permissions). - Settings from
shared/np_admin_settings.lua; the manifest'snp_admin_settingsandnp_admin_configentries let np_admin list them while np_billiards is stopped. - Theme. The NUI follows np_admin's server theme (brand colour, strength, frosted or Liquid Glass).
Config.Material = 'frosted' | 'liquid'orConfig.Brandoverride it for this resource. See np_admin → Server theme.
Drinks without np_drugs ​
esx_status (esx_optionalneeds drunk), the state bags drunk, alcohol and drinks, and
SetDrinks all feed the same level; the highest wins. See Drinks.
np_minigames ​
np_minigames took the cue stroke (english and power) as its stroke game. np_billiards keeps its own stroke, server physics and referee; the two only make sure
they don't fight over the screen:
- Your turn is guarded. np_billiards registers a
beforeStarthook with np_minigames (again whenever np_minigames restarts). While it is your shot (placing ball in hand or aiming), a game another resource starts for you (a heist door, a staff Send a minigame, the np_minigames arcade) is refused withresult.reason = 'busy', and you get one toast. Games np_billiards starts itself and those fromallowFromalways pass. - Or it is let through. With
whilePlaying = 'allow'(or for anallowFromresource) the game opens and the server holds the shot clock (a full clock after it) until np_minigames reports the result (holdClock). - Any game open on screen pauses your input (
pauseShot): it releases the table UI and blocksshoot/placeon the client until the game ends. This also covers local client games the hook never sees.
Config.UseNpMinigames = 'auto' -- false: no hook, no pause
Config.Minigames = {
whilePlaying = 'refuse', -- 'refuse' | 'allow'
scope = 'turn', -- 'turn' (your shot) or 'match' (any time you are in a match, also while the other shoots)
allowFrom = {}, -- resources whose games always get through, e.g. { 'np_banking' } ('np_minigames' = staff sends + arcade)
reason = 'busy', -- refusal reason the caller gets back
notify = true, -- toast the player when a game was turned down (once per 10 s)
holdClock = true,
pauseShot = true,
}
Without np_minigames nothing changes.