Skip to content

Items ​

np_darts has two items. House darts need no item: every pub hands them out.

Item What Stack Use
dart_set A set of three darts with its build in the metadata: set, label, uid, barrel, grip, shaft, flight, design, durability, description no (unique) Pick it as your main set in the dart case
dart_flights Fresh flights yes Restores the flight durability of your main set (not the house darts)

The names come from Config.Items.set and Config.Items.flights. Flight durability drops by Config.Items.wearPerMatch (2) per match; below Config.Items.wornBelow (30) the flights are frayed and group wider. Sets come from the pro shop, from rewards and from staff (GiveDartSet, the np_admin action Give dart set).

np_inventory ​

Nothing to do: np_darts registers both items at start (RegisterItem) and again when np_inventory restarts, and asks np_inventory to show barrel, grip and flight in the tooltip (displayMetadata). Builds and wear live in the item (SetMetadata, SetDurability). To define the items statically instead, copy items/np_inventory.lua into np_inventory's config:

lua
Config.Items.dart_set = {
  label = 'Dart set', description = 'Three darts: barrel, grip, shaft and flights. Pick your main set in the dart case.',
  weight = 120, stack = false, close = true, durability = true, keepBroken = true, category = 'misc', icon = 'bullseye',
}

Config.Items.dart_flights = {
  label = 'Dart flights', description = 'Fresh flights for your main set.', weight = 10, stack = true, close = true,
  category = 'misc', icon = 'feather', consume = {}, use = { duration = 2500, label = 'Fitting flights…' },
  server = { export = 'np_darts.useFlights' },
}

np_darts.useFlights is the item export the inventory calls; don't call it yourself. See np_inventory → Items.

ox_inventory ​

Copy the entries from items/ox_inventory.lua into ox_inventory/data/items.lua:

lua
['dart_set'] = {
  label = 'Dart set', weight = 120, stack = false, close = true,
  description = 'Three darts: barrel, grip, shaft and flights. Pick your main set in the dart case.',
},
['dart_flights'] = {
  label = 'Dart flights', weight = 10, stack = true, close = true, description = 'Fresh flights for your main set.',
  consume = 1, server = { export = 'np_darts.useFlights' },
},

qb-inventory ​

Copy the entries from items/qb_items.lua into qb-core/shared/items.lua. Items carry info as metadata; the flights are registered as a usable item (qb-core CreateUseableItem, qbx_core CreateUseableItem).

lua
dart_set     = { name = 'dart_set', label = 'Dart set', weight = 120, type = 'item', image = 'dart_set.png', unique = true, useable = false, shouldClose = true, description = 'Three darts: barrel, grip, shaft and flights.' },
dart_flights = { name = 'dart_flights', label = 'Dart flights', weight = 10, type = 'item', image = 'dart_flights.png', unique = false, useable = true, shouldClose = true, description = 'Fresh flights for your main set.' },

Default ESX inventory ​

The ESX inventory has no metadata, so every set is its own item (dart_set_<id>, Config.Items.perSetItems = true) and builds and wear are kept in the player's profile. Run items/esx_items.sql once:

Item Label
dart_set_shadow Shadow 22g darts
dart_set_viper Viper 24g darts
dart_set_ghost Ghost 21g darts
dart_set_torpedo Torpedo 26g darts
dart_set_neon Neon Night 20g darts
dart_flights Dart flights (usable through ESX.RegisterUsableItem)

Add a row when you add a set to Config.Gear.sets.

No inventory ​

You play with the house darts; sets bought in the pro shop or given by staff are kept in the profile.

Other items np_darts uses ​

Item Where
beer (Config.HouseRules.pintItem) The free pint for a 180 at pubs with the 180 = a free pint house rule. Without space or an item the toast says to collect it at the bar
coffee, water (Config.Intox.soberItems) Used in np_inventory they steady the hand for 10 minutes (afterUse hook)