Sell in shops
How to sell Eleven Mate's mate, yerba and thermos on FiveM: a copy-ready ox_inventory/data/shops.lua example, a dedicated shop and job-only selling.
Eleven Mate comes with no shops or vendors: mate, yerba_mate and termo are regular ox_inventory items. The easiest way to sell them is to add them to a shop in ox_inventory/data/shops.lua.
Note
The prices in these examples are only a guide. Use whatever fits your server's economy.
Add them to a shop you already have
Open ox_inventory/data/shops.lua, find the shop where you want to sell them (for example General, the 24/7) and add these lines inside its inventory:
inventory = {
-- ...what the shop already sells...
{ name = 'mate', price = 45 },
{ name = 'yerba_mate', price = 12 },
{ name = 'termo', price = 60 },
{ name = 'water', price = 10 }, -- to refill the thermos
},
In simple mode (Config.FullMode = false) mate is enough: yerba and the thermos aren't used.
Create a mate-only shop
If you'd rather have a dedicated stall, add a new shop inside the table that shops.lua returns:
Mate = {
name = 'Mate & Yerba',
blip = { id = 52, colour = 2, scale = 0.7 },
inventory = {
{ name = 'mate', price = 45 },
{ name = 'yerba_mate', price = 12 },
{ name = 'termo', price = 60 },
{ name = 'water', price = 10 },
},
locations = {
vec3(0.0, 0.0, 0.0), -- replace with your stall's coordinates
},
},
nameis the title of the shop and of its map blip.blipis optional. Remove it if you don't want a map icon.locationsare the points where the shop opens. Use your stall's real coordinates (get them in game with your framework's or admin menu's coordinates command).- If you run ox_inventory with ox_target, also add
targets, following the example shops inshops.lua.
Sell to one job only
ox_inventory shops accept groups. For example, so only a café's staff can buy:
Mate = {
name = 'Café storeroom',
groups = { cafe = 0 }, -- job name and minimum grade
inventory = {
{ name = 'yerba_mate', price = 8 },
},
locations = {
vec3(0.0, 0.0, 0.0),
},
},
Replace cafe with the job name in your framework.
If you renamed the items
If you changed Config.Item, Config.Yerba or Config.Thermos.item, use those same names in shops.lua. And if your water isn't called water, sell the item you have in Config.Thermos.waterItems.
Apply the changes
ox_inventory reads shops.lua on start. Restart the server so the shop shows up. Then buy a mate and follow the test in Installation.