The key (shop name) must match the shopType args you pass in the info table
['My Cool Shop'] = { -- the key is the shop name
info = {
shopLabel = 'My Cool Shop', -- label used as the shop header
targetIcon = 'fa-solid fa-hand-point-up', -- icon used for target interaction
targetLabel = 'Open Shop', -- label used for target interaction
distance = 2.0, -- max distance for target interaction
scenario = 'WORLD_HUMAN_CLIPBOARD', -- name of scenario used set to nil for nothing
args = { shopType = "My Cool Shop" }, -- args sends the shopType data to the event to determine which inventory shop to open and displays the relevant products available - this must be the same as the key name
},
blips = { -- blip settings for shop
enabled = true, -- blip enabled
id = 52, -- blip id
colour = 2, -- blip colour
scale = 0.6, -- bliip scale
title = 'My Cool Shop', -- blip title
},
models = { -- define random ped models below
'mp_m_securoguard_01',
},
locations = { -- define spawn locations for the vendor must be vector4
vector4(1777.59, 2560.52, 45.62, 187.83),
},
inventory = {
-- define items and their prices below that can be purchased at this particular vendor - ensure these are in your items.lua!
{ name = 'my_cool_item', price = 4, amount = 50 },
{ name = 'my_cool_item_that_requires_a_job', price = 0, amount = 1, requiresJob = {'police', 'bsco', 'leo',}, },
{ name = 'my_cool_item_that_requires_a_job_&_rank', price = 0, amount = 50, requiresJob = {'police', 'bsco', 'leo',}, requiresRank = 1, },
{ name = 'my_cool_item_that_requires_a_license', price = 0, amount = 50, requiresLicense = 'weapon', },
},
},
Info
shopLabel is the label displayed in the shop menu header
targetIcon is the icon used when targeting the ped
targetLabel is the label displayed when targeting the ped
distance is the maximum distance permitted to target the ped make sure this is below the number you set in Config.CoreSettings.Security.maxDistance to prevent clashes with the security checks and cause unnecessary issues
scenario is the scenario animation used for the ped (set to nil for no animation)
args sends the shopType data which determines the inventory this must match the key name of the shop
info = {
shopLabel = 'My Cool Shop', -- label used as the shop header when opening the inventory shop
targetIcon = 'fa-solid fa-hand-point-up', -- icon used for target interaction
targetLabel = 'Open Shop', -- label used for target interaction
distance = 2.0, -- max distance for target interaction
scenario = 'WORLD_HUMAN_CLIPBOARD', -- scenario used for ped
args = { shopType = "My Cool Shop" }, -- args sends the shopType data to the event to determine which inventory shop to open and displays the relevant products available - this must be the same as the key name
},
Here you can define what items can be purchased at this particular shop
You can also add restrictions to items which is covered in more detail below
name is the item name - ensure this is in your items.lua!
price is the cost of that particular item
amount is the maximum amount players can purchase at once
for weapons it is advised to only stock 1 of that item to ensure there is no issues with serial number generation from your inventory script
inventory = {
-- define items and their prices below that can be purchased at this particular vendor - ensure these are in your items.lua!
{ name = 'tosti', price = 2, amount = 50 },
{ name = 'water_bottle', price = 2, amount = 50 },
{ name = 'kurkakola', price = 2, amount = 50 },
{ name = 'twerks_candy', price = 2, amount = 50 },
{ name = 'snikkel_candy', price = 2, amount = 50 },
{ name = 'sandwich', price = 2, amount = 50 },
{ name = 'lighter', price = 2, amount = 50 },
},
Restrictions
You can set restrictions for job, job rank and license for items
To set job requirements you can use a table of jobs allowing multiple jobs to access that shop or you can use a single string allowing just a single job to access that shop
You can set job rank restrictions for certain items, the police armory is a good example of this for things such as higher powered weaponry, this could be rank locked to higher level police officers
You can not pass just the job rank on its own, you must also define the jobs that can access the store in the first place using requiresJob
You can set license restrictions for items such as weapons that require a 'weapons' license just make sure your license type you set is a valid license in your server and is able to be granted to players