🕵️
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
| Dependency | Purpose | Required |
|---|---|---|
ox_lib | Callbacks, notifications | Yes |
| ESX or QB-Core | Framework for players, money, items | Yes |
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
| Setting | Default | Description |
|---|---|---|
Config.Debug | false | Enable debug prints in console |
Config.DrawDistance | 25 | Marker 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.Type | 2 | Marker type index |
Config.InventoryImgUrl | ox_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
| Field | Type | Required | Description |
|---|---|---|---|
Label | String | Yes | Display name for the market |
SaleType | String | Yes | "direct" (instant) or "pickup" (delayed) |
Items | Array | Yes | Items for sale with label, item name, and price |
Pos | Array | Yes | Market locations (vector3) |
Currencies | Array | Yes | Accepted payment types with display labels |
UsePickup | Boolean | No | Enable delayed pickup for this market |
UsePed | Boolean | No | Spawn an NPC at the location |
ShopPed | Object | No | Ped model, heading, and scenario |
ShopLogo | String | No | Image filename from html/img/ |
Blip | Object | No | Map 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
| Framework | Currency Name | Description |
|---|---|---|
| QBCore | cash, bank, markedbills | Built-in money types |
| QBCore | Any item name | Item-based currency (e.g., crypto) |
| ESX | money, bank, black_money | Built-in account types |
| ESX | Any item name | Item-based currency (e.g., blackdiamond) |
Usage
Shopping Flow
- Approach the market marker or ped.
- Press E to open the shop UI.
- Add items to your cart.
- Select a payment method and confirm purchase.
- If the market uses Direct, items go straight to inventory.
- 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
- Player completes purchase.
- A random pickup location is selected from
Config.PickUpLocations. - A blip is created on the player's map.
- After
waitTimeseconds, a ped spawns and the order becomes ready. - 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
| Issue | Fix |
|---|---|
| Markets not appearing | Ensure the resource is ensured after the framework. Check console for errors. |
| Images not loading | Verify Config.InventoryImgUrl matches your inventory's image directory. |
| Purchases failing | Check that the currency exists in the player's account/inventory and the item is valid. |
| Pickup not working | Ensure Config.PickUpLocations has at least one entry and the market has UsePickup = true. |
| Peds not spawning | Confirm the ped model exists in your server build. Most use base-game models. |
| Discord logs not sending | Verify the webhook URL in config.lua and that logging is enabled. |
| Shop UI not opening | Ensure ox_lib is running and the HTML build folder is intact. |
Developed by Flake Development. For support, open a ticket in our Discord.
