Skip to content

Installation

Install Cuxial Supply step by step: dependencies, the supermarket job, items, convars and start order.

Cuxial Supply needs no SQL import: it creates its tables on first start. It does need a framework job for the supermarket staff and the product items in your inventory.

Check the dependencies ​

These resources must be installed and working before you add the job:

  • ox_lib
  • oxmysql
  • cuxial_bridge, with one of the supported frameworks: QBox, QBCore or ESX
  • sleepless_interact
  • OneSync enabled on the server

Two more come inside the package and are installed in the next step: cuxial_jobs and cuxial_supermarket_assets.

For the supermarket you also need:

  • cuxial_banking. The store's money lives in the business account of its job. Sales and wholesale purchases are paid into it, and deliveries are paid from it. Card payments at the till go through it too.
  • ox_inventory or qb-inventory, so customers receive the items they buy.

cuxial_garages is optional. When it is running, the crew receives the keys of the van and loses them when the run ends.

Copy the resources ​

Place the three folders of the package inside your resources directory. Keep the folder names as they are.

  • cuxial_supply
  • cuxial_jobs
  • cuxial_supermarket_assets

If you already own another Cuxial job, you already have cuxial_jobs. Keep a single copy, the most recent one.

cuxial_supermarket_assets replaces the supermarket building in Paleto Bay. Remove or stop any other MLO of that same supermarket before starting it: two maps in the same spot break each other.

Keep the data/seed/ folder of cuxial_supply. It holds the shelf slots, fridges and tills of the supermarket, and it is copied into the database on start.

Create the supermarket job ​

The supermarket staff belong to the framework job supermarket. The grade number decides what each employee can do:

GradeRoleCan
0StockerTake boxes from the stockroom and restock the shelves
1CashierEverything above, and charge customers at a till
2ManagerEverything above, and open the management panel
3BossEverything above, and set the shelf prices

The job name and the grade numbers can be changed in store of shared/config.lua. Grade names and salaries are yours to choose.

qbx_core/shared/jobs.lua
lua
['supermarket'] = {
    label = 'Supermarket',
    defaultDuty = true,
    offDutyPay = false,
    grades = {
        [0] = { name = 'Stocker', payment = 50 },
        [1] = { name = 'Cashier', payment = 75 },
        [2] = { name = 'Manager', payment = 100 },
        [3] = { name = 'Boss', isboss = true, payment = 150 },
    },
},

Restocking and charging require being on duty (store.duty). Players go on duty through your framework's duty system; defaultDuty = true puts them on duty when they join.

Cuxial Banking creates a business account for every job of your framework when it starts. Restart cuxial_banking (or the server) after adding the job so the supermarket account exists.

Add the items ​

Every product gives an item when it is bought at the supermarket. Add the ones your inventory does not have yet. Labels and weights are an example: adjust them to your server.

ox_inventory/data/items.lua
lua
['raw_chicken'] =      { label = 'Chicken', weight = 200 },
['eggs'] =             { label = 'Eggs', weight = 200 },
['tomato'] =           { label = 'Tomatoes', weight = 200 },
['lettuce'] =          { label = 'Lettuce', weight = 200 },
['potato'] =           { label = 'Potatoes', weight = 200 },
['onion'] =            { label = 'Onions', weight = 200 },
['milk'] =             { label = 'Milk', weight = 200 },
['flour'] =            { label = 'Flour', weight = 200 },
['raw_beef'] =         { label = 'Beef', weight = 200 },
['champagne'] =        { label = 'Champagne', weight = 200 },
['whisky'] =           { label = 'Whisky', weight = 200 },
['noodles'] =          { label = 'Instant noodles', weight = 200 },
['noodles_seafood'] =  { label = 'Seafood noodles', weight = 200 },
['tomato_soup'] =      { label = 'Tomato soup', weight = 200 },
['veg_soup'] =         { label = 'Vegetable soup', weight = 200 },
['tuna'] =             { label = 'Canned tuna', weight = 200 },
['sweetcorn'] =        { label = 'Sweetcorn', weight = 200 },
['ketchup'] =          { label = 'Ketchup', weight = 200 },
['mustard'] =          { label = 'Mustard', weight = 200 },
['cereal'] =           { label = 'Cereal', weight = 200 },
['bread'] =            { label = 'Sliced bread', weight = 200 },
['chips'] =            { label = 'Crisps', weight = 200 },
['chocolate'] =        { label = 'Chocolate bars', weight = 200 },
['candy'] =            { label = 'Candy', weight = 200 },
['water'] =            { label = 'Mineral water', weight = 200 },
['cola'] =             { label = 'Cola', weight = 200 },
['sprunk'] =           { label = 'Sprunk', weight = 200 },
['detergent'] =        { label = 'Laundry detergent', weight = 200 },
['dish_soap'] =        { label = 'Dish soap', weight = 200 },
['cleaner'] =          { label = 'Spray cleaner', weight = 200 },
['shampoo'] =          { label = 'Shampoo', weight = 200 },
['soap'] =             { label = 'Hand soap', weight = 200 },
['toothpaste'] =       { label = 'Toothpaste', weight = 200 },
['hair_gel'] =         { label = 'Hair gel', weight = 200 },
['shaving_foam'] =     { label = 'Shaving foam', weight = 200 },
['sugar'] =            { label = 'Sugar', weight = 200 },
['soy_sauce'] =        { label = 'Soy sauce', weight = 200 },
['rum'] =              { label = 'Rum', weight = 200 },
['vodka'] =            { label = 'Vodka', weight = 200 },
['tequila'] =          { label = 'Tequila', weight = 200 },
['beer'] =             { label = 'Beer keg', weight = 200 },
['fruit_orange'] =     { label = 'Orange', weight = 200 },
['fruit_pineapple'] =  { label = 'Pineapple', weight = 200 },
['fruit_strawberry'] = { label = 'Strawberry', weight = 200 },
['fruit_cherry'] =     { label = 'Cherry', weight = 200 },
['fruit_banana'] =     { label = 'Banana', weight = 200 },
['raw_pork'] =         { label = 'Raw pork', weight = 200 },
['salmon'] =           { label = 'Salmon', weight = 200 },
['fish_fillet'] =      { label = 'Fish fillet', weight = 200 },
['shrimp'] =           { label = 'Shrimp', weight = 200 },
['lobster'] =          { label = 'Lobster', weight = 200 },
['cheese'] =           { label = 'Cheese', weight = 200 },
['cream'] =            { label = 'Cream', weight = 200 },
['avocado'] =          { label = 'Avocado', weight = 200 },
['chili'] =            { label = 'Chili pepper', weight = 200 },
['fruit_lime'] =       { label = 'Lime', weight = 200 },
['mint'] =             { label = 'Mint', weight = 200 },
['rice'] =             { label = 'Rice', weight = 200 },
['pasta'] =            { label = 'Pasta', weight = 200 },
['beans'] =            { label = 'Beans', weight = 200 },
['nori'] =             { label = 'Nori seaweed', weight = 200 },
['syrup'] =            { label = 'Syrup', weight = 200 },
['coffee_beans'] =     { label = 'Coffee beans', weight = 200 },
['tea_leaves'] =       { label = 'Tea leaves', weight = 200 },
['ice'] =              { label = 'Ice', weight = 200 },

With qb-inventory, add the same item names to qb-core/shared/items.lua. Each product's item is set in item of data/products.lua: point it to an item you already have if you prefer.

The editor warns, on each product, when its item does not exist in your inventory.

Set the convars ​

All of them are optional.

server.cfg
cfg
# Language of the job (en and es are included)
setr ox:locale "en"

# Discord webhook for the job logs
set cuxial_supply_webhook "https://discord.com/api/webhooks/..."

# Debug traces in the console
setr cuxial_supply_debug "0"

The webhook goes in server.cfg, never in shared/config.lua. The name of the convar can be changed in logs.convar. It is read when the resource starts: set it above the ensure lines.

Start the resources ​

Start the job after its dependencies and after your framework. cuxial_jobs and cuxial_supermarket_assets go before cuxial_supply:

server.cfg
cfg
ensure ox_lib
ensure oxmysql
# your framework here (qbx_core, qb-core or es_extended)
# your inventory here (ox_inventory or qb-inventory)
ensure cuxial_bridge
ensure sleepless_interact
ensure cuxial_banking
# optional
ensure cuxial_garages
ensure cuxial_jobs
ensure cuxial_supermarket_assets
ensure cuxial_supply

No SQL to run. On first start the job creates the cuxial_jobs_* tables shared by all Cuxial jobs (each row is tagged with its job) and its own cuxial_supply_* tables: stock, orders, history, ledger, layout, supermarket slots and reserve, product rotation and cuxial_supply_seed, which receives the contents of data/seed/. install/cuxial_supply.sql is a reference copy.

cuxial_supermarket_assets adds a map and props. Restart the server after installing it, not only the resource, and reconnect so every client loads it.

Check that it works ​

  1. Join the server and open the map. The supplier blip marks the job NPC in Grapeseed and the supermarket blip marks the store in Paleto Bay.
  2. Go to the NPC and use the interaction option. The job panel opens.
  3. Pick the poultry farm line and press the start button. A van appears next to the NPC and the HUD shows the next step.
  4. Type /supplyreset to cancel the test run. The van disappears.
  5. As staff, type /supplyrestock to fill the supermarket, then walk in: products appear on the shelves.
  6. Give yourself the supermarket job, go on duty, and check that the stockroom pallets offer Take box.

Next: see how everything works in game in the Features guide, then adjust it in Configuration.

© Cuxial