# Creating Custom Modes

{% hint style="warning" %}
`/addons/counterstrikesharp/configs/plugins/Deathmatch/Deathmatch.json`
{% endhint %}

* The default mode is always [ID 0](https://i.imgur.com/mbmiOF6.png), so even if you have CustomModes turned off in the config, the game will follow the data set for the mode with [ID 0](https://i.imgur.com/mbmiOF6.png).
* When creating a custom mode, pay attention to the mode ID. Modes must be consecutive starting from 0, and no numbers should be skipped; otherwise, an error will occur.<br>

## Parameters for custom modes

<table><thead><tr><th width="226"> </th><th width="335">What it does</th><th>Available value</th></tr></thead><tbody><tr><td><mark style="color:yellow;"><strong>Name</strong></mark></td><td>What will the mode be named?</td><td><mark style="color:blue;"><code>YOUR MODE NAME</code></mark></td></tr><tr><td><mark style="color:yellow;"><strong>Interval</strong></mark></td><td>Duration of each mode? If Custom Modes is false, then the interval is disabled.</td><td><mark style="color:blue;"><code>seconds</code></mark></td></tr><tr><td><mark style="color:yellow;"><strong>Armor</strong></mark> </td><td>┌ What type of armor will players receive at spawn?</td><td></td></tr><tr><td></td><td>├ <code>0</code> None</td><td><mark style="color:blue;"><code>0</code></mark></td></tr><tr><td></td><td>├ <code>1</code> Armor Only</td><td><mark style="color:blue;"><code>1</code></mark></td></tr><tr><td></td><td>└ <code>2</code> Armor and Helmet</td><td><mark style="color:blue;"><code>2</code></mark></td></tr><tr><td><mark style="color:yellow;"><strong>OnlyHS</strong></mark></td><td>Count the headshot only?</td><td><mark style="color:green;"><code>true</code></mark> / <mark style="color:red;"><code>false</code></mark></td></tr><tr><td><mark style="color:yellow;"><strong>KnifeDamage</strong></mark></td><td>Will knife damage be enabled?</td><td><mark style="color:green;"><code>true</code></mark> / <mark style="color:red;"><code>false</code></mark></td></tr><tr><td><mark style="color:yellow;"><strong>RandomWeapons</strong></mark></td><td>If you set this value to true, players won't be able to customize their weapons for this custom mode, and upon each spawn, they will receive a random weapon from primary/secondary weapons. <br>Also, if <a href="..#gameplay-settings-1">Default Weapons</a> is set to 0 or 1, players will still randomly get weapons</td><td><mark style="color:green;"><code>true</code></mark> / <mark style="color:red;"><code>false</code></mark></td></tr><tr><td><mark style="color:yellow;"><strong>CenterMessageText</strong></mark></td><td>What message will be displayed in the center message during the mode <a href="https://i.imgur.com/rNNGcpa.png">Preview</a><br><br>Leave blank for disable the center message</td><td><p>You can use HTML codes</p><pre class="language-csharp" data-overflow="wrap" data-full-width="true"><code class="lang-csharp">&#x3C;font class='fontSize-l' color='orange'>YOUR MODE&#x3C;/font>
</code></pre></td></tr><tr><td><mark style="color:yellow;"><strong>PrimaryWeapons</strong></mark></td><td>List of available primary weapons for the custom mode<br>Leave blank for disable primary weapons</td><td><p><mark style="color:blue;"><code>[</code></mark> <br><mark style="color:blue;"><code>"weapon_name1",</code></mark></p><p><mark style="color:blue;"><code>"weapon_name2"</code></mark><br><mark style="color:blue;"><code>]</code></mark></p></td></tr><tr><td><mark style="color:yellow;"><strong>SecondaryWeapons</strong></mark></td><td>List of available secondary weapons for the custom mode<br>Leave blank for disable secondary weapons</td><td><p><mark style="color:blue;"><code>[</code></mark> <br><mark style="color:blue;"><code>"weapon_name1",</code></mark></p><p><mark style="color:blue;"><code>"weapon_name2"</code></mark><br><mark style="color:blue;"><code>]</code></mark></p></td></tr><tr><td><mark style="color:yellow;"><strong>Utilities</strong></mark></td><td>List of available utilities for the custom mode. e.g. Grenades, Taser, Healtshot, etc..<br>Leave blank if you don't want any utilities</td><td><p><mark style="color:blue;"><code>[</code></mark> <br><mark style="color:blue;"><code>"weapon_hegrenade",</code></mark></p><p><mark style="color:blue;"><code>"weapon_taser"</code></mark><br><mark style="color:blue;"><code>]</code></mark></p></td></tr><tr><td><mark style="color:yellow;"><strong>ExecuteCommands</strong></mark></td><td>List of commands that will be execited when the mode starts<br>Leave blank if you don't want any commands</td><td><p><mark style="color:blue;"><code>[</code></mark> <br><mark style="color:blue;"><code>"say Helloo :)",</code></mark></p><p><mark style="color:blue;"><code>"mp_friendlyfire 0",</code></mark></p><p><mark style="color:blue;"><code>"mp_swapteams"</code></mark><br><mark style="color:blue;"><code>]</code></mark></p></td></tr></tbody></table>

## • Examples

<details>

<summary>Only AK47 &#x26; Headshot</summary>

IN THIS MODE, PLAYERS CAN USE ONLY AK47 AND CAN SHOOT ONLY HEADSHOT

* Add this in your config file (`counterstrikesharp/configs/plugins/Deathmatch/Deathmatch.json`) and edit YOUR MODE ID for valid value

{% code fullWidth="true" %}

```
"YOUR MODE ID": {
    "Name": "Only AK47 & Headshot",
    "Interval": 300,
    "Armor": 1,
    "OnlyHS": true,
    "KnifeDamage": false,
    "RandomWeapons": false,
    "CenterMessageText": "<font class='fontSize-l' color='orange'>Only AK47 & Headshot</font>",
    "PrimaryWeapons": [
        "weapon_ak47"
    ],
    "SecondaryWeapons": [],
    "Utilities": [],
    "ExecuteCommands": []
}
```

{% endcode %}

</details>

<details>

<summary>Only AWP</summary>

IN THIS MODE, PLAYERS CAN USE ONLY AWP AND GET FLASH

* Add this in your config file (`counterstrikesharp/configs/plugins/Deathmatch/Deathmatch.json`) and edit YOUR MODE ID for valid value

```
"YOUR MODE ID": {
    "Name": "Only AWP",
    "Interval": 300,
    "Armor": 1,
    "OnlyHS": false,
    "KnifeDamage": false,
    "RandomWeapons": false,
    "CenterMessageText": "<font class='fontSize-l' color='red'>Only AWP</font>",
    "PrimaryWeapons": [
        "weapon_awp"
    ],
    "SecondaryWeapons": [],
    "Utilities": [
        "weapon_flashbang"
    ],
    "ExecuteCommands": []
}
```

</details>

<details>

<summary>Only Shotguns with Random Weapons</summary>

IN THIS MODE, PLAYERS CAN USE ALL SHOTGUNS AND PLAYERS CANT SELECT THEIR WEAPONS (PLAYER WILL GET RANDOM SHOTGUN EVERY SPAWN)

* Add this in your config file (`counterstrikesharp/configs/plugins/Deathmatch/Deathmatch.json`) and edit YOUR MODE ID for valid value

```
"YOUR MODE ID": {
    "Name": "Only Shotguns",
    "Interval": 300,
    "Armor": 2,
    "OnlyHS": false,
    "KnifeDamage": false,
    "RandomWeapons": true,
    "CenterMessageText": "<font class='fontSize-l' color='purple'>Only Shotguns</font>",
    "PrimaryWeapons": [
        "weapon_mag7",
        "weapon_sawedoff",
        "weapon_nova",
        "weapon_xm1014"
    ],
    "SecondaryWeapons": [],
    "Utilities": [],
    "ExecuteCommands": []
}
```

</details>

<details>

<summary>Only Rifles</summary>

IN THIS MODE, PLAYERS CAN USE ALL RIFLES EXPECT THE FAMAS AND GALILAR

* Add this in your config file (`counterstrikesharp/configs/plugins/Deathmatch/Deathmatch.json`) and edit YOUR MODE ID for valid value

```
"YOUR MODE ID": {
    "Name": "Only Rifles",
    "Interval": 300,
    "Armor": 1,
    "OnlyHS": false,
    "KnifeDamage": true,
    "RandomWeapons": false,
    "CenterMessageText": "<font class='fontSize-l' color='orange'>Only Rifles</font>",
    "PrimaryWeapons": [
        "weapon_ak47",
        "weapon_m4a1",
        "weapon_m4a1_silencer",
        "weapon_aug",
        "weapon_sg556"
    ],
    "SecondaryWeapons": [],
    "Utilities": [],
    "ExecuteCommands": []
}
```

</details>
