π Fields (what each value means)#
- id β Internal identifier used inside the script (e.g.
"pistol"). - name β Display name shown to the player (e.g.
"Pistol"). - category β Group of the item (e.g.
"weapons","ammo","equipment","protection","utility"). - grade β Minimum job grade/rank required to access the item. Example:
grade = 2means only job rank 2 or higher can buy/use it. - price β Price of the item (currently all are
0.00, so free). - image β Image file for inventory UI (empty in your config, but normally
"pistol.png"etc.). - desc β Short description text (e.g.
"Sidearm.","Light armor."). - itemName β The real item name in your framework (qb-core/ox_inventory). Example:
"weapon_pistol","radio". - stack β How many items can stack in one inventory slot (e.g.
30ammo per slot). - maxPerCart β Max amount that can be purchased in a single transaction (e.g.
200ammo at once).
π¦ Categories#
- Weapons
pistol,smg,carbine,shotgun,flashbang- Each requires a certain grade (e.g. Rifle needs grade 3).
- Ammo
pistol_ammo,smg_ammo,rifle_ammo,shotgun_ammo- Defines stack size (
30for bullets,10for shotgun shells).
- Equipment
cuffs,taser,flashlight,radio- Basic police tools.
- Protection
armor_light,armor_heavy,shield- Armor and riot gear.
- Utility
spikes,breach,bodycam- Police special-use items.
π In short:
This config defines a shop/loadout system where items are grouped by category, restricted by rank (grade), and controlled by purchase limits (stack and maxPerCart).
Items = {
{ id = "pistol", name = "Pistol", category = "weapons", grade = 0, price = 0.00, image = "", desc = "Sidearm.", itemName = "weapon_pistol", stack = 1, maxPerCart = 1 },
{ id = "smg", name = "SMG", category = "weapons", grade = 2, price = 0.00, image = "", desc = "SMG.", itemName = "weapon_smg", stack = 1, maxPerCart = 1 },
{ id = "carbine", name = "Rifle", category = "weapons", grade = 3, price = 0.00, image = "", desc = "Rifle.", itemName = "weapon_carbinerifle", stack = 1, maxPerCart = 1 },
{ id = "shotgun", name = "Shotgun", category = "weapons", grade = 3, price = 0.00, image = "", desc = "Shotgun.", itemName = "weapon_pumpshotgun", stack = 1, maxPerCart = 1 },
{ id = "flashbang",name = "Flash", category = "weapons", grade = 4, price = 0.00, image = "", desc = "Flash.", itemName = "weapon_flashlight", stack = 2, maxPerCart = 5 },
-- Ammo
{ id = "pistol_ammo", name = "Pistol Ammo", category = "ammo", grade = 0, price = 0.00, image = "", desc = "Ammo.", itemName = "pistol_ammo", stack = 30, maxPerCart = 200 },
{ id = "smg_ammo", name = "SMG Ammo", category = "ammo", grade = 2, price = 0.00, image = "", desc = "Ammo.", itemName = "smg_ammo", stack = 30, maxPerCart = 200 },
{ id = "rifle_ammo", name = "Rifle Ammo", category = "ammo", grade = 3, price = 0.00, image = "", desc = "Ammo.", itemName = "rifle_ammo", stack = 30, maxPerCart = 200 },
{ id = "shotgun_ammo", name = "Shotgun Ammo", category = "ammo", grade = 3, price = 0.00, image = "", desc = "Ammo.", itemName = "shotgun_ammo", stack = 10, maxPerCart = 50 },
-- Equipment
{ id = "cuffs", name = "Cuffs", category = "equipment", grade = 0, price = 0.00, image = "", desc = "Cuffs.", itemName = "handcuffs", stack = 1, maxPerCart = 5 },
{ id = "taser", name = "Taser", category = "equipment", grade = 1, price = 0.00, image = "", desc = "Taser.", itemName = "weapon_stungun", stack = 1, maxPerCart = 1 },
{ id = "flashlight",name = "Light", category = "equipment", grade = 0, price = 0.00, image = "", desc = "Light.", itemName = "weapon_flashlight", stack = 1, maxPerCart = 1 },
{ id = "radio", name = "Radio", category = "equipment", grade = 0, price = 0.00, image = "", desc = "Radio.", itemName = "radio", stack = 1, maxPerCart = 1 },
-- Protection
{ id = "armor_light", name = "L-Armor", category = "protection", grade = 0, price = 0.00, image = "", desc = "Light armor.", itemName = "armor", stack = 1, maxPerCart = 2 },
{ id = "armor_heavy", name = "H-Armor", category = "protection", grade = 2, price = 0.00, image = "", desc = "Heavy armor.", itemName = "heavyarmor", stack = 1, maxPerCart = 2 },
{ id = "shield", name = "Shield", category = "protection", grade = 4, price = 0.00, image = "", desc = "Shield.", itemName = "police_stormram", stack = 1, maxPerCart = 1 },
-- Utility
{ id = "spikes", name = "Spikes", category = "utility", grade = 2, price = 0.00, image = "", desc = "Spikes.", itemName = "police_spikestrip", stack = 1, maxPerCart = 5 },
{ id = "breach", name = "Breach", category = "utility", grade = 3, price = 0.00, image = "", desc = "Breach kit.", itemName = "police_breachkit", stack = 1, maxPerCart = 2 },
{ id = "bodycam", name = "Bodycam", category = "utility", grade = 0, price = 0.00, image = "", desc = "Bodycam.", itemName = "police_bodycam", stack = 1, maxPerCart = 1 }
},