> For the complete documentation index, see [llms.txt](https://docs.sourcefactory.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sourcefactory.eu/paid-cs2-plugins/auto-team-balance.md).

# Auto Team Balance

{% hint style="danger" %}
⭐ This plugin is private! Can be purchased on our [Discord Marketplace](https://discord.com/invite/Tzmq98gwqF).
{% endhint %}

{% hint style="info" %}
This plugin performs instantlly automatic team balancing or shuffling based on your configuration.

> It offers two methods to choose from:

1. For Public servers where teams play against each other
2. For servers with modes like Deathmatch/Gungame/CTF/etc.. (where players respawn upon death)

### ✨ Public server method

> For public servers, the plugin allows you to:

1. `Scramble teams after wins in a row:`
   * Set the number of wins per team in a row, after which the teams are automatically scrambled.
2. `Instantly balance teams at round end:`
   * Enable or disable instant team balancing at the end of each round.
3. `Balancing type:`
   * Choose the team balancing type based on the top, bottom, or mid fragger in the team, or option for random balancing.

### ✨ Deathmatch server method

> For servers featuring modes like Deathmatch/Gungame/CTF, the plugin allows you to:

1. `Instant switch of the first dead player for balancing:`
   * Enable or disable the immediate switch of the first dead player for team balancing.
2. `Scramble teams after kills in a row:`
   * Set the number of kills per team in a row, after which the teams are automatically scrambled.
3. `Automatic timer for balancing/shuffling:`
   * Set the time interval for automatic team balancing or shuffling.
4. `Balancing type:`
   * Choose the team balancing type based on the top, bottom, or mid fragger in the team, or option for random balancing.
     {% endhint %}

<details>

<summary>Config Preview</summary>

```
{
  "Balance method": 1,
  "Minimum players": 6,
  "Default CT Model": "characters/models/ctm_fbi/ctm_fbi.vmdl",
  "Default T Model": "characters/models/tm_leet/tm_leet_varianta.vmdl",
  "Count bots as players": true,
  "Include bots in balance": true,
  "Balance type": 1,
  "Messages Settings": {
    "Send message to player when switching team": true,
    "Send all message when teams balanced": true,
    "Send all message when teams scrambled": true
  },
  "Balance method: Public (1)": {
    "Scramble teams after wins in a row": 5,
    "Instantly balance teams at round end": true,
    "Reset teams wins in row after instantly balance": true,
    "Players difference in teams": 1
  },
  "Balance method: Deathmatch (2)": {
    "Uneven teams auto-switch on first player death": true,
    "Scramble teams after kills in a row": 10,
    "Scramble teams only when is teams unbalanced": false,
    "Timers Settings": {
      "Allow timer": true,
      "Timer": 180,
      "Timer method type": 1,
      "Timer Method: Balance (1)": {
        "Players difference in teams": 2
      },
      "Timer Method: Scramble (2)": {
        "Team kills difference to scramble": 15
      }
    },
    "Respawn players after scramble/balance": 1
  },
  "ConfigVersion": 1
}

```

</details>

<details>

<summary>Language Preview</summary>

```json
{
    "Prefix": "{darkred}[Auto Team Balance]{default}",
    "Admin_Teams_Scrambled": "Teams has been scrambled!",
    "Admin_Teams_Balanced": "Teams has been balanced!",
    "Admin_Teams_Will_Be_Scrambled": "Teams will be scrambled at the end of the round!",
    "Admin_Teams_Will_Be_Balanced": "Teams will be balanced at the end of the round!",
    "Teams_Are_Not_Unbalanced": "Teams are evenly balanced!",
    "Teams_Scrambled_By_Timer": "Teams have been scrambled! (By Timer)",
    "Teams_Scrambled_By_KillsInRow": "Teams have been scrambled! (Team {darkred}{0}{default} got {green}{1}{default} kills in a row!)",
    "Teams_Scrambled_By_WinsInRow": "Teams have been scrambled! (Team {darkred}{0}{default} got {green}{1}{default} wins in a row!)",
    "Teams_Scrambled_By_Admin": "Teams have been scrambled! (By Admin)",
    "Team_Changed": "You've been moved to {darkred}{0}{default} for teams balance",
    "Teams_Balanced": "Teams were balanced!",
    "CounterTerrorist": "Counter-Terrorist",
    "Terrorist": "Terrorist"
}
```

</details>

### Configuration

<table><thead><tr><th width="188">Property</th><th>Value</th></tr></thead><tbody><tr><td><strong>Balance method</strong></td><td><mark style="color:green;"><code>1</code></mark> - Public</td></tr><tr><td></td><td><mark style="color:green;"><code>2</code></mark> - Deathmatch </td></tr><tr><td><strong>Minimum players</strong></td><td>Minimum number of players to activate the plugin</td></tr><tr><td><strong>Balance type</strong></td><td>According to which option the teams will be balanced</td></tr><tr><td></td><td><mark style="color:blue;"><code>0</code></mark> - Random</td></tr><tr><td></td><td><mark style="color:blue;"><code>1</code></mark> - Top Fragger</td></tr><tr><td></td><td><mark style="color:blue;"><code>2</code></mark> - Bottom Fragger</td></tr><tr><td></td><td><mark style="color:blue;"><code>3</code></mark> - Mid Fragger</td></tr></tbody></table>

### Balance Methods

{% tabs %}
{% tab title="Public (1)" %}

<table><thead><tr><th width="254">Property</th><th>Value</th></tr></thead><tbody><tr><td><strong>Scramble teams after wins in a row</strong></td><td>If any team wins XX rounds in a row there will be a shuffle of teams (For disable this option, set value to 0)</td></tr><tr><td><strong>Instantly balance teams at round end</strong></td><td>Instant team balancing at the end of each round, if the teams are unbalanced ( <mark style="color:green;"><code>true</code></mark> / <mark style="color:red;"><code>false</code></mark> )</td></tr><tr><td><strong>Reset teams wins in row after instantly balance</strong></td><td><mark style="color:green;"><code>true</code></mark> / <mark style="color:red;"><code>false</code></mark> </td></tr><tr><td><strong>Players difference in teams</strong></td><td>What difference in the number of players in the teams must mean that they are not balanced</td></tr></tbody></table>
{% endtab %}

{% tab title="Deathmatch (2)" %}

<table><thead><tr><th width="293">Property</th><th>Value</th></tr></thead><tbody><tr><td><strong>Uneven teams auto-switch on first player death</strong></td><td><p>When teams are unbalanced, automatically move the first player who died to the unbalanced team </p><p>( <mark style="color:green;"><code>true</code></mark> / <mark style="color:red;"><code>false</code></mark> )</p></td></tr><tr><td><strong>Scramble teams after kills in a row</strong></td><td>If any team get XX kills in a row there will be a shuffle of teams (For disable this option, set value to 0)</td></tr><tr><td><strong>Scramble teams only when is teams unbalanced</strong></td><td><p>Also works for the Timer Method: Scramble (2) </p><p>( <mark style="color:green;"><code>true</code></mark> / <mark style="color:red;"><code>false</code></mark> )</p></td></tr><tr><td></td><td></td></tr><tr><td><strong>Timers Settings</strong></td><td>You can set what will be checked every XX seconds</td></tr><tr><td><strong>Timer method type</strong></td><td>Which method will be checked</td></tr><tr><td></td><td><mark style="color:blue;"><code>0</code></mark> - Both methods (Balance and Scramble)</td></tr><tr><td></td><td><mark style="color:blue;"><code>1</code></mark> - Only Balance Method</td></tr><tr><td></td><td><mark style="color:blue;"><code>2</code></mark> - Only Scramble Method</td></tr><tr><td><ul><li><strong>Timer Method: Balance (1)</strong></li></ul></td><td><ul><li><strong>Players difference in teams</strong><br>- If teams are unbalanced at the end of the timer, a rebalancing will take place</li></ul></td></tr><tr><td><ul><li><strong>Timer Method: Scramble (2)</strong></li></ul></td><td><ul><li><strong>Team kills difference to scramble</strong><br>- If the total number of kills in a team differs by XX kills from the other team, the teams will be shuffled.</li></ul></td></tr><tr><td><strong>Respawn players after scramble/balance</strong></td><td>Which players will be respawned when there is a balance or team shuffle</td></tr><tr><td></td><td><mark style="color:blue;"><code>0</code></mark> - None</td></tr><tr><td></td><td><mark style="color:blue;"><code>1</code></mark> - Only Switched Players</td></tr><tr><td></td><td><mark style="color:blue;"><code>2</code></mark> - All Players</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

{% hint style="warning" %}

## Admin Commands

<mark style="color:red;">**`css_scrambleteams`**</mark> (Flag: @css/scrambleteams)

* If **Balance method: Public (1)**:
  * Teams will be shuffled at the end of the round
* If **Balance method: Deathmatch (2)**:
  * Teams will be shuffled immediately

<mark style="color:red;">**`css_balanceteams`**</mark> (Flag: @css/balanceteams)

* If **Balance method: Public (1)**:
  * Teams will be balanced at the end of the round
* If **Balance method: Deathmatch (2)**:
  * Teams will be balanced immediately
    {% endhint %}

{% hint style="success" %}

### The Difference Between Balancing and Scrambling

1. **Balancing**\
   \- Only a certain number of players will be moved to the other team each time to keep the teams balanced
2. **Scrambling**\
   **-** All players will be shuffled into teams
   {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://docs.sourcefactory.eu/paid-cs2-plugins/auto-team-balance.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.
