A crafting plug script intended to be gun/ammo based but does support standard crafting items with props. Whitelisted behind identifiers, jobs, gangs or have it as a public bench for anyone to use.
---@field model: any sort of model hash.
---@field coords: vector4
---@field label: used on the target label and the ui.
---@field type: 'cid' | 'gang' | 'job' | 'public'
---@field allowed: Array. Not needed for public. QB cids are typically like 'BHU87653' | ESX is like char1:efefvde778hfdsd
---@field recipes:
-- {
-- name: item name. 'pistol_ammo' for example
-- prop: only used for non weapons. A model hash. (optional)
-- craftAmount: only used for crafting items that produce large quantities like ammo bullets. Number like 100 for pistol ammo. (optional, will default to 1)
-- materials = { table that supports multiple required materials.
-- {
-- mat: item name like 'rubber'
-- amount: the amount of the above mat required.
-- },
-- }
-- },
--
{
model = `gr_prop_gr_bench_03b`,
coords = vec4(101.39, -222.44, 54.64, 250.0),
label = 'Gun Crafting',
type = 'cid',
allowed = {'RANDOLIO'},
recipes = {
{ name = 'pistol_ammo', prop = `v_ret_gc_ammo5`, craftAmount = 100, materials = { { mat = 'rubber', amount = 5 }, { mat = 'plastic', amount = 4 } } },
{ name = 'suppressor', prop = `w_at_sr_supp3`, materials = { { mat = 'rubber', amount = 5 }, { mat = 'plastic', amount = 4 } } },
{ name = 'heavyarmor', prop = `prop_armour_pickup`, materials = { { mat = 'rubber', amount = 5 }, { mat = 'plastic', amount = 4 } } },
{ name = 'WEAPON_ASSAULTSMG', materials = { { mat = 'rubber', amount = 5 }, { mat = 'plastic', amount = 4 } } },
{ name = 'WEAPON_SMG', materials = { { mat = 'rubber', amount = 5 }, { mat = 'plastic', amount = 4 } } },
},
},