Skip to content

Bridges & integrations ​

np_golf talks to the framework and the inventory through bridges in bridge/, and to every np_* sibling directly. np_prophandler and np_npchandler are required; every other sibling is detected with GetResourceState and called through pcall. A missing resource or export degrades a feature instead of breaking a handler. Each sibling has its own switch, Config.UseNp<Name> = 'auto' | true | false.

Framework ​

Bridge Resource Character id Notes
esx es_extended xPlayer.identifier First target. cash = ESX money, bank; jobs for a caddie job
qbx qbx_core citizenid
qb qb-core citizenid
standalone none np_character's active character, else the FiveM licence In-memory wallet per character (Config.StandaloneMoney), lost on restart; no jobs (keep Config.Caddie.job = false)

Auto-detection order (Config.Framework = 'auto'): es_extended → qbx_core → qb-core → standalone. The bridges forward character load, unload and job changes, so a player who switches characters gets their own profile and handicap.

Fees go to Config.Economy.payee through np_payments. Without np_payments they are taken from the framework account Config.Economy.account (bank).

Inventory ​

Bridge Resource Metadata Notes
np_inventory np_inventory yes Items registered at runtime (RegisterItem), the golf_bag container read on the server, club wear, lost balls removed, the busy lock while addressing
ox ox_inventory yes Add the items; containers read through GetInventoryItems
qb qb-inventory yes Add the items; no bag containers
esx ESX inventory no sql/esx_items.sql; a golf_bag = a full bag of Config.Items.esxSet
none none – Rental bag and range balls only

Auto-detection order (Config.Inventory = 'auto'): np_inventory → ox_inventory → qb-inventory → ESX → none.

Required handlers ​

Both are hard dependencies. There is no fallback: np_golf creates no objects or peds of its own.

Handler Used for Exports
np_prophandler Balls and tee pegs of every player in the round (or the round you watch) as immediate local props, no collision; a new ball is created where it rests and the flight waits briefly for it. The club in your hands as a synced attachment (key club), so everyone near sees it createLocal, getLocalEntity, deleteLocal, attach, detach (client)
np_npchandler The NPC caddie as an immediate local ped, not frozen so it follows you, with the club bag as a held prop. np_golf still runs its follow and scenario tasks createLocalPed, getPedEntity, deleteLocalPed (client)

np_* siblings ​

Sibling Used for Exports Without it
np_admin Permission nodes (npAdmin.can), Resource settings, the audit log, staff tools, the server theme in the NUI the vendored lib (bridge/np_admin.lua) Console, np_admin_fallback identifiers and ESX groups in np_admin_fallback_groups; plain Nimbus
np_inventory Items, bag, busy lock RegisterItem, GetInventoryItems, GetItemCount, AddItem, RemoveItem, SetMetadata, client setBusy, isOpen, closeInventory Another inventory bridge, or the rental bag
np_payments Green fees, memberships and range buckets through the checkout sheet; stake holds and caddie fees Request, Charge, Refund The framework bank account
np_hud Toasts (actionable invites, prop bets, gimmes), prompts, the green-read progress bar, server-wide ace announcements, zone claims while the golf HUD or a menu is up Notify, ShowPrompt, HidePrompt, Progress, Announce, ClaimZones np_golf's own NUI toasts; GTA help text for prompts
np_phone The Fairway app, notifications, the Dynamic Island registerStoreApp, registerAppRpc, sendAppMessage, notify, setIsland, clearIsland No app
np_menu Invite to golf and Watch their round on players addContextOption, removeContextOption Invites from the clubhouse only
np_discord Log channel Config.DiscordChannel (golf): aces, big bets, Perfect-snap streaks, staff actions Log np_admin's audit log only
np_drugs Blood alcohol widens the swing ("sway") GetBodyState(src).bac No sway
np_character Character ids and names on standalone servers getActiveCharacter, getCharacter The FiveM licence and 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 ​

What Call Merchant / payee
Green fee, cart, range, rental, membership exports.np_payments:Request(src, { merchant, amount, items, category = 'service', payee, preferred = 'bank', receipt = true, timeout = 90 }): the checkout sheet with the line items Los Santos Golf Club · Pro shop (np_golf:lsgc), payee Config.Economy.payee (society golfclub)
Stake hold exports.np_payments:Charge(src, 'bank', amount, { merchant, payee = { type = 'none' }, category = 'service' }) Golf escrow · Held, not spent (np_golf:escrow)
Caddie fee Charge(src, 'bank', fee, { payee = { type = 'player', id = caddieSrc } }) Caddie · <name> (np_golf:caddie)
Unused stakes, failed check-in exports.np_payments:Refund(ref, amount) –

Winnings are paid by np_golf itself to the winner's bank. With Config.UseNpPayments = 'auto' a failed np_payments call falls back to the framework; with true it fails instead. See np_payments → Charging from your resource.

np_minigames ​

np_minigames took the 3-click meter and the putting meter as its swing and putt game. np_golf keeps its own swing, putt and server physics; the two only make sure they don't fight over the screen:

  • Your turn is guarded. np_golf registers a beforeStart hook with np_minigames (again whenever np_minigames restarts). While you have the shot to play and stand at your ball, a game another resource starts for you (a heist door, a staff Send a minigame, the np_minigames arcade) is refused with result.reason = 'busy', and you get one toast. Games np_golf starts itself and those from allowFrom always pass.
  • Or it is let through. With whilePlaying = 'allow' (or for an allowFrom resource) the game opens and the server holds the pace-of-play clock until np_minigames reports the result (holdClock).
  • Any game open on screen pauses your input (pauseSwing): it cancels a half-made swing and pauses input. This also covers local client games the hook never sees.
lua
Config.UseNpMinigames = 'auto'   -- false: no hook, no pause
Config.Minigames = {
  whilePlaying = 'refuse',       -- 'refuse' | 'allow'
  scope = 'turn',                -- 'turn' (your shot, at your ball) or 'round' (any time you are in a round)
  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,
  pauseSwing = true,
}

Without np_minigames nothing changes.