Installation ​
Requirements ​
- A recent FiveM server artifact (Lua 5.4)
- oxmysql
- np_prophandler 1.1.0+: cabinets of spawned boards, the darts on the board and in your hand, the placement ghost
- np_npchandler: the house regular
All three are hard dependencies in fxmanifest.lua; start them before np_darts.
- Node 18+ to build the NUI once
Optional, auto-detected at start with GetResourceState:
| Kind | Resources | Used for |
|---|---|---|
| Framework | es_extended, qbx_core, qb-core | Characters, names, jobs (pub owners), money fallback, the ESX admin group for staff without np_admin. Without one, np_darts runs standalone (np_character aware) |
| Inventory | np_inventory, ox_inventory, qb-inventory, the default ESX inventory | Dart sets, flights, free pints. Without one you play with house darts and sets kept in the profile |
| Payments | np_payments | Stakes, rental, the pro shop, sisal, league and cup entries as checkout sheets; refunds. Without it the framework account is charged |
| HUD and phone | np_hud, np_phone | Toasts, prompts, zone claims, announcements; the Oche app and the live score island |
| Staff | np_admin, np_discord | Permission nodes, Resource settings, staff tools, the audit log, the server theme; Discord logs and staff roles |
| Other np_* siblings | np_menu, np_drugs, np_character | Third-eye options, blood alcohol, character names. See Bridges & integrations |
| Other | esx_status (esx_optionalneeds) | The drunk status for the sway model |
| Zones | np_colshape | Pub and board presence on the server as colshapes. Needed on FiveM Legacy only, GTAV Enhanced has the natives built in. Without it, distance checks as before |
Steps ​
- Put the folder into your resources as
np_darts. The NUI callshttps://np_darts/rpc, the chalkboard loadsnui://np_darts/web/dist/chalk.html, np_phone loadsweb/dist/phone.htmlfrom it and other resources callexports.np_darts, so keep the name. - Build the UI once:shThis creates
cd web && npm install && npm run buildweb/dist/index.html(HUD, scoreboard, lobby, dart case, profile, owner panel),web/dist/phone.html(the Oche app) andweb/dist/chalk.html(the chalkboard on the pub wall). Withoutweb/distthe UI stays blank. - Database: the tables (all prefixed
np_darts_) are created on start (Config.AutoCreateTables = true). To create them by hand, runsql/np_darts.sql. - Start order in
server.cfg. The framework and the inventory are detected once, at start, so start them before np_darts. np_prophandler and np_npchandler must start before it too:cfgThe other siblings are checked when they are used, and np_darts re-registers its items and the phone app when np_inventory or np_phone start later.ensure oxmysql ensure np_prophandler ensure np_npchandler ensure es_extended # or qbx_core / qb-core ensure np_inventory # or ox_inventory / qb-inventory ensure np_payments ensure np_hud ensure np_phone ensure np_admin # optional ensure np_darts - Items: with np_inventory nothing to do, they are registered at runtime. For the default ESX inventory run
items/esx_items.sql; for ox_inventory and qb-inventory add the entries. See Items. - Pub owners: set
owner = { job = 'yellowjack', grade = 2 }(oridentifiers = { 'license:…' }) per pub inshared/config_pubs.lua. See Pubs. - Staff: nothing goes into
server.cfg. See Permissions.
At start the console prints one line: [np_darts] ready · framework esx · inventory np_inventory · payments np_payments · np_admin on.
Permissions ​
np_darts never uses ACE. Every staff check is one call, npAdmin.can(src, node), of the np_admin lib that ships in
bridge/np_admin.lua (np_admin stays optional: no dependency, no @np_admin include).
With np_admin its permission matrix decides alone, per staff group or single player,
with wildcards (np_darts.*) and denies. The nodes show up under the category Darts:
| Node | Grants |
|---|---|
np_darts.admin |
Staff tools (end a match with refunds, give a dart set, free every board), /darts end |
np_darts.place |
Place and remove dartboards at any pub (/darts place <pub>) |
np_darts.owner |
Open the owner panel of every pub, act as owner everywhere |
np_darts.league |
Create and start leagues and cups at any pub |
Pub owners need no node: they are owners by job grade, identifier or character (see Pubs).
Without np_admin a player is staff when one of these says so:
- the server console (
src0); - np_admin's own fallback: identifiers in the convar
np_admin_fallback("license:abc,discord:123") and, on es_extended, the groups innp_admin_fallback_groups(defaultadmin,superadmin); - their identifier is in
Config.Admin.identifiers; - their ESX group is in
Config.Admin.groups(admin,superadmin,god); - np_discord runs and they hold one of
Config.Discord.staffRoles(HasAnyRole).
In the fallback every staff member holds every node. See Concepts → Permissions.
Tables ​
| Table | Holds |
|---|---|
np_darts_players |
One row per character (cid): stats, heatmap, doubles, milestones, form, ratings, XP, perks, loadout, owned sets, flair, settings, challenges (JSON data) |
np_darts_pubs |
Owner data per pub: house rule overrides, balance, revenue per day (35 days), sisal wear and rotation, nights, records |
np_darts_boards |
Boards placed in game (id, pub, coords, heading) |
np_darts_matches |
Finished matches: pub, board, mode, stake, rake, winner, details |
np_darts_match_players |
Players per match with result and average |
np_darts_escrow |
Every held stake, cup entry and owed payout with its status (held, paid, refunded, refund_due, payout_due) |
np_darts_leagues |
Leagues with players, fixtures and status |
np_darts_cups |
Cups with players, bracket, pot and status |
Check it works ​
- Walk up to the board in the Yellow Jack. The prompt shows
Eset up a match andQchalk your name. Eopens the lobby. Pick Practice and throw: holdLMB, let go in the white pips./dartsopens your profile,/darts loadoutthe dart case.- With a second player: challenge them with a small stake. Both get a checkout sheet; the winner is paid at the end.
Troubleshooting ​
| Problem | Fix |
|---|---|
| Blank screen, nothing visible | Build the NUI (web/dist missing) |
oxmysql is not started, darts data can not be stored |
Start oxmysql before np_darts |
| No prompt at a board | The pub is enabled = false (Hen House, Bahama Mamas and the MC clubhouses ship disabled), or you stand too far from the oche (Config.Interact.distance) |
| MC clubhouse boards float in the void | The interior isn't loaded on your server. Load it (IPL / interior proxy) or leave those pubs disabled |
| Stakes say payments unavailable | Config.Payments = true but np_payments isn't running. Start it, or set 'auto' |
| Dart sets missing (ox / qb / ESX) | Add the items to the inventory's item list (ESX: run items/esx_items.sql) |
/darts owner says you are not the owner |
Check owner of the pub in config_pubs.lua (job name and minimum grade, or identifiers), or grant np_darts.owner |
| Dart props sit at a wrong angle or depth | Tweak Config.Native.dartRotation and Config.Native.board.dartDepth |
| You can barely see the board | Intoxication reached the blackout level. Coffee or water from np_inventory steadies the hand |