# 🔧 Installation

{% hint style="warning" %}
Make sure you download this resource form [portal.cfx.re](https://portal.cfx.re/) before following this install
{% endhint %}

#### Installation <a href="#installation" id="installation"></a>

1. **Download the script** and extract it to your resources folder
2. **Add to server.cfg**:Plain Text

   <a class="button secondary">Copy</a>

   ```
   ensure xgc-queue
   ensure XGC-tow
   ```
3. **Configure config.lua** with your admin IDs and preferences
4. **Restart your server**

#### Configuration <a href="#configuration" id="configuration"></a>

**Basic Setup**

Edit `config.lua` to customize:

**Enable/Disable Queue**

Lua

<a class="button secondary">Copy</a>

```
Config.EnableQueue = true                   -- Enable the queue system
Config.MaxQueueSize = 50                    -- Maximum queue size
```

**Add Admins**

Lua

<a class="button secondary">Copy</a>

```
Config.Admins = {
    'steam:110000100000000',                -- Your Steam ID
    'license:abc123def456',                 -- Your License
}
```

**Add Priority Groups**

Lua

<a class="button secondary">Copy</a>

```
Config.VIPGroup = {
    enabled = true,
    priority = 1,
    identifiers = {
        'steam:110000100000002',
        'steam:110000100000003',
    }
}
```

**Framework Configuration**

The script auto-detects your framework, but you can manually specify:Lua

<a class="button secondary">Copy</a>

```
Config.Framework = 'auto'                   -- 'auto', 'qbcore', 'esx', or 'standalone'
```

#### Admin Commands <a href="#admin-commands" id="admin-commands"></a>

**Queue Status**

Plain Text

<a class="button secondary">Copy</a>

```
queuestatus
```

Displays the current queue status, including queue size and connected players.

**Skip Player in Queue**

Plain Text

<a class="button secondary">Copy</a>

```
queueskip [position]
```

Moves a player at the specified position to the front of the queue.Example: `queueskip 5` - Skips the 5th player in queue

**Remove Player from Queue**

Plain Text

<a class="button secondary">Copy</a>

```
queueremove [position]
```

Removes a player at the specified position from the queue.Example: `queueremove 3` - Removes the 3rd player in queue

#### Configuration Options <a href="#configuration-options" id="configuration-options"></a>

**Queue Settings**

* `EnableQueue` - Enable/disable the queue system
* `MaxQueueSize` - Maximum players in queue
* `ProcessInterval` - Queue processing interval (milliseconds)

**Admin Configuration**

* `Admins` - List of admin identifiers (always bypass queue)
* `VIPGroup` - VIP members with priority access
* `ModeratorGroup` - Moderators with priority access
* `SupporterGroup` - Supporters with priority access

**Framework Settings**

* `Framework` - Framework to use ('auto', 'qbcore', 'esx', 'standalone')
* `QBCore.enabled` - Enable QBCore support
* `ESX.enabled` - Enable ESX support
* `Standalone.enabled` - Enable Standalone support

**Advanced Features**

* `Whitelist.enabled` - Enable whitelist system
* `Blacklist.enabled` - Enable blacklist system
* `AutoKick.enabled` - Auto-kick inactive players from queue
* `Discord.enabled` - Send queue updates to Discord

#### Identifier Formats <a href="#identifier-formats" id="identifier-formats"></a>

The script supports multiple identifier formats:

* **Steam ID**: `steam:110000100000000`
* **License**: `license:abc123def456`
* **Discord ID**: `discord:123456789`
* **License2**: `license2:abc123def456`

#### Customization <a href="#customization" id="customization"></a>

**Custom Priority Check**

Add your own priority logic in `config.lua`:Lua

<a class="button secondary">Copy</a>

```
function Config.CustomPriorityCheck(source, identifier, license)
    -- Your custom logic here
    return false
end
```

**Custom Messages**

Customize queue messages:Lua

<a class="button secondary">Copy</a>

```
Config.Messages = {
    InQueue = 'You are in the connection queue. Please wait...',
    QueueFull = 'The queue is currently full. Please try again later.',
    -- Add more custom messages
}
```

#### Exports <a href="#exports" id="exports"></a>

The script provides the following exports for other resources:Lua

<a class="button secondary">Copy</a>

```
-- Get player's current queue position
local position = exports['xgc-queue']:GetQueuePosition(source)

-- Get total queue size
local queueSize = exports['xgc-queue']:GetQueueSize()

-- Check if player is in queue
local inQueue = exports['xgc-queue']:IsPlayerInQueue(source)
```

#### Console Output <a href="#console-output" id="console-output"></a>

The script provides branded console output for easy monitoring:Plain Text

<a class="button secondary">Copy</a>

```
[XGC Queue]: # "XGC Development Connection Queue System Starting..."
[XGC Queue]: # "Detecting framework..."
[XGC Queue]: # "Framework detected: QBCORE"
[XGC Queue]: # "Queue system enabled with max queue size: 50"
[XGC Queue]: # "Configuration loaded successfully"
```

#### Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

**Queue Not Working**

* Ensure `Config.EnableQueue = true` in config.lua
* Check that `Config.MaxQueueSize` is greater than 0
* Verify the script is properly added to server.cfg

**Admins Not Bypassing Queue**

* Verify admin identifiers are correctly formatted
* Check console for any error messages
* Use `queuestatus` command to verify admin status

**Framework Not Detected**

* Ensure your framework resource is started before xgc-queue
* Manually set `Config.Framework` in config.lua
* Check console output for framework detection messages

#### Support <a href="#support" id="support"></a>

For support and updates, visit:

* **Discord**: [https://discord.gg/xgcdevelopment](https://discord.gg/cn9W67JAwB)
* **Website**: <https://xgc-development.tebex.io/>
* **Email**: <xgcdevs@outlook.com>

#### License <a href="#license" id="license"></a>

This script is protected by FiveM's Keymaster escrow system and is the property of XGC Development.

#### Version History <a href="#version-history" id="version-history"></a>

**v1.0.0 (Initial Release )**

* Multi-framework support
* Priority queue system
* Admin commands
* Comprehensive configuration
* Server-side logging

**XGC Development - Elevating Your Server Experience**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xgc-development-2.gitbook.io/xgc-development-docs/xgc-queue/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
