Exports
Server Exports
addOrder
Creates an order from server side. Useful for external scripts that want to send items through the blackmarket pickup system.
---@param items table[] Array of items to include in the order
---@return table|false Result with orderId and pickupLocation, or false on failure
exports.fd_blackmarket:addOrder(items) Each item in the items array should have:
| Field | Type | Description |
|---|---|---|
item | string | Item spawn name |
label | string? | Display label (defaults to item name) |
metadata | table? | Item metadata |
category | string? | Category id (defaults to 'misc') |
quantity | number? | Amount (defaults to 1) |
price | number? | Price in BC (defaults to 0) |
Example:
local result = exports.fd_blackmarket:addOrder({
{ item = 'lockpick', label = 'Lockpick', quantity = 5 },
{ item = 'WEAPON_PISTOL', label = 'Pistol', quantity = 1 },
})
if result then
print('Order created:', result.orderId)
print('Pickup:', result.pickupLocation.x, result.pickupLocation.y, result.pickupLocation.z)
end deleteOrder
Cancels an existing order by its ID. Frees the associated pickup location and syncs the buyer.
---@param orderId string The order's localId
---@return boolean success
exports.fd_blackmarket:deleteOrder(orderId) Example:
local success = exports.fd_blackmarket:deleteOrder('abc-123-def')
if success then
print('Order cancelled')
end spawnTemporaryVehicle
Spawns a temporary server-side vehicle. Used internally for vehicle pickup locations but available as an export.
---@param payload table { model: string|number, coords: vector3, heading: number, plate?: string, vehicleType?: string }
---@return number|nil vehicle, string|nil plate
exports.fd_blackmarket:spawnTemporaryVehicle(payload) Example:
local vehicle, plate = exports.fd_blackmarket:spawnTemporaryVehicle({
model = 'burrito3',
coords = vec3(793.0, -2990.8, 6.0),
heading = 270.0,
})