> For the complete documentation index, see [llms.txt](https://shift-studios.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shift-studios.gitbook.io/docs/new/editor-24.md). Agents can also search and read this documentation through its [MCP server](https://shift-studios.gitbook.io/docs/~gitbook/mcp).

# Black Market

Transform Your Server With Shift Studios — Powerful, Optimized, And Reliable Resources Built To Improve Every Experience.

<figure><img src="https://4062160621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgqh3gjuJzDAWNXTD9sEE%2Fuploads%2FGlVJS6YMWOICaCNv706o%2F3e8dcc6a-e946-43b8-bd4b-fab1ac32d631.png?alt=media&amp;token=2fbddb12-1c57-4ecd-a60c-fd98579a9c25" alt=""><figcaption></figcaption></figure>

### Installation

{% stepper %}
{% step %}

### Black Market

Read Everything Below To Install
{% endstep %}

{% step %}

### Drag & Drop

Drag & Drop The Resource Into Your FiveM Server
{% endstep %}

{% step %}

### Ensure The Resource

Make Sure To Ensure shift-blackmarket In Your Server CFG.
{% endstep %}

{% step %}

### Configure Resource

Make Sure To Configure The Resource To Your Liking

You Can Configure Your Discord Logs In server/config.discord.lua

{% code expandable="true" %}

```lua
-- ⚫ ███████╗██╗  ██╗██╗███████╗████████╗    ███████╗████████╗██╗   ██╗██████╗ ██╗ ██████╗ ███████╗ ⚫
-- ⬛ ██╔════╝██║  ██║██║██╔════╝╚══██╔══╝    ██╔════╝╚══██╔══╝██║   ██║██╔══██╗██║██╔═══██╗██╔════╝ ⬛
-- ⚫ ███████╗███████║██║█████╗     ██║       ███████╗   ██║   ██║   ██║██║  ██║██║██║   ██║███████╗ ⚫
-- ⬛ ╚════██║██╔══██║██║██╔══╝     ██║       ╚════██║   ██║   ██║   ██║██║  ██║██║██║   ██║╚════██║ ⬛
-- ⚫ ███████║██║  ██║██║██║        ██║       ███████║   ██║   ╚██████╔╝██████╔╝██║╚██████╔╝███████║ ⚫
-- ⬛ ╚══════╝╚═╝  ╚═╝╚═╝╚═╝        ╚═╝       ╚══════╝   ╚═╝    ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚══════╝ ⬛

Config = {}

Config.Debug = false

-- auto, esx, qb, qbox, standalone
Config.Framework = 'auto'

-- auto, ox, qb, qs, codem, esx, custom
Config.Inventory = 'auto'

Config.UI = {
    title = 'Black Market',
    subtitle = 'Private Stock • Mobile Vendor',

    -- Server-owner UI controls. The monochrome theme and black-market icon are built into the NUI.
    scale = 1.00,
    textScale = 1.00,

    closeOnPurchase = true
}

Config.Target = {
    -- auto, ox, qb, qtarget, textui
    provider = 'auto',
    label = 'Access Black Market',
    icon = 'fa-solid fa-user-secret',
    distance = 2.2,
    bones = {
        'door_dside_r',
        'door_pside_r',
        'boot',
        'platelight'
    }
}

Config.TextUI = {
    -- ox, qb, custom
    provider = 'ox',
    key = 38, -- E
    keyLabel = 'E',
    text = 'Access Black Market',
    position = 'right-center'
}

Config.Notifications = {
    -- ox, qbox, qb, esx, wasabi, okok, mythic, custom
    provider = 'ox',
    title = 'Black Market',
    position = 'center-left',
    duration = 4500
}

Config.Payment = {
    -- money or item
    type = 'money',

    -- Universal fallback account. ESX defaults to black_money below.
    account = 'cash',
    accountByFramework = {
        esx = 'black_money',
        qb = 'cash',
        qbox = 'cash',
        standalone = 'cash'
    },

    labelByFramework = {
        esx = 'Dirty Money',
        qb = 'Cash',
        qbox = 'Cash',
        standalone = 'Cash'
    },

    -- Used when type = 'item'.
    item = 'markedbills',
    itemLabel = 'Marked Bills',

    handlingFee = 0.00
}

Config.Purchase = {
    maxQuantityPerItem = 25,
    maxUniqueItems = 20,
    cooldownMs = 850
}

Config.Security = {
    sessionDurationSeconds = 120,
    openDistance = 5.5,
    purchaseDistance = 7.5,
    validateDistance = true,
    rejectDeadPlayers = true
}

Config.Stock = {
    -- When disabled, every configured item has unlimited stock.
    enabled = false,
    restockMinutes = 30,
    defaultAmount = 10,
    showRemaining = true,
    -- Optional per-item overrides.
    amounts = {
        -- ['WEAPON_PISTOL'] = 5,
        -- ['ammo-9'] = 25,
    }
}

Config.VanGrounding = {
    enabled = true,
    startupDelay = 3000,
    spawnDistance = 200.0,

    -- Give map collision time to exist at the vendor location after a resource/server restart.
    collisionTimeout = 6000,
    collisionRequestInterval = 100,

    -- The van is created above the configured coordinates, hidden, then placed on the resolved ground.
    spawnHeight = 3.0,
    groundSearchHeight = 75.0,
    settleAttempts = 10,
    settleDelay = 75,

    -- Fine tuning after automatic model/ground placement. Usually leave this at 0.0.
    finalZOffset = 0.0
}

Config.VehicleDoors = {
    open = true,
    closeOnExit = true,
    indexes = { 2, 3 }
}

Config.WeaponPreview = {
    enabled = true,
    hidePlayer = true,
    freezePlayer = true,

    -- VISUAL center of the displayed weapon relative to the market van.
    -- The script compensates for each weapon model's pivot so this point stays centered.
    objectOffset = vec3(0.0, -2.20, 0.62),
    objectRotation = vec3(0.0, 0.0, 90.0),
    scale = 1.0,

    -- Automatically lays tall models such as bats/crowbars horizontally and keeps
    -- normal firearms side-on to the rear camera. Per-item overrides still take priority.
    autoOrient = true,
    autoOrientThreshold = 1.12,

    -- Camera stays behind the rear doors and always looks at objectOffset above.
    -- Adaptive framing uses the complete model bounds so long weapons remain fully visible.
    cameraOffset = vec3(0.0, -4.60, 0.72),
    adaptiveFraming = true,
    fitPadding = 1.35,
    minCameraDistance = 2.10,
    maxCameraDistance = 6.00,
    cameraHeightOffset = 0.00,

    rotationSpeed = 0.35,
    minFov = 28.0,
    maxFov = 60.0,
    defaultFov = 42.0
}

-- Map a custom inventory item to a GTA weapon hash used by the 3D preview.
Config.WeaponPreviewItems = {
    -- ['weapon_custom_glock'] = 'WEAPON_PISTOL',
}

-- Optional per-item framing overrides for unusual addon weapon models.
-- Leave empty for normal GTA weapons; adaptive framing handles them automatically.
Config.WeaponPreviewOverrides = {
    -- ['WEAPON_MY_CUSTOM_RIFLE'] = {
    --     objectOffset = vec3(0.0, -2.20, 0.62),
    --     objectRotation = vec3(0.0, 0.0, 90.0),
    --     cameraOffset = vec3(0.0, -4.80, 0.72),
    --     scale = 1.0,
    --     fov = 42.0
    -- },
}

-- Inventory image paths. `%s` is replaced with the resolved inventory item name.
Config.InventoryImagePaths = {
    ox = 'nui://ox_inventory/web/images/%s.png',
    qb = 'nui://qb-inventory/html/images/%s.png',
    qs = 'nui://qs-inventory/html/images/%s.png',
    codem = 'nui://codem-inventory/html/itemimages/%s.png',
    esx = 'nui://ox_inventory/web/images/%s.png',
    custom = 'nui://ox_inventory/web/images/%s.png'
}

-- Override image file names/paths for specific catalog keys when required.
Config.ItemImages = {
    -- ['WEAPON_PISTOL'] = 'nui://my_inventory/images/pistol.png',
}

-- Automatic inventory item-name conversion.
-- QBCore-style inventories normally use lowercase weapon item names.
Config.InventoryNaming = {
    lowercaseWeaponsFor = {
        qb = true,
        qs = true,
        codem = true
    },

    -- Common ammo aliases for QBCore-style inventories. Edit these to match your server.
    ammoAliases = {
        qb = {
            ['ammo-9'] = 'pistol_ammo',
            ['ammo-45'] = 'smg_ammo',
            ['ammo-50'] = 'pistol_ammo',
            ['ammo-shotgun'] = 'shotgun_ammo',
            ['ammo-rifle'] = 'rifle_ammo',
            ['ammo-rifle2'] = 'rifle_ammo',
            ['ammo-sniper'] = 'snp_ammo',
            ['ammo-heavysniper'] = 'snp_ammo',
        },
        qs = {},
        codem = {}
    },

    utilityAliases = {
        qb = {
            ['armour'] = 'armor'
        },
        qs = {},
        codem = {}
    }
}

Config.Categories = {
    { id = 'all', label = 'All Stock', icon = 'grid' },
    { id = 'weapons', label = 'Weapons', icon = 'weapon' },
    { id = 'ammo', label = 'Ammunition', icon = 'ammo' },
    { id = 'utility', label = 'Utility', icon = 'utility' }
}

-- Optional client-side integration hooks.
Config.CustomClient = {}

Config.CustomClient.ShowTextUI = function(text)
    return false
end

Config.CustomClient.HideTextUI = function()
    return false
end

Config.CustomClient.Notify = function(message, notifyType)
    return false
end

-- Optional server-side framework/inventory hooks.
Config.CustomServer = {}

Config.CustomServer.GetIdentifier = function(source)
    return GetPlayerIdentifierByType(source, 'license') or GetPlayerIdentifier(source, 0)
end

Config.CustomServer.HasMoney = function(source, account, amount)
    return false
end

Config.CustomServer.RemoveMoney = function(source, account, amount)
    return false
end

Config.CustomServer.AddMoney = function(source, account, amount)
    return false
end

Config.CustomServer.GetItemCount = function(source, item)
    return 0
end

Config.CustomServer.CanCarryItem = function(source, item, count, metadata)
    return true
end

Config.CustomServer.AddItem = function(source, item, count, metadata)
    return false
end

Config.CustomServer.RemoveItem = function(source, item, count, metadata)
    return false
end

Config.CustomServer.GetItemLabel = function(item)
    return nil
end

```

{% endcode %}
{% endstep %}

{% step %}

### Restart / Start Your Server

Ensure Everything Is Working Well & Enjoy !!
{% endstep %}
{% endstepper %}
