Black Market Trading
A comprehensive underground trading system featuring an elusive NPC black market dealer who sells illegal weapons, contraband items, and restricted goods. The system includes dynamic inventory management with limited stock quantities, automatic restock timers that replenish supplies over time, configurable pricing structures, secret location mechanics requiring players to discover the hidden shop, waypoint/package delivery systems for illicit transactions, and administrative tools for managing the black market economy. Perfect for servers seeking enhanced criminal roleplay opportunities with an immersive underground economy.
Changelog
Libraries
1 entry
lia.blackmarket.registerBlackMarketItem(uniqueID, data)Black Market
Registers a new purchasable entry in the blackmarket item configuration and persists it to stored module data.
Parameters
The unique identifier used to store and retrieve the blackmarket item.
Table containing the blackmarket item settings such as price, display name, category, cooldown, max shipping, and faction restrictions.
Returns
Returns true when the item is stored successfully, or false when required data is missing.
Example Usage
lia.blackmarket.registerBlackMarketItem("illegal_weapon", {
price = 2500,
name = "Unregistered Assault Rifle",
category = "Weapons",
cooldown = 1800,
maxQuantity = 1,
factions = {FACTION_GANG, FACTION_MOB}
})Source: module.lua
Hooks
2 entries
PostLoadData()Lifecycle
Loads persisted blackmarket locations, refreshes the location swap timer, and spawns or moves the active blackmarket NPC after saved data is available.
Returns
Example Usage
function MODULE:PostLoadData()
if lia.blackmarket and lia.blackmarket.loadLocationsFromDisk then
lia.blackmarket.loadLocationsFromDisk()
end
refreshBlackmarketTimer()
lia.blackmarket.swapNPCPosition()
endSource: module.lua
OnDialogNPCTypeSet(Player client, Entity ent)NPC Management
Prevents administrators or persistent data from creating manual black market NPCs outside the map configurer flow.
Parameters
The player who attempted to assign the NPC type, when a player triggered the change.
The NPC entity that was assigned the blackmarket unique ID.
Returns
Example Usage
function MODULE:OnDialogNPCTypeSet(client, ent)
if not IsValid(ent) then return end
if ent.uniqueID == "blackmarket" and not ent.isBlackmarketNPC then
ent:Remove()
end
endSource: module.lua
0 = unlimited).