# Arm Wrestling

[**Buy Here**](https://codesign.pro/product/5382137)

[**FiveM Forums Post**](https://forum.cfx.re/t/paid-codesign-arm-wrestling/5010934)

[**YouTube Walkthrough Video**](https://youtu.be/YFwVRK7tfEQ)

#### Translate

* [Click here to translate this page.](https://docs-codesign-pro.translate.goog/paid-scripts/arm-wrestling?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp)
* [How do I change language?](https://gyazo.com/38606313ac9a7c290dc2c72b6793bde6)

## INSTALLATION GUIDE

### Step 0 - First Steps

{% hint style="warning" %}
**1.** Download your resource from [FiveM's Portal](https://portal.cfx.re). &#x20;

**2.** Unzip the `cd_armwrestling.zip` folder and place this folder in your server's resource folder.

**3.** Add the resource to your server start config (server.cfg): `ensure cd_armwrestling`. If you are using a framework, it must be placed anywhere below your framework resource e.g., es\_extended, not above.

```
ensure es_extended
ensure cd_armwrestling
```

{% endhint %}

### Step 1 - Configure Resource

{% hint style="warning" %}
You **MUST** read all configurable options inside the **`[cd_armwrestling/configs/config.lua]`** file and configure them to suit your server's needs. Please read the [”commented out help text”](https://i.imgur.com/QCja8UZ.png) at the end of each line so you can understand what each config option does.

**The most important sections are the options under the** [**Framework** ](https://i.imgur.com/4ukCTZr.png)**and** [**Important** ](https://i.imgur.com/IVm7E8l.png)**sections at the top of the `config.lua`. Everything else is optional.**

> [**NEW: Auto Framework Detect!**](https://i.imgur.com/zNW8Kpg.png)
>
> Introducing our new 'auto\_detect' feature! It automatically identifies your framework and applies the appropriate default settings.
> {% endhint %}

## HOW TO USE

This resource is very easy to install and configure. Once the steps above are complete the rest is simple:

1. Use the [#Chat Command](#chat-commands) to spawn an arm wrestling table.
2. Walk up to it and press E to join the game.
3. You will have to wait for another player, but once the other player joins, the countdown will start.
4. Spam the keys displayed on your screen.

##

## INFORMATION

### Default Key Binds

*This resource does not use key mapping; these keys are hard coded.*

| Key     | Description                                                     |
| ------- | --------------------------------------------------------------- |
| **`E`** | Join a game at the closest table.                               |
| **`X`** | While waiting for another player this key will cancel the game. |

### Chat Commands

These chat commands can be renamed and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) section of the `[configs/config.lua]`.

The exact usage for each command will be displayed in the chat suggestions when using the commands in-game.

| Command                    | Description                                                       |
| -------------------------- | ----------------------------------------------------------------- |
| **`/armwrestling_table`**  | Spawn an arm wrestling table.                                     |
| **`/armwrestling_delete`** | Delete the closest arm wrestling table *(within a small radius)*. |

### Events

These events are completely optional; you can use them if needed.

{% tabs %}
{% tab title="client-side to client-side" %}
**Spawn an arm wrestling table**

{% code title="Spawns the prop on your location." %}

```lua
TriggerEvent('cd_armwrestling:SpawnTable')
```

{% endcode %}

**Delete the closest arm wrestling table**

{% code title="Deletes the closest within a small radius." %}

```lua
TriggerEvent('cd_armwrestling:DeleteTable')
```

{% endcode %}
{% endtab %}

{% tab title="server-side to client-side" %}
**Spawn an arm wrestling table**

{% code title="Spawns the prop on your location." %}

```lua
TriggerClientEvent('cd_armwrestling:SpawnTable', source)
```

{% endcode %}

**Delete the closest arm wrestling table**

{% code title="Deletes the closest within a small radius." %}

```lua
TriggerClientEvent('cd_armwrestling:DeleteTable', source)
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Usable Items

Usable items can be renamed or disabled in the `[configs/config.lua]`.

| Item Name                | Description                   |
| ------------------------ | ----------------------------- |
| **`armwrestling_table`** | Spawn an arm wrestling table. |

{% tabs %}
{% tab title="Add items on ESX" %}
{% code title="Run these SQL queries in your database." lineNumbers="true" %}

```sql
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('armwrestling_table', 'Arm Wrestling Table', 1, 0, 1);
```

{% endcode %}
{% endtab %}

{% tab title="Add items on QBCore" %}
{% code title="Add these lines to \[qb-core/shared/items.lua]." lineNumbers="true" %}

```lua
['armwrestling_table'] 				 = {['name'] = 'armwrestling_table', 			  	  	['label'] = 'Arm Wrestling Table', 			['weight'] = 500, 		['type'] = 'item', 		['image'] = 'armwrestling_table.png', 			['unique'] = false, 	['useable'] = true, 	['shouldClose'] = true,	['combinable'] = nil,   ['description'] = 'Spawn an arm wrestling table'},
```

{% endcode %}
{% endtab %}
{% endtabs %}

##

## COMMON ISSUES

Please check out our [**Troubleshooting Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.

🔔 <mark style="color:red;">**Folder Name**</mark> Make sure the name of the folder either `cd_armwrestling`.

🔔 <mark style="color:red;">**Encrypted Files**</mark> Do not edit the encrypted files in any way.

## ERROR CODES

If you see an error code not listed below please open a script support ticket in the [Codesign Discord](https://discord.gg/codesign).

{% tabs %}
{% tab title="Server" %}
N/A
{% endtab %}

{% tab title="Client" %}
N/A
{% endtab %}
{% endtabs %}

## CHANGELOG

> **Files Changed**
>
> Not every update requires you to replace the whole folder. We do this because we understand it's a pain to redo the configs for every update.

* **All Files -** This means you should delete your old `cd_armwrestling` folder, download and add in the latest version, reconfigure the configs folder and restart your server.
* **All Files Except config.lua -** This means you should do all of the above (in the All Files section) but additionally **make a backup of the `config.lua`** file and replace the new config.lua file with the one you made a backup of.
* **Specific Files -** This means you can copy and paste the **SPECIFIC** new files over the old ones and restart the server.

> **Update Type**
>
> On rare occasions, you are forced to update to the latest version. Mostly due to authentication updates where the old versions will no longer work.

* **Mandatory -** This means you MUST update to this new version, or the old versions will no longer work.
* **Optional -** This means it's completely your choice whether you wish to update to the latest version. But we do not offer support for old versions for obvious reasons; they are old.

{% hint style="warning" %}
**Skipping Updates**

If you are attempting to update to the latest version but have skipped previous updates, you should update all files just to be safe. For example., let's say you are currently on v4.0.1, you did not update when v4.0.2 was released, and now v4.0.3 is released, and you want to update; you should always use the “All Files” update method.
{% endhint %}

{% tabs %}
{% tab title="v1.0.0" %}

### 20/12/2022

**Files Changed**:&#x20;

* [x] All Files
* [ ] All Files Except config.lua
* [ ] Specific Files

**Update Type**:

* [x] Mandatory
* [ ] Optional

**Changelog:**

{% hint style="success" %}
&#x20;**STATUS**

* **Development Stage:** COMPLETE
* **Alpha Test Stage:** COMPLETE
* **Beta Test Stage:** COMPLETE
  {% endhint %}
  {% endtab %}

{% tab title="v1.0.1" %}

### 12/02/2023

**Files Changed:**&#x20;

* [x] All Files
* [ ] All Files Except config.lua
* [ ] Specific Files

**Update Type:**

* [ ] Mandatory
* [x] Optional

**Changelog:**

{% hint style="success" %}
**Add**

* **Auto Framework Detection** - We have added a new feature we are calling '**auto\_detect**', which will automatically identify your framework and apply the appropriate default settings.
* Added the option to display debug prints.
  {% endhint %}
  {% endtab %}
  {% endtabs %}
