Why Most Blackmarket Scripts Fail
A badly designed blackmarket script is the fastest way to wreck a server's economy. Too cheap and everyone becomes a criminal. Too expensive and nobody uses it. Too safe and there's no risk. Too risky and players burn out. Agency-Blackmarket was designed with economy balance as the primary concern, feature list second.
Dynamic Pricing by Demand
Prices for every item shift based on how many players have bought that item recently. Supply-and-demand happens automatically — if the whole server is buying AR-15s, the price doubles within hours. When demand drops, prices slowly normalize. This creates natural market rhythms instead of fixed shopping lists.
The Risk Side
Every blackmarket visit has a configurable chance to trigger a police dispatch, an ambush event, or a rival-NPC encounter. Risk scales with purchase size. Smart players learn to break up big buys across multiple visits. Less-careful players get caught and lose their stash. This is the tension that keeps illegal RP interesting.
Admin Tooling
Every transaction is logged with player ID, item, price, and timestamp. Admins can see the server's shadow economy at a glance, set price floors, or disable specific items temporarily. This tooling is why professional RP communities trust us for their core economy scripts — we don't just sell features, we ship the management layer that keeps them running at scale.
Integrates With Your Jobs
Agency-Blackmarket exposes events that Agency-Minerjob, Agency-Admin, and your cop scripts can listen to. The ecosystem compounds — each individual script is useful alone, but together they create systemic emergent behavior that you couldn't script by hand.
Installation & Setup
Agency-Blackmarket requires oxmysql for transaction logging and dynamic price persistence. Import blackmarket.sql, drop the resource folder, and add ensure agency-blackmarket to server.cfg. Location coordinates are defined in config.lua — the resource ships with six default blackmarket coordinates across the default GTA V map that can be replaced with your custom MLO positions.
Items available for sale need to exist in your framework's item registry. The config includes a default item list; adding or removing items is a straightforward config table edit.
Configuration Options
The config.lua gives full control over economy and risk settings:
- Item catalog — define every item, its base price, min price floor, max price ceiling, and demand elasticity factor.
- Demand window — how many hours of purchase history the pricing algorithm looks back. Default: 6 hours.
- Risk events — configure police dispatch chance, ambush chance, and rival NPC spawn chance per purchase amount threshold.
- Location rotation — blackmarket locations can rotate on a schedule, forcing players to stay engaged with in-world information networks to find the current spot.
- Admin price override — senior admins can manually set temporary price floors or ceilings per item during economic events.
- Transaction log retention — how many days of purchase history are kept. Default: 30 days.
Framework Compatibility
QBCore and ESX adapters ship with the package. For standalone, implement four config functions: item give, money remove, police alert trigger, and the optional job-based access restriction. The pricing engine, risk event system, location management, and admin tooling are fully framework-agnostic.
Why This Matters for Roleplay
An illegal economy that functions too safely collapses into a routine shopping trip. Agency-Blackmarket's risk system is specifically designed to make every significant purchase feel like a decision, not a transaction. The player who spends ten minutes planning a big arms buy — scouting the location, timing their approach, deciding whether to bring backup — is having better RP than the player who just opens a menu and clicks buy.
The dynamic pricing creates natural scarcity without admin intervention. When the whole server is gearing up for a planned conflict, the price spike on weapons signals that spike to every player checking the market. Savvy criminal characters learn to buy before demand surges. This is emergent economy behavior that adds a layer of strategic depth that scripted fixed-price menus never can.
The admin transaction dashboard is what responsible RP economy management looks like. When a server's illegal economy is opaque, admins can't tell if the balance is healthy or broken until players start complaining. With full transaction visibility, you can see in real time if one player or group is buying disproportionately, and intervene before the imbalance ruins the server's criminal ecosystem.
Frequently Asked Questions
Can I make specific items accessible only to certain criminal organizations?
Yes. Each item in the catalog supports an optional requiredFlag field. Players with that flag set (managed through Agency-Admin or your own system) can see and purchase the item; others see it greyed out with a "restricted" label. This creates a tiered black market where higher-level criminal roles access better inventory.
How does the ambush event work?
When an ambush triggers, a group of hostile NPCs spawns at the blackmarket location and immediately engages the player. The NPC count and loadout scale with the purchase amount that triggered the event. Players who survive the ambush keep their purchase; those who don't lose it to the loot system. This is harsh by design — the risk must be real.
Can the pricing data be exported for external analysis?
The transaction log in oxmysql is directly queryable. We also expose a server-side export exports['agency-blackmarket']:GetPriceHistory(item, hours) that returns a table of price snapshots. Connect this to any external dashboard tool if you want visual graphs of your server's illegal economy over time.
How do I prevent one player from gaming the demand system to manipulate prices?
Set Config.PerPlayerDemandCap = true and Config.MaxPlayerDemandWeight = 0.3. This caps how much any single player's purchase history can influence the global price. Demand manipulation by one buyer still works but requires sustained coordination across multiple players to move prices significantly.
Requirements
- FiveM server (QBCore, ESX, or standalone)
- oxmysql
- cfx.re account with valid Agency-Blackmarket license
- Optional: Agency-Admin (for integrated transaction monitoring dashboard)
Seasonal Economy Events via the Admin Price Controls
Agency-Blackmarket's admin pricing tools open up event-driven economy design. A few patterns that work well:
Arms race event: Drop weapon prices by 30% for a 48-hour window and announce it in-character through NPC news broadcasts. This creates a brief window of increased criminal activity that police can gear up to respond to. The window closes before the economy destabilizes.
Supply shock: Temporarily disable a category of items (no explosives available for one week). Scarcity creates hoarding, black-market trading between players, and RP around the shortage. Restore availability and watch the market normalize.
New contraband introduction: Launch a new item at high price with low demand decay. Early adopters pay premium; as other players discover it, demand rises and prices spike before normalizing. The price history tells a story of how your community adopted the new item.
These economy events don't require scripting custom logic — they're admin configuration changes. That accessibility is the point: server admins who aren't developers can run economically interesting events using only the Agency-Blackmarket admin panel.
