Items
Paste-in detector and battery defs for ox_inventory, QBCore, and ESX.
Names must match Config.Detectors and Config.Battery in shared/config.lua. Skip any item you already have, especially battery. Copy matching icons into your inventory image folder (metaldetector.png, metaldetector_adv.png, metaldetector_pro.png, battery.png).
Loot drops (metalscrap, goldchain, and so on) are not listed here. Change those names in Config.Loot.
Source file: items/items.lua. ESX SQL: items/esx.sql.
Paste into ox_inventory/data/items.lua inside the returned items table.
['metaldetector'] = {
label = 'Basic Detector',
weight = 2500,
stack = false,
close = true,
consume = 0,
description = 'Entry-level metal detector',
client = {
image = 'metaldetector.png',
},
},
['metaldetector_adv'] = {
label = 'Advanced Detector',
weight = 2600,
stack = false,
close = true,
consume = 0,
description = 'Improved range metal detector',
client = {
image = 'metaldetector_adv.png',
},
},
['metaldetector_pro'] = {
label = 'Pro Detector',
weight = 2700,
stack = false,
close = true,
consume = 0,
description = 'Professional metal detector',
client = {
image = 'metaldetector_pro.png',
},
},
['battery'] = {
label = 'Battery',
weight = 200,
stack = true,
close = true,
consume = 0,
description = 'Replacement battery for a metal detector',
client = {
image = 'battery.png',
},
},Paste into qb-core/shared/items.lua inside the Items table. qs-inventory and ps-inventory usually use the same format.
metaldetector = {
name = 'metaldetector',
label = 'Basic Detector',
weight = 2500,
type = 'item',
image = 'metaldetector.png',
unique = true,
useable = true,
shouldClose = true,
description = 'Entry-level metal detector',
},
metaldetector_adv = {
name = 'metaldetector_adv',
label = 'Advanced Detector',
weight = 2600,
type = 'item',
image = 'metaldetector_adv.png',
unique = true,
useable = true,
shouldClose = true,
description = 'Improved range metal detector',
},
metaldetector_pro = {
name = 'metaldetector_pro',
label = 'Pro Detector',
weight = 2700,
type = 'item',
image = 'metaldetector_pro.png',
unique = true,
useable = true,
shouldClose = true,
description = 'Professional metal detector',
},
battery = {
name = 'battery',
label = 'Battery',
weight = 200,
type = 'item',
image = 'battery.png',
unique = false,
useable = true,
shouldClose = true,
description = 'Replacement battery for a metal detector',
},Import items/esx.sql once, then restart es_extended / the server. Skip battery if that row already exists.
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
('metaldetector', 'Basic Detector', 1, 0, 1),
('metaldetector_adv', 'Advanced Detector', 1, 0, 1),
('metaldetector_pro', 'Pro Detector', 1, 0, 1),
('battery', 'Battery', 1, 0, 1)
ON DUPLICATE KEY UPDATE `label` = VALUES(`label`);Detectors are usable items (equip / unequip). Battery is usable while a detector is equipped. Registration uses CreateUsableItem in server/edit.lua.
