Shop Integration

When adding new shops or editing existing shops inside of locations.lua always remember that the shop name needs to be unique. This name is saved into mk_vehicleshops and is used when generating shop vehicles through mk_utils inside your frameworks server bridge file under the function getShopVehicles. The categories table is also passed to this function.

By default the getShopVehicles function will generate shop vehicles in the following priority:

  • Is this vehicle not blacklisted by the server?

    • If the vehicle is blacklisted it will not be added to the shop

  • Is this vehicle assigned specifically to a shop?

    • If this vehicle is assigned a shop then it can only be sold at that specific shop regardless of its vehicle category. Example: A vehicle that is assigned a shop of pdm with a category of compacts will only be sold at pdm and not at any other shops that list compacts as a category.

    • If this vehicle is not assigned to a specific shop then its category will be checked

  • Is this vehicle assigned to a category associated with this shop?

    • If this vehicles assigned category is in the shop category list it will be added to the shop

Blacklist a vehicle:

Navigate to qb-smallresources/config.lua

Add your vehicle into Config.BlacklistedVehs table using the same format shown

Assign a vehicle to a specific shop:

Navigate to qb-core/shared/vehicles.lua

Add or find the vehicle you want to add to a specific shop

Edit its shop to match the name of the shop in locations.lua (They must match exactly)

Assign a vehicle to a specific category:

Navigate to qb-core/shared/vehicles.lua

Add or find the vehicle you want to assign a category to

Edit its category to match a category you will assign inside of the categories table of locations.lua

Last updated