HomeDocumentationFlake Blackmarkets
🕵️

Flake Blackmarkets

A fully configurable black market system for FiveM with dual framework support, direct or pickup delivery, custom currencies, and per-market peds.

FiveMESX & QB-Coreox_libLua 5.4
Purchase Script
flakedev.com

Overview

Create multiple black market locations across the map, each with its own inventory, prices, accepted currencies, and delivery method.

Features

  • Dual Framework — Auto-detects ESX or QB-Core.
  • Multiple Markets — Define as many black markets as you want in config.
  • Direct or Pickup — Per-market choice: instant delivery or delayed pickup.
  • Custom Currencies — Accept cash, bank, black money, or any item as currency.
  • Shop Peds — Optional NPCs at market locations with scenarios.
  • Map Blips — Configurable blips per market.
  • Server-Side Validation — Prices, items, and funds are validated on the server.
  • Discord Logging — Optional webhook logging for purchases.

Requirements

DependencyPurposeRequired
ox_libCallbacks, notificationsYes
ESX or QB-CoreFramework for players, money, itemsYes

Installation

Place the flake_blackmarkets folder into your server's resources directory and add to server.cfg:

ensure flake_blackmarkets

Done

Restart your server and black market blips will appear on the map.

File Structure

flake_blackmarkets/
├── client/
│   └── client.lua       -- Shop UI, peds, blips, pickup logic
├── server/
│   └── server.lua       -- Purchase validation, money, items
├── config/
│   ├── config.lua       -- Framework, settings, notifications (escrow-ignored)
│   ├── edits.lua        -- Notification overrides (escrow-ignored)
│   └── sv_config.lua    -- Markets, items, prices, pickups (escrow-ignored)
├── html/
│   └── build/           -- Shop UI files
└── fxmanifest.lua   -- Resource manifest

Configuration

Main Settings

SettingDefaultDescription
Config.DebugfalseEnable debug prints in console
Config.DrawDistance25Marker draw distance
Config.Size{ x=0.4, y=0.4, z=0.2 }Marker size
Config.Color{ r=0, g=128, b=255 }Marker RGB colour
Config.Type2Marker type index
Config.InventoryImgUrlox_inventory/web/images/Path to inventory images

Market Configuration

Markets are defined in config/sv_config.lua:

Config.BlackMarkets = {
    MyMarket = {
        Label    = "Black Market",
        SaleType = "direct",   -- "direct" or "pickup"

        Blip = {
            sprite     = 459,
            scale      = 0.8,
            colour     = 3,
            shortRange = true,
            name       = "Black Market",
        },

        Items = {
            { label = "Glock 17", item = "WEAPON_GLOCK17", price = 35000 },
        },

        Pos = {
            vector3(927.93, -1488.07, 30.49),
        },

        Currencies = {
            { name = "black_money", label = "Dirty Money" },
        },

        UsePickup = false,
        UsePed    = true,
        ShopPed   = {
            model    = "s_m_y_dealer_01",
            heading  = 180.0,
            scenario = "WORLD_HUMAN_DRUG_DEALER",
        },
        ShopLogo = "blackmarket.png",
    },
}

Schema Reference

FieldTypeRequiredDescription
LabelStringYesDisplay name for the market
SaleTypeStringYes"direct" (instant) or "pickup" (delayed)
ItemsArrayYesItems for sale with label, item name, and price
PosArrayYesMarket locations (vector3)
CurrenciesArrayYesAccepted payment types with display labels
UsePickupBooleanNoEnable delayed pickup for this market
UsePedBooleanNoSpawn an NPC at the location
ShopPedObjectNoPed model, heading, and scenario
ShopLogoStringNoImage filename from html/img/
BlipObjectNoMap blip configuration

Pickup Locations

Config.PickUpLocations = {
    [1] = {
        coords   = vector4(950.5, -203.6, 73.2, 296.1),
        pedModel = "g_m_y_mexgang_01",
        waitTime = 30,  -- seconds
        label    = "BROKEN MOTELS"
    },
}

Accepted Currencies

FrameworkCurrency NameDescription
QBCorecash, bank, markedbillsBuilt-in money types
QBCoreAny item nameItem-based currency (e.g., crypto)
ESXmoney, bank, black_moneyBuilt-in account types
ESXAny item nameItem-based currency (e.g., blackdiamond)

Usage

Shopping Flow

  1. Approach the market marker or ped.
  2. Press E to open the shop UI.
  3. Add items to your cart.
  4. Select a payment method and confirm purchase.
  5. If the market uses Direct, items go straight to inventory.
  6. If the market uses Pickup, a blip spawns and you must wait before collecting.

Server-Side Validation

  • Item prices are checked against the server config — client cannot modify them.
  • Payment method must be in the market's accepted currency list.
  • Player funds are verified before deducting.
  • Invalid items are rejected and logged as potential cheating.

Pickup System

When UsePickup = true on a market, purchased items are not given immediately. Instead, the player receives a blip to a random pickup location.

How It Works

  1. Player completes purchase.
  2. A random pickup location is selected from Config.PickUpLocations.
  3. A blip is created on the player's map.
  4. After waitTime seconds, a ped spawns and the order becomes ready.
  5. Player approaches the ped and presses E to collect items.

Important

Pickup orders are stored in server memory and will be lost if the server restarts before collection. Orders are also cleared when the player disconnects.

Troubleshooting

IssueFix
Markets not appearingEnsure the resource is ensured after the framework. Check console for errors.
Images not loadingVerify Config.InventoryImgUrl matches your inventory's image directory.
Purchases failingCheck that the currency exists in the player's account/inventory and the item is valid.
Pickup not workingEnsure Config.PickUpLocations has at least one entry and the market has UsePickup = true.
Peds not spawningConfirm the ped model exists in your server build. Most use base-game models.
Discord logs not sendingVerify the webhook URL in config.lua and that logging is enabled.
Shop UI not openingEnsure ox_lib is running and the HTML build folder is intact.
Developed by Flake Development. For support, open a ticket in our Discord.