πͺ qb-shops#
Ya'll got doritos?
Introduction#
- Works in conjunction with qb-inventory to let players buy items
- Includes delivery system for players to earn money while refilling stock of shop
Warning
The NPC's, blips and delivery portion of this package are a work-in-progress!
Configuration#
Defining Products#
You can define a table of items inside a unique product list with multiple options available. The index of our table of items will be our unique product list name that we can use later so make sure to keep them different! Let's go over what needs to be included in our product list
- product list:
string
- name:
string
- amount:
number
- info:
table
- requiredJob:
table | string
- requiredGang:
table | string
- requiredGrade:
number
- requiredLicense:
table | string
Tip
When using a table for requirements, they are EITHER/OR and not both. So if we add police and ambulance as requirements, you will not need both jobs, only one of them!
['normal'] = {
{ name = 'sandwich', price = 2, amount = 50, },
{ name = 'water_bottle', price = 2, amount = 50, info = { quality = 100 } },
{ name = 'kurkakola', price = 2, amount = 50, requiredJob = 'police' },
{ name = 'twerks_candy', price = 2, amount = 50, requiredGang = 'ballas' },
{ name = 'kurkakola', price = 2, amount = 50, requiredJob = { 'police', 'ambulance' } },
{ name = 'twerks_candy', price = 2, amount = 50, requiredGang = { 'ballas', 'lostmc' } },
{ name = 'snikkel_candy', price = 2, amount = 50, requiredGrade = 3 },
{ name = 'sandwich', price = 2, amount = 50, requiredLicense = 'weapon' },
{ name = 'sandwich', price = 2, amount = 50, requiredLicense = { 'weapon', 'driver' } },
},
Defining Locations#
You can define a list of shops which are indexed by a unique identifier. These identifier's must be different because it allows for the restocking of the shop if it's set to true.
- label:
string
- products:
table
- coords:
vector
- delivery:
vector
- ped:
string
- scenario:
string
- radius:
float
- targetIcon:
string
- targetLabel:
string
- showblip:
boolean
- blipsprite:
number
- blipscale:
float
- blipcolor:
number
- radius:
float
- useStock:
boolean
- requiredJob:
string | table
- requiredGang:
string | table
- requiredItem:
string | table
Tip
When setting requiredJob
, requiredGang
or requiredItem
do not use both string and table methods, only choose one!
['minimart'] = {
['label'] = 'MiniMart',
['products'] = Config.Products['normal'],
['coords'] = Vector(-2322.078254, 15228.652227, -299.849995),
['delivery'] = Vector(-2322.078254, 16228.652227, -299.849995),
['ped'] = 'mp_m_shopkeep_01',
['scenario'] = 'WORLD_HUMAN_STAND_MOBILE',
['targetIcon'] = 'fas fa-shopping-basket',
['targetLabel'] = 'Open Shop',
['showblip'] = true,
['blipsprite'] = 52,
['blipscale'] = 0.6,
['blipcolor'] = 0,
['radius'] = 1.5,
['useStock'] = true,
['requiredJob'] = 'police', -- string
['requiredJob'] = { ['mechanic'] = 4 }, -- table
['requiredGang'] = 'ballas', -- string
['requiredGang'] = { ['ballas'] = 4 }, -- table
['requiredItem'] = 'lockpick', -- string
['requiredItem'] = { 'lockpick', 'sandwich' } -- table
},