Agency Docs
QBESXStandalone

Agency-Blackmarket V2 Exports & API

A living black market for FiveM on QBCore, Qbox, ESX or fully standalone.

v2.0.0Paid6 Pages

01Client Exports

ExportDescription
OpenMenu()Opens the /ablackmarket menu, for example from a radial menu or a phone app. The same checks apply as for the command.
CloseMenu()Closes the menu and gives the mouse back to the game.
IsMenuOpen()Returns true while the black market menu is open, at a dealer or anywhere.

02Server Exports

ExportDescription
GetReputation(source)The reputation points of a player, 0 for a player who has none yet.
SetReputation(source, value)Sets the reputation of a player to a fixed value, never below 0. Returns true on success.
AddReputation(source, amount)Adds reputation, or takes it away with a negative amount. A new level is announced to the player and to the Companion app. Returns true on success.
GetLevel(source)Returns two values: the number of the player's level (1 to 5 by default) and its name.
AddCredit(source, amount)Adds dealer credit, which the player can spend on his next purchase or order. Returns true on success.
RelocateDealer(dealerId)Moves a dealer to another of his places right away. Returns true when he moved.
SendDealerAway(dealerId, minutes)The dealer vanishes for the given minutes and then turns up at another of his places, as after a police visit.
IsDealerPresent(dealerId)True while the dealer stands at one of his places and is not away.
StartFlashSale(minutes)Starts a flash sale with random items at a discount. Without minutes the time from Config.FlashSale is used.

03Events

NameSideDescription
agency-blackmarket:dealServerFires on the server with (source, kind, data) after every deal. kind is buy, sell, launder, order, pickup or job, and data holds the details of the deal, such as the dealer, the items and the total.
agency-blackmarket:dealerMovedServerFires on the server with (dealerId, pos, reason) when a dealer changes his place. reason is rotate, return, admin or export.
agency-blackmarket:flashSaleServerFires on the server with (items, minutes) when a flash sale starts. items maps every item on sale to its discount in percent.

+Good to know

Agency-Blackmarket V2 offers exports and events so your own scripts can give reputation and credit, control the dealers and react to deals.

Reputation and Credit
GetReputation, SetReputation, AddReputation and GetLevel read and change a player's standing, and AddCredit pays dealer credit. They take the server id of a player who is online.
Dealers and Flash Sales
RelocateDealer, SendDealerAway and IsDealerPresent control the dealers with the id from Config.Dealers, and StartFlashSale starts a sale from your own event.
Events
agency-blackmarket:deal fires after every deal, agency-blackmarket:dealerMoved after every move and agency-blackmarket:flashSale when a sale starts. All three fire on the server only and can be used for logs, police tools or your own jobs.

?Frequently asked questions

How do I open the menu from my radial menu?

Call exports['Agency-Blackmarket']:OpenMenu() on the client. The same checks apply as for the command, including an item from Config.Menu.item.

Still stuck after this page? Our support team takes it from here.