> 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-1.md). Agents can also search and read this documentation through its [MCP server](https://shift-studios.gitbook.io/docs/~gitbook/mcp).

# Plugs

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%2FSVt4IIqabEuEk187lcpc%2F6703f877-7c2f-45a3-8a3b-546d39099987%20(1).png?alt=media&amp;token=bc846404-cdd4-4586-904a-0e227b10e729" alt=""><figcaption></figcaption></figure>

### Installation

{% stepper %}
{% step %}

### Plugs

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-plugs In Your Server CFG.
{% endstep %}

{% step %}

### Install The SQL Table

```sql
CREATE TABLE IF NOT EXISTS `shift_plugs_cooldowns` (
    `identifier` VARCHAR(80) NOT NULL,
    `plug_id` INT NOT NULL,
    `product_id` VARCHAR(80) NOT NULL,
    `expires_at` BIGINT UNSIGNED NOT NULL,
    PRIMARY KEY (`identifier`, `plug_id`, `product_id`),
    KEY `expires_at` (`expires_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
```

{% endstep %}

{% step %}

### Configure Resource

Make Sure To Configure The Resource To Your Liking

{% code expandable="true" %}

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

Config = {}
Config.Framework = 'auto' -- auto, esx, qb, qbx, standalone
Config.Inventory = 'auto' -- auto, ox_inventory, qb-inventory, ps-inventory, lj-inventory, qs-inventory, framework, custom
Config.Target = 'auto' -- auto, ox_target, qb-target, qtarget, none
Config.TextUI = 'auto' -- auto, ox_lib, qb-core, esx_textui, okokTextUI, native, custom
Config.Notification = 'auto' -- auto, ox_lib, qb, qbx, esx, okokNotify, custom, none

Config.Notifications = {
    position = 'center-left', -- top, top-right, top-left, bottom, bottom-right, bottom-left, center-right, center-left
    duration = 4000,
    title = 'Plugs'
}

Config.InteractionMode = 'auto' -- auto, target, textui

Config.Debug = false

Config.UI = {
    theme = 'dark', -- dark or light (players can toggle and their choice persists locally)
    position = 'right', -- left or right (players can switch sides in-game and their choice persists locally)
    seller = 'Private Seller',
    productDescription = 'Purchase Directly From The Private Seller.',
    purchaseButton = 'Purchase Product',
    closeOnPurchase = true,

    amount = {
        min = 1,
        max = 100
    },

    -- Compact progress style matching the current Shift Studios purchase bar.
    progress = {
        enabled = true,
        title = 'Completing Purchase...',
        status = 'Exchanging Payment For Items',
        cancelText = 'Cancel',
        duration = 5000
    }
}


Config.Interaction = {
    key = 38, -- E
    keyLabel = 'E',
    distance = 2.0,
    targetIcon = 'fas fa-handshake',
    targetLabel = 'Talk To Plug',
    text = '[E] Talk To Plug',
    textPosition = 'left'
}

Config.Animation = {
    enabled = true,
    dict = 'mp_common',
    player = 'givetake1_a',
    plug = 'givetake1_b',
    delay = 2000, -- milliseconds after the progress starts
    duration = 1800,
    playerFlag = 48,
    plugFlag = 48,
    faceEachOther = true
}

Config.Security = {
    maxDistance = 3.5,
    completeDistance = 4.0,
    eventCooldown = 1200, -- milliseconds between purchase attempts
    pendingTimeout = 15000, -- milliseconds; must be longer than progress duration
    tokenLength = 32,
    cancelOnDeath = true
}

Config.Cooldowns = {
    persist = true,
    tableName = 'shift_plugs_cooldowns',
    scope = 'product' -- product or plug
}

Config.Messages = {
    unavailable = 'This plug is not available right now.',
    tooFar = 'You are too far away from the plug.',
    restricted = 'This plug does not deal with you.',
    cooldown = 'Come back in %s.',
    inventoryFull = 'You do not have enough inventory space.',
    notEnoughMoney = 'You do not have enough %s.',
    purchaseFailed = 'The purchase could not be completed.',
    purchaseCancelled = 'Purchase cancelled.',
    purchaseSuccess = 'Purchased %sx %s for $%s.',
    busy = 'You already have a purchase in progress.'
}

-- Payment adapters are configurable per framework.
-- ESX dirty money defaults to mode = 'auto'. With ox_inventory this detects
-- whether black_money is configured as an ox account/currency or as a normal
-- inventory item. Use mode = 'account' or mode = 'item' to force one method.
-- QBCore/Qbox do not have one universal dirty-money standard, so their default
-- uses an inventory item named black_money. Change the item if your server uses
-- marked bills or another dirty-money item.
Config.PaymentTypes = {
    cash = {
        label = 'Cash',
        esx = { kind = 'money', account = 'money' },
        qb = { kind = 'money', account = 'cash' },
        qbx = { kind = 'money', account = 'cash' },
        standalone = { kind = 'custom', account = 'cash' }
    },
    bank = {
        label = 'Bank',
        esx = { kind = 'money', account = 'bank' },
        qb = { kind = 'money', account = 'bank' },
        qbx = { kind = 'money', account = 'bank' },
        standalone = { kind = 'custom', account = 'bank' }
    },
    dirty = {
        label = 'Dirty Cash',
        esx = { kind = 'dirty', mode = 'auto', account = 'black_money', item = 'black_money' },
        qb = { kind = 'item', item = 'black_money' },
        qbx = { kind = 'item', item = 'black_money' },
        standalone = { kind = 'custom', account = 'dirty' }
    }
}

Config.Plugs = {
    [1] = {
        label = 'Drug Plug',
        seller = 'Private Seller',
        model = 'g_m_y_mexgang_01',
        coords = vec4(1728.4606, 3851.8867, 33.7849, 219.4827),

        interaction = {
            label = 'Talk To Plug',
            icon = 'fas fa-handshake',
            distance = 2.0
        },

        -- false = no restriction. A string requires that exact group.
        -- A table can contain allowed names: { ballas = true, families = true }
        job = false,
        gang = false,

        products = {
            {
                id = 'pills',
                item = 'shift_pills',
                label = 'Shift Pills',
                description = 'Purchase Directly From The Private Seller.',
                price = 500,
                amount = 5, -- Items received per entered Amount
                minPurchaseAmount = 1,
                maxPurchaseAmount = 100,
                payment = 'dirty',
                cooldown = 30 * 60
            }
        }
    }
}

```

{% endcode %}
{% endstep %}

{% step %}

### Restart / Start Your Server

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