QB / ESX

Agency-Blackmarket

Complete black market system with dual framework support (QBCore/ESX) featuring a 5-level reputation system, dynamic flash sale events, money laundering mechanics, and vehicle trading. Auto-detects server framework and supports multiple dispatch systems with configurable police alerts, hacking minigames, and categorized item trading.

v1.0.0Paid4 Pages
Agency-Blackmarket

01 Configuration

Complete config.lua for Agency-Blackmarket. All options documented via inline comments.

Download config.lua
Config = {}

-- Framework Detection (auto-detects QB-Core or ESX)
Config.Framework = "auto" -- "qb", "esx", or "auto" for auto-detection
Config.UseQBMoney = true -- Use QB-Core standard money system (auto-detects if true)

-- Interaction System
Config.UseQBTarget = false -- Set to true to use QB-Target instead of E key
Config.InteractionKey = 38 -- E key (https://docs.fivem.net/docs/game-references/controls/)
Config.InteractionDistance = 2.0 -- Distance for E key interaction

-- Black Market Location Settings
Config.RandomLocation = true -- Set to false to use fixed location
Config.DealerLocations = {
    vector4(-1318.7961, -906.9077, 11.3093, 199.9816),
    vector4(-1143.7180, -1547.3140, 4.3802, 35.3661),
    vector4(-894.7025, -1516.0317, 5.0240, 109.8363),
    vector4(-58.9501, -1230.9716, 28.8412, 43.6256),
    vector4(134.5272, -1276.0613, 29.3210, 291.3045)
}
Config.PedModel = "a_m_m_business_01" -- Professional businessman model
Config.BlackMarketHeading = 180.0

-- Random Location Pool (used if RandomLocation = true)
Config.RandomLocations = {
    {coords = vector3(-1300.0, -900.0, 10.0), heading = 180.0},
    {coords = vector3(-1120.0, -1570.0, 8.0), heading = 90.0},
    {coords = vector3(1400.0, 1100.0, 115.0), heading = 270.0},
    {coords = vector3(-2200.0, 4250.0, 48.0), heading = 45.0},
    {coords = vector3(2400.0, 5150.0, 46.0), heading = 135.0}
}

-- NPC Settings
Config.NPCModel = "g_m_y_lost_01"
Config.NPCName = "Black Market Dealer"

-- Blip Settings
Config.ShowBlip = true -- Set to false to completely disable blip
Config.BlipSprite = 500 -- Blip icon (https://docs.fivem.net/docs/game-references/blips/)
Config.BlipColor = 1 -- Blip color (https://docs.fivem.net/docs/game-references/blips/)
Config.BlipScale = 0.8 -- Blip size
Config.BlipName = "Black Market" -- Blip name on map
Config.BlipShortRange = true -- Only show blip when nearby
Config.BlipAlpha = 180 -- Blip transparency (0-255)

-- Job Access (leave empty to allow all jobs)
Config.AllowedJobs = {
    -- "police",
    -- "ambulance"
}

-- Required Items to Access (leave empty to allow all players)
Config.RequiredItems = {
    -- "lockpick",
    -- "phone"
}

-- Police Alert Settings
Config.PoliceAlertChance = 20 -- Percentage chance for police alert
Config.PoliceJobs = {"police", "sheriff", "state"}
Config.PoliceProximityCheck = true -- Check if police nearby before trades
Config.PoliceProximityDistance = 100.0 -- Distance in units

-- Dispatch System Configuration
Config.DispatchScript = "auto" -- "auto", "qb-dispatch", "esx-dispatch", "tkdispatch", "cd_dispatch", "ps-dispatch", "custom"
Config.DispatchSettings = {
    title = "Suspicious Activity",
    code = "10-15",
    removeTime = 600000, -- 10 minutes visibility
    playSound = true,
    showLocation = true,
    blip = {
        color = 1,
        sprite = 1,
        scale = 1.0
    }
}

-- Trade Cooldown (in seconds)
Config.TradeCooldown = 300 -- 5 minutes

-- Reputation System
Config.EnableReputation = true
Config.ReputationGainBuy = 2 -- Points gained from buying
Config.ReputationGainSell = 3 -- Points gained from selling
Config.ReputationLevels = {
    {level = 1, name = "Street Punk", minRep = 0, discount = 0},
    {level = 2, name = "Small Timer", minRep = 50, discount = 5},
    {level = 3, name = "Regular", minRep = 150, discount = 10},
    {level = 4, name = "Trusted", minRep = 300, discount = 15},
    {level = 5, name = "VIP", minRep = 500, discount = 20}
}

-- Minigame Settings
Config.EnableMinigames = true
Config.MinigameType = "hacking" -- "hacking" or "lockpick"
Config.MinigameDifficulty = 3 -- 1-5 difficulty level

-- Dynamic Events
Config.EnableEvents = true
Config.EventChance = 10 -- Percentage chance every 30 minutes
Config.EventDuration = 600 -- Event duration in seconds (10 minutes)
Config.EventDiscount = 30 -- Discount percentage during events

-- Time and Weather Restrictions
Config.NightOnly = false -- Only open at night (20:00 - 06:00)
Config.BadWeatherOnly = false -- Only open during bad weather

-- Currency Settings
Config.UseDirtyMoney = true -- Use dirty_money instead of cash
Config.EnableLaundering = true -- Allow money laundering
Config.LaunderingFee = 15 -- Percentage fee for laundering
Config.LaunderingRisk = 25 -- Police alert chance when laundering

-- Selling Settings
Config.SellGiveCleanMoney = true -- Give clean money instead of dirty money/markedbills when selling
Config.SellMoneyDeduction = 15 -- Percentage deduction when selling for clean money (15% = player gets 85% of price)

-- Group Trading
Config.EnableGroupTrades = true
Config.MaxGroupSize = 4
Config.GroupReputationShare = 0.5 -- Percentage of rep shared with group

-- Admin Logging
Config.EnableLogging = true
Config.LogToDiscord = false -- Set to true and configure webhook
Config.DiscordWebhook = "" -- Discord webhook URL
Config.LogToFile = true

-- Black Market Items (organized by categories and reputation levels)
Config.Items = {
    ["buy"] = {
        -- Pistols
        {
            item = "weapon_pistol",
            label = "Pistol",
            basePrice = 3000,
            priceRange = {min = 2500, max = 3500},
            currency = "money",
            category = "pistols",
            minReputation = 0
        },
        {
            item = "weapon_pistol50",
            label = "Heavy Pistol",
            basePrice = 3500,
            priceRange = {min = 3000, max = 4000},
            currency = "money",
            category = "pistols",
            minReputation = 25
        },
        {
            item = "weapon_revolver",
            label = "Revolver",
            basePrice = 4000,
            priceRange = {min = 3500, max = 4500},
            currency = "money",
            category = "pistols",
            minReputation = 50
        },
        {
            item = "weapon_microsmg",
            label = "Micro SMG",
            basePrice = 5000,
            priceRange = {min = 4500, max = 5500},
            currency = "money",
            category = "smgs",
            minReputation = 75
        },
        {
            item = "weapon_smg",
            label = "SMG",
            basePrice = 6500,
            priceRange = {min = 6000, max = 7000},
            currency = "money",
            category = "smgs",
            minReputation = 100
        },
        {
            item = "weapon_assaultrifle",
            label = "Assault Rifle",
            basePrice = 8000,
            priceRange = {min = 7500, max = 8500},
            currency = "money",
            category = "rifles",
            minReputation = 150
        },
        {
            item = "weapon_carbinerifle",
            label = "Carbine Rifle",
            basePrice = 9000,
            priceRange = {min = 8500, max = 9500},
            currency = "money",
            category = "rifles",
            minReputation = 200
        },
        {
            item = "armor",
            label = "Body Armor",
            basePrice = 1500,
            priceRange = {min = 1200, max = 1800},
            currency = "money",
            category = "armor",
            minReputation = 0
        },
        {
            item = "pistol_ammo",
            label = "Pistol Ammo",
            basePrice = 50,
            priceRange = {min = 40, max = 60},
            currency = "money",
            category = "ammunition",
            minReputation = 0
        },
        {
            item = "rifle_ammo",
            label = "Rifle Ammo",
            basePrice = 80,
            priceRange = {min = 70, max = 90},
            currency = "money",
            category = "ammunition",
            minReputation = 25
        },
        {
            item = "smg_ammo",
            label = "SMG Ammo",
            basePrice = 65,
            priceRange = {min = 55, max = 75},
            currency = "money",
            category = "ammunition",
            minReputation = 15
        },
        {
            item = "shotgun_ammo",
            label = "Shotgun Ammo",
            basePrice = 45,
            priceRange = {min = 35, max = 55},
            currency = "money",
            category = "ammunition",
            minReputation = 10
        },
        {
            item = "lockpick",
            label = "Lockpick",
            basePrice = 150,
            priceRange = {min = 120, max = 180},
            currency = "money",
            category = "tools",
            minReputation = 0
        },
        {
            item = "drill",
            label = "Drill",
            basePrice = 2500,
            priceRange = {min = 2200, max = 2800},
            currency = "money",
            category = "tools",
            minReputation = 50
        },
        {
            item = "weapon_pistol_ammo",
            label = "Pistol Ammo",
            basePrice = 50,
            priceRange = {min = 40, max = 60},
            currency = "money",
            category = "ammo",
            minReputation = 0
        },
        {
            item = "weapon_smg_ammo",
            label = "SMG Ammo",
            basePrice = 75,
            priceRange = {min = 65, max = 85},
            currency = "money",
            category = "ammo",
            minReputation = 50
        },
        {
            item = "weapon_rifle_ammo",
            label = "Rifle Ammo",
            basePrice = 100,
            priceRange = {min = 90, max = 110},
            currency = "money",
            category = "ammo",
            minReputation = 100
        },
        {
            item = "trojan_usb",
            label = "Trojan USB",
            basePrice = 5000,
            priceRange = {min = 4500, max = 5500},
            currency = "money",
            category = "tools",
            minReputation = 100
        },
        {
            category = "ammo",
            minReputation = 100
        },
        {
            item = "electronickit",
            label = "Electronic Kit",
            basePrice = 5000,
            priceRange = {min = 4500, max = 5500},
            currency = "money",
            category = "tools",
            minReputation = 100
        },
        {
            item = "lockpick",
            label = "Lockpick",
            basePrice = 200,
            currency = "money",
            category = "tools",
            minReputation = 0
        },
        
        -- Ammo
        {
            item = "pistol_ammo",
            label = "Pistol Ammo",
            basePrice = 100,
            currency = "money",
            category = "ammo",
            minReputation = 0
        },
        {
            item = "rifle_ammo",
            label = "Rifle Ammo",
            basePrice = 1500,
            currency = "money",
            category = "ammo",
            minReputation = 150
        },
        {
            item = "smg_ammo",
            label = "SMG Ammo",
            basePrice = 1000,
            currency = "money",
            category = "ammo",
            minReputation = 50
        },
        {
            item = "shotgun_ammo",
            label = "Shotgun Ammo",
            basePrice = 2000,
            currency = "money",
            category = "ammo",
            minReputation = 100
        }
    },
    ["sell"] = {
        -- Standard QB-Core Sellable Items (gives markedbills by default)
        {
            item = "rolex",
            label = "Stolen Rolex",
            price = {min = 800, max = 1500},
            currency = "markedbills",
            category = "jewelry",
            minReputation = 0
        },
        {
            item = "goldbar",
            label = "Gold Bar",
            price = {min = 2000, max = 3500},
            currency = "markedbills",
            category = "precious",
            minReputation = 0
        },
        {
            item = "diamond",
            label = "Diamond",
            price = {min = 1200, max = 2000},
            currency = "markedbills",
            category = "precious",
            minReputation = 0
        },
        {
            item = "goldchain",
            label = "Gold Chain",
            price = {min = 400, max = 800},
            currency = "markedbills",
            category = "jewelry",
            minReputation = 0
        },
        {
            item = "tablet",
            label = "Stolen Tablet",
            price = {min = 600, max = 1200},
            currency = "markedbills",
            category = "electronics",
            minReputation = 0
        },
        {
            item = "laptop",
            label = "Stolen Laptop",
            price = {min = 800, max = 1600},
            currency = "markedbills",
            category = "electronics",
            minReputation = 25
        },
        {
            item = "phone",
            label = "Stolen Phone",
            price = {min = 300, max = 600},
            currency = "markedbills",
            category = "electronics",
            minReputation = 0
        },
        {
            item = "paintingg",
            label = "Stolen Painting",
            price = {min = 3000, max = 5000},
            currency = "markedbills",
            category = "art",
            minReputation = 50
        },
        {
            item = "10kgoldchain",
            label = "10k Gold Chain",
            price = {min = 1000, max = 1800},
            currency = "markedbills",
            category = "jewelry",
            minReputation = 25
        },
        {
            item = "security_card_01",
            label = "Security Card",
            price = {min = 500, max = 1000},
            currency = "markedbills",
            category = "data",
            minReputation = 50
        },
        {
            item = "cryptostick",
            label = "Crypto Stick",
            price = {min = 2000, max = 4000},
            currency = "markedbills",
            category = "data",
            minReputation = 75
        },
        {
            item = "usb_drive",
            label = "Encrypted USB Drive",
            price = {min = 5000, max = 8000},
            currency = "markedbills",
            category = "data",
            minReputation = 150
        }
    }
}

-- Localization Settings
Config.Locale = "en" -- Available: "en", "de", "fr", "es", "it", "pt" (expandable)

-- Debug Settings
Config.Debug = false -- Set to true to enable debug messages

-- Notification & Progress Settings
Config.UseAgencyScripts = true -- Set to true if you have Agency-Notify and Agency-Progressbar
Config.NotificationType = "agency" -- "framework" or "agency"
Config.ProgressType = "agency" -- "framework" or "agency"

-- Dealer Behavior Settings
Config.InteractDistance = 3.0 -- Distance to interact with dealer
Config.DealerNegotiationChance = 25 -- Percentage chance dealer asks for more money
Config.DealerExtraMoneyPercent = {min = 10, max = 30} -- Extra money percentage range
Config.DealerEscapeOnRefusal = true -- Dealer escapes and calls police if extra money refused
Config.DealerRelocateOnEscape = true -- Dealer moves to new random location after escape
Config.DealerEscapeTime = 30000 -- Time in ms before dealer respawns at new location

-- Sell Extortion Settings
Config.SellExtortionChance = 30 -- Percentage chance dealer demands extortion after sale
Config.SellExtortionPercent = {min = 15, max = 25} -- Percentage of sale price demanded as extortion
Config.ExtortionRefusalPenalty = true -- Call police if player refuses extortion
Config.ExtortionReputationLoss = {min = 10, max = 20} -- Reputation loss for refusing extortion

-- Dealer Location Rotation Settings
Config.DealerLocationRotation = true -- Enable automatic dealer location rotation
Config.LocationRotationInterval = 2 * 60 * 60 -- 2 hours in seconds

-- Price fluctuation system
Config.EnablePriceFluctuation = true
Config.PriceFluctuationInterval = 20 * 60 -- 20 minutes in seconds (fixed)
Config.PriceFluctuationRange = {min = 0.85, max = 1.15} -- 85% to 115% of base price multiplier range (80% to 120%)

-- Minigame Configurations
Config.HackingGame = {
    blocks = 6,
    time = 10000, -- 10 seconds
}

Config.LockpickGame = {
    pins = 5,
    time = 15000, -- 15 seconds
    difficulty = 3
}

Need help? Join our Discord community for support!

Join Discord