> For the complete documentation index, see [llms.txt](https://docs.cdev.shop/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cdev.shop/fivem/cdev-chess/installation-guide.md).

# Installation Guide

Step by step instructions to install this resource

{% stepper %}
{% step %}

### Install (or update) dependencies and optional

{% hint style="danger" %} <mark style="color:yellow;">**Verify all dependencies below are started**</mark><mark style="color:yellow;">**&#x20;**</mark>*<mark style="color:yellow;">**before**</mark>*<mark style="color:yellow;">**&#x20;**</mark><mark style="color:yellow;">**this script in your**</mark> **`server.cfg`**<mark style="color:yellow;">**.**</mark>
{% endhint %}

#### Required

| Resource      | Purpose                                                                                                                                 |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **oxmysql**   | Database driver for player data, ranking, and match history. [Download oxmysql](https://github.com/CommunityOx/oxmysql/releases/latest) |
| **Framework** | One of: qb-core, qbx\_core (QBox), es\_extended (ESX Legacy)                                                                            |
| **Inventory** | One of: ox\_inventory, qb-inventory, qs-inventory                                                                                       |

#### Optional

| Resource                        | Purpose                                                                                           |
| ------------------------------- | ------------------------------------------------------------------------------------------------- |
| **ox\_lib**                     | Enhanced notifications. [Download ox\_lib](https://github.com/CommunityOx/ox_lib/releases/latest) |
| **ox\_target** or **qb-target** | Target-based board interaction (alternative to DrawText)                                          |
| {% endstep %}                   |                                                                                                   |

{% step %}

### Install cDev\_Chess and create a new subfolder or extract folder to server's root

### Install resource from [Portal](https://portal.cfx.re/assets/granted-assets)

**After installing, you should get a zip file with the name shown below.**

* <mark style="color:yellow;">cdev\_chess.pack.zip</mark>

{% hint style="info" %}
Create a new subfolder optional step, but is *highly recommended*.
{% endhint %}

**If you haven’t already, create a new subfolder named `[cdev]` in your server’s root resources directory. Unzip (*****extract*****) this script into the newly created `[cdev]` subfolder.**

<div align="left"><figure><img src="https://1004862655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPhIA9eCA4bwgx77hxx4i%2Fuploads%2FnjxgmcqcFDzJA3anlLkM%2Fexplorer_8OlcrVO8O0.gif?alt=media&amp;token=f8213612-9c58-4d21-b30e-4e392745fc4d" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Add ACE permission

Open your `server.cfg` and add the following ACE permission:

```
add_ace group.admin cdev_chess.admin allow
```

**or**

```
add_ace identifier.license:xxxxxxxxxxxx cdev_chess.admin allow
```

{% hint style="danger" %} <mark style="color:$warning;">**Important:**</mark>**&#x20;If you are on the Qbox framework, the recommended place to paste the above permission is inside the `permissions.cfg` file instead of `server.cfg`.**
{% endhint %}
{% endstep %}

{% step %}

### Update server.cfg & perform a full restart

Once all other steps are completed, open your `server.cfg` & add `ensure cdev_chess` to the very **bottom** of your resource start list (after oxmysql, your framework, inventory, and target if used). Finally, perform a full server restart. Failure to perform a full restart after installation will cause errors.

<div align="left"><figure><img src="https://1004862655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPhIA9eCA4bwgx77hxx4i%2Fuploads%2FBX9s2Mu4bYU7tPdrd33z%2Fimage.png?alt=media&amp;token=4aa7fa4b-0d25-4a40-962e-8b2540ab245f" alt=""><figcaption></figcaption></figure></div>

{% hint style="success" %}
**Note: Once completed, use the command `/chessranking` in-game to open the leaderboard, or use the chess board item to place a board and play!**
{% endhint %}
{% endstep %}

{% step %}

### Add the chess board item

{% hint style="warning" %}
The item name must match `ChessConfig.Item.name` (default: `chess_board`). Follow the guide for your inventory:
{% endhint %}

{% tabs %}
{% tab title="Ox Inventory" %}
**Location:** `ox_inventory` → `data` → `items.lua`

1. Open `resources/[ox]/ox_inventory/data/items.lua`
2. Add the item inside the return table (with other items):

```lua
['chess_board'] = {
    label = 'Chess Board',
    weight = 500,
    stack = false,
    close = true,
    consume = 0,
    description = 'Use to play chess with a nearby player. Place it, then use E to open and choose side.',
    server = {
        export = 'cdev_chess.useChessBoard'
    }
},
```

3. Add the image `chess_board.png` to your inventory's images folder (e.g. `ox_inventory/web/images/`.
4. Save the file and perform a full server restart. Failure to perform a full restart after installation will cause errors.
   {% endtab %}

{% tab title="Qb Inventory" %}
**Location:** `qb-core` → `shared` → `items.lua`

1. Open `resources/[qb]/qb-core/shared/items.lua`
2. Add the item inside the `QBCore.Shared.Items` table:

```lua
['chess_board'] = {
    name = 'chess_board',
    label = 'Chess Board',
    weight = 500,
    type = 'item',
    image = 'chess_board.png',
    unique = false,
    useable = true,
    shouldClose = true,
    description = 'A portable chess board to play with friends.',
},
```

3. Add the image `chess_board.png` to your inventory's images folder (e.g. `qb-inventory/html/images/`
4. Save the file and perform a full server restart. Failure to perform a full restart after installation will cause errors.
   {% endtab %}

{% tab title="QS Inventory" %}
**Location:** depends on your framework:

* **QBCore:** `qb-core` → `shared` → `items.lua`
* **ESX:** `qs-inventory` → `shared` → `items.lua`

1. Open the items file for your framework.
2. Add the chess board item in the same format as your other items. Example (adjust to match your file structure):

```lua
['chess_board'] = {
    name = 'chess_board',
    label = 'Chess Board',
    weight = 500,
    type = 'item',
    image = 'chess_board.png',
    unique = false,
    useable = true,
    shouldClose = true,
    description = 'A portable chess board to play with friends.',
},
```

3. Add `chess_board.png` to your inventory's images folder.
4. Save the file and perform a full server restart. Failure to perform a full restart after installation will cause errors.
   {% endtab %}
   {% endtabs %}

{% hint style="danger" %}
**If you have a&#x20;**<mark style="color:yellow;">**custom framework, custom notify, custom inventory, and custom target**</mark>**, please read our configuration documentation so you can understand how to adapt it by clicking the link below.**
{% endhint %}

{% content-ref url="/pages/pJgbHsbA6MLxtnIi7viB" %}
[Configurations](/fivem/cdev-chess/configurations.md)
{% endcontent-ref %}
{% endstep %}

{% step %}

### ⭐ **In-Game Preview**

{% tabs %}
{% tab title="Player One (Owner Board / White Piece)" %}

#### Using the Chess Board from Inventory

<figure><img src="https://1004862655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPhIA9eCA4bwgx77hxx4i%2Fuploads%2FjZGHqdWhZKWAqux2vBH8%2FFiveM_GTAProcess_GqIW1LATE7.gif?alt=media&amp;token=4640b54e-88d5-4788-8566-8cf81a7a1f49" alt=""><figcaption></figcaption></figure>

#### Matching Settings (Only For White Piece Player)

<figure><img src="https://1004862655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPhIA9eCA4bwgx77hxx4i%2Fuploads%2F2Q8qi8pZ3iL2SEhYaTbo%2FFiveM_GTAProcess_FfMdDXvDEe.gif?alt=media&amp;token=64f311c5-330c-4d52-b412-2d7969d341bb" alt=""><figcaption></figcaption></figure>

#### Starting a Chess Match

<figure><img src="https://1004862655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPhIA9eCA4bwgx77hxx4i%2Fuploads%2F9d4EZlJLc1Wm3AlW0v3m%2FFiveM_GTAProcess_sDf8vdeZ3o.gif?alt=media&amp;token=8ce768a6-4ee8-40e1-a7d6-d0c55ef7ba24" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Player Two ( Member / Black Piece )" %}

#### Joining as Opponent

<figure><img src="https://1004862655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPhIA9eCA4bwgx77hxx4i%2Fuploads%2FRnwWw6p1Rczv8ZJuLKNk%2FFiveM_cl2_GTAProcess_yVIXiDzK5Y.gif?alt=media&amp;token=f273f925-909e-4a60-a69a-016254aa81e7" alt=""><figcaption></figcaption></figure>

#### Player Two Turn

<figure><img src="https://1004862655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPhIA9eCA4bwgx77hxx4i%2Fuploads%2FUMR9ChrYv6rqPTbTre9K%2FFiveM_cl2_GTAProcess_8ENCqzMVXE.gif?alt=media&amp;token=363888f9-c901-4486-9c60-c1125636b6dc" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Admin Commands" %}

#### Chess admin

```
/chessadmin
```

<figure><img src="https://1004862655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPhIA9eCA4bwgx77hxx4i%2Fuploads%2FLeXQX9VqmUJNr9nmuaQy%2FFiveM_GTAProcess_uDxMxRu3TP.gif?alt=media&amp;token=d5949786-d864-4fd3-b6fa-0b179954e0a9" alt=""><figcaption></figcaption></figure>

#### Chess Place

```
/chess place
```

<figure><img src="https://1004862655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPhIA9eCA4bwgx77hxx4i%2Fuploads%2FOTmxTRqt1YvUlIGdg8m8%2FFiveM_GTAProcess_bW7ovpqZrj.gif?alt=media&amp;token=b51ce97e-1749-4044-bff4-38abf6999a15" alt=""><figcaption></figcaption></figure>

#### Chess Delete

```
/chess delete
```

<figure><img src="https://1004862655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPhIA9eCA4bwgx77hxx4i%2Fuploads%2F2rihUlt9dOMXLaN1Gg19%2FFiveM_GTAProcess_8DUFNDecav.gif?alt=media&amp;token=3e00df4f-dbc2-45fd-807b-f671174a1814" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Features" %}

#### Game Leaderboard

<figure><img src="https://1004862655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPhIA9eCA4bwgx77hxx4i%2Fuploads%2FIZvLfe5VCkmf4VlcJpUy%2FFiveM_GTAProcess_5RCYlMi3zv.gif?alt=media&amp;token=7a94d026-6ea2-4060-b02c-e35a643e3736" alt=""><figcaption></figcaption></figure>

#### Match History

<figure><img src="https://1004862655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPhIA9eCA4bwgx77hxx4i%2Fuploads%2FPsG2BIqOkl5UML0XFNPD%2FFiveM_GTAProcess_MrDr0sYAbs.gif?alt=media&amp;token=ef9a4eff-4a02-4730-bd61-079d270d3d95" alt=""><figcaption></figcaption></figure>

#### User Profile Settings

<figure><img src="https://1004862655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPhIA9eCA4bwgx77hxx4i%2Fuploads%2FjCN1nHUuhDHAUzj7gVda%2FFiveM_GTAProcess_R1VVBXDzuH.gif?alt=media&amp;token=b497b1f2-dd52-4ecf-ac7b-6dff26f1535e" alt=""><figcaption></figcaption></figure>

#### Promotion Pawn

<figure><img src="https://1004862655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPhIA9eCA4bwgx77hxx4i%2Fuploads%2FcoBMtxkxTTnfm86vMiVk%2FFiveM_GTAProcess_Q7ikNDii06.gif?alt=media&amp;token=d06b0e95-35d2-4cfe-b302-1f0cd91a7e92" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}
{% endstep %}
{% endstepper %}
