← All docsCriminal

Swarm Black Market

A roaming dealer who sells level- and reputation-locked illegal items for marked bills, plus 12 progression-based criminal contracts with heat, ratings and police dispatch alerts.

QboxQBCoreESXstandaloneResource: swarm_blackmarket

New to Swarm scripts? Read Getting started first. It covers Swarm Bridge, install order and the licence.

Requirements

Frameworks: Qbox, QBCore, ESX, standalone.

RequirementWhat it's forIncluded
swarm_bridgeTalks to your framework, inventory, target and so on. Included with every Swarm script.Yes
ox_libShared library (callbacks, progress bars, text UI).No
oxmysqlSaves player progress. Without it progress is kept in memory only.No

Install

  1. Copy the folders swarm_blackmarket, swarm_bridge into your server's resources folder. Already have swarm_bridge from another Swarm script? Keep just one copy, the newest.
  2. Add them to server.cfg, dependencies first:
    ensure ox_lib
    ensure oxmysql
    ensure swarm_bridge
    ensure swarm_blackmarket
  3. Database: import sql/install.sql into your database before starting the script. It isn't created automatically. Upgrading from v0.1 or v0.2? Run the heat-column ALTER that is commented in the same file (MariaDB and MySQL 8 versions are both there).
  4. Items: add the item definitions for your inventory from install/items/:
    • ox_inventory.items.lua for ox_inventory (any framework)
    • qbcore.items.lua for QBCore or Qbox with qb-inventory
    • esx.items.sql for legacy ESX

    Then copy install/images/*.png into your inventory's image folder (ox_inventory/web/images/ or qb-inventory/html/images/). Icons are named SS_<item>.png so they never overwrite another resource's images. Every item has an icon included.

    Items added (1)
    encrypted_usb

    The shop also sells items your server should already have: lockpick, armor (ox_inventory calls it armour), weapon_pistol, weapon_smg, and markedbills with worth metadata as the shop currency.

    On ESX, weapons are loadout rather than items and there are no marked bills. Remove the weapons from Config.Shop.items and switch Config.Currency.shop to an account such as black_money.

  5. Licensed edition only: put your ServerSecret in swarm_bridge/licence/private_config.lua. One secret unlocks every Swarm script you own. How to get it. The Source Code edition has no licence check, so skip this.
  6. Start the server and check the console for errors.

Configuration

Open config.lua and check these before going live. Anything marked as a placeholder should be moved to a spot that suits your map.

SettingWhat it does
Config.Dealer.locationsThe four spots (vector4) the dealer moves between.
Config.Dealer.showBlip / rotateMinutes / interactRadiusWhether the dealer has a blip (off by default), how often he moves (60 minutes) and how close players must be to buy.
Config.Shop.itemsWhat the dealer sells, with prices and level/reputation locks. Item names must match your inventory.
Config.Currency.shopShop currency. Marked bills by value by default; use a money account such as black_money on ESX.
Config.Currency.missionsAccount contracts pay into ('cash' by default).
Config.Missions.policeJobs / usePoliceRequirementsMany contracts need 1 to 4 police on duty. Match the job names to your server, or set usePoliceRequirements = false.
Config.Logging.discordWebhookOptional Discord log for purchases, contracts and admin actions. Empty by default.
Config.AdminAceAdmin ACE, 'blackmarket.admin' by default.
Config.Interaction'auto', 'ox_target', 'qb-target' or 'text' (press E).
Config.Locale'auto' follows the language set in Swarm Bridge. Set a code such as 'de' to force this script into another language. See Languages.

Commands & permissions

CommandWhoWhat it does
/blackmarketEveryoneOpens the market screen. Buying and taking contracts still require being at the dealer.
/bm_setlevel [id] [level]AdminSet a player's level.
/bm_addxp [id] [amount]AdminAdd XP.
/bm_addrep [id] [amount]AdminAdd reputation.
/bm_rotateAdminMove the dealer to another location.
/bm_restockAdminRestock the shop.
/bm_reset [id]AdminReset a player's progress.

Permissions (ACE)

Add to server.cfg, changing group.admin to your staff group if needed:

add_ace group.admin blackmarket.admin allow

Admin commands work from the server console or for players with blackmarket.admin.

Keys

  • E: talk to the dealer when no target resource is used

Good to know

  • Contracts that need police won't start on an empty server unless you turn police requirements off.
  • Contract locations and NPC setups are in shared/missions.lua, not config.lua.

Need help?

Ask in the Swarm Scripts Discord and we'll help you get set up.