Skip to content

Items ​

The starter templates use tools and materials: a chainsaw for a fallen tree, cones to close a road, a hazmat suit against fumes. They are listed in Config.Items (shared/config/00_core.lua: label, icon, tint, weight, usable) and Config.ItemDetails (shared/config/integrations.lua: description, category, stack, durability).

Item Label Weight (g) Category Usable Used by
chainsaw Chainsaw 6000 tool (durability) Fallen tree: cut the trunk
traffic_cone Traffic cone 1500 tool yes Close the road / lane / underpass (place tasks, used up)
road_flare Road flare 300 tool yes Sinkhole: set road flares
absorbent Absorbent 2000 material Fuel spill, illegal dumping, chemical drum
hazmat_suit Hazmat suit 3000 clothing Protects against gas and fumes (illegal dumping, gas leak, chemical drum)
valve_key Valve key 1200 tool Burst water main, gas leak
pry_bar Pry bar 1800 tool Dead traffic lights, rockslide
bolt_cutters Bolt cutters 2200 tool Light aircraft down: open the flight case
insulated_gloves Insulated gloves 300 clothing Dead traffic lights, downed power line; protects against live wires
lumber Lumber 4000 material Loose livestock: fix the fence. Load the logs on a fallen tree gives it
scrap_metal Scrap metal 2500 material Available to your own templates

Change labels, weights or icons in Config.Items, descriptions and categories in Config.ItemDetails. How players get the tools (a job armoury, a shop, a crafting bench) is up to your server.

Using cones and flares ​

traffic_cone and road_flare are usable. Using one within Config.Tasks.placeRadius (15 m) of an open place task that needs it does one step of that task and removes what the task consumes (np_environmental removes it, the inventory must not consume the item itself). One placed item per Config.Tasks.placeCooldown (1.5 s). Far from a scene the player gets "There is nothing here to report."

np_inventory: nothing to do ​

With np_inventory every item is registered at runtime with RegisterItem at start and whenever np_inventory restarts: label, description, weight, Font Awesome icon, tint and category. The chainsaw is registered with durability, so np_inventory keeps metadata.durability (0-100) per saw. Cones and flares carry server = { export = 'np_environmental.<item>' }. You add nothing to np_inventory's item files.

ox_inventory ​

ox_inventory cannot register items at runtime. Add them to ox_inventory/data/items.lua:

lua
['chainsaw'] = { label = 'Chainsaw', weight = 6000, stack = false, close = true,
  description = 'Cuts fallen trees and branches into pieces you can move.' },
['traffic_cone'] = { label = 'Traffic cone', weight = 1500, stack = true, close = true,
  description = 'Place it near a scene to close off the lane.',
  server = { export = 'np_environmental.traffic_cone' } },
['road_flare'] = { label = 'Road flare', weight = 300, stack = true, close = true,
  description = 'Burns red for a few minutes. Place it near a scene to warn traffic.',
  server = { export = 'np_environmental.road_flare' } },
['absorbent'] = { label = 'Absorbent', weight = 2000, stack = true, description = 'Granules that soak up oil and fuel spills.' },
['hazmat_suit'] = { label = 'Hazmat suit', weight = 3000, stack = false, description = 'Protects against fumes and chemicals.' },
['valve_key'] = { label = 'Valve key', weight = 1200, stack = false, description = 'Opens and shuts the valves of hydrants and gas lines.' },
['pry_bar'] = { label = 'Pry bar', weight = 1800, stack = false, description = 'Forces stuck doors, hatches and debris apart.' },
['bolt_cutters'] = { label = 'Bolt cutters', weight = 2200, stack = false, description = 'Cuts chains, fences and padlocks.' },
['insulated_gloves'] = { label = 'Insulated gloves', weight = 300, stack = true, description = 'Rated for live wires.' },
['lumber'] = { label = 'Lumber', weight = 4000, stack = true, description = 'Cut timber from a cleared tree.' },
['scrap_metal'] = { label = 'Scrap metal', weight = 2500, stack = true, description = 'Bent metal salvaged from a wreck.' },

qbx_core servers run ox_inventory: use this snippet. ESX with ox_inventory: this snippet as well.

qb-inventory ​

Add them to qb-core/shared/items.lua:

lua
chainsaw = { name = 'chainsaw', label = 'Chainsaw', weight = 6000, type = 'item', image = 'chainsaw.png', unique = true, useable = false, shouldClose = true, description = 'Cuts fallen trees and branches into pieces you can move.' },
traffic_cone = { name = 'traffic_cone', label = 'Traffic cone', weight = 1500, type = 'item', image = 'traffic_cone.png', unique = false, useable = true, shouldClose = true, description = 'Place it near a scene to close off the lane.' },
road_flare = { name = 'road_flare', label = 'Road flare', weight = 300, type = 'item', image = 'road_flare.png', unique = false, useable = true, shouldClose = true, description = 'Burns red for a few minutes. Place it near a scene to warn traffic.' },
absorbent = { name = 'absorbent', label = 'Absorbent', weight = 2000, type = 'item', image = 'absorbent.png', unique = false, useable = false, shouldClose = false, description = 'Granules that soak up oil and fuel spills.' },
hazmat_suit = { name = 'hazmat_suit', label = 'Hazmat suit', weight = 3000, type = 'item', image = 'hazmat_suit.png', unique = true, useable = false, shouldClose = false, description = 'Protects against fumes and chemicals.' },
valve_key = { name = 'valve_key', label = 'Valve key', weight = 1200, type = 'item', image = 'valve_key.png', unique = true, useable = false, shouldClose = false, description = 'Opens and shuts the valves of hydrants and gas lines.' },
pry_bar = { name = 'pry_bar', label = 'Pry bar', weight = 1800, type = 'item', image = 'pry_bar.png', unique = true, useable = false, shouldClose = false, description = 'Forces stuck doors, hatches and debris apart.' },
bolt_cutters = { name = 'bolt_cutters', label = 'Bolt cutters', weight = 2200, type = 'item', image = 'bolt_cutters.png', unique = true, useable = false, shouldClose = false, description = 'Cuts chains, fences and padlocks.' },
insulated_gloves = { name = 'insulated_gloves', label = 'Insulated gloves', weight = 300, type = 'item', image = 'insulated_gloves.png', unique = false, useable = false, shouldClose = false, description = 'Rated for live wires.' },
lumber = { name = 'lumber', label = 'Lumber', weight = 4000, type = 'item', image = 'lumber.png', unique = false, useable = false, shouldClose = false, description = 'Cut timber from a cleared tree.' },
scrap_metal = { name = 'scrap_metal', label = 'Scrap metal', weight = 2500, type = 'item', image = 'scrap_metal.png', unique = false, useable = false, shouldClose = false, description = 'Bent metal salvaged from a wreck.' },

Cones and flares become usable on qb through QBCore.Functions.CreateUseableItem (the qb inventory bridge).

No inventory ​

With Config.Inventory = 'none' (or none detected) nothing can be carried: tasks with requires.item answer needs_item and place tasks are done with the prompt. Templates without item requirements work as usual.