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:

FieldTypeDescription
itemstringItem spawn name
labelstring?Display label (defaults to item name)
metadatatable?Item metadata
categorystring?Category id (defaults to 'misc')
quantitynumber?Amount (defaults to 1)
pricenumber?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,
})

Copyright © 2025 Felis Development