Skip to content
View in the app

A better way to browse. Learn more.

Learn more

Automatic Team Balance

Featured Replies

  • Administrator

Balances teams by player count and optionally by skill at round end, moving the least disruptive players.

Automatic Team Balance 1.0.0 (olds.ro)

Keeps the teams even. When a round ends with one team bigger than the other by more than olds_tb_diff players, players are moved from the bigger team to the smaller one, at most olds_tb_maxmoves players per round end. Moved players are not killed: they start the next round on their new team, with their score kept. Everyone reads one chat line per move.

Requirements

  • ReHLDS, ReGameDLL_CS, Metamod-R, ReAPI
  • AMX Mod X 1.10 or newer (written and tested on 1.10.0.5490)
  • mp_autoteambalance 0 in server.cfg, so the game does not balance the teams as well (the plugin prints a notice in the server console if it is on).

Install

  • Compile scripting/olds_teambalance.sma and copy olds_teambalance.amxx to addons/amxmodx/plugins/. The compiler needs ReAPI's include files (reapi.inc and the reapi_*.inc files from the ReAPI release) next to the stock AMX Mod X includes.
  • Copy data/lang/olds_teambalance.txt to addons/amxmodx/data/lang/.
  • Copy configs/plugins/olds_teambalance.cfg to addons/amxmodx/configs/plugins/ (if it is missing, the plugin writes it with the default values).
  • Add olds_teambalance.amxx to addons/amxmodx/configs/plugins.ini.

How players are chosen (always from the bigger team)

  • olds_tb_skill 0: players who are dead when the round ends before living ones; among them the lowest score (frags); on a tie, the one who died first.
  • olds_tb_skill 1: the player whose move brings the two teams' skill totals (each team's sum of frags minus deaths) closest together; on a tie, the order above.
  • The bomb carrier and the VIP are never moved.
  • Spectators are not counted and never moved.
  • Teams of equal size, or within olds_tb_diff, are left alone, and no message is printed.

When it runs At every round end the game itself makes (ReAPI hook RG_RoundEnd): a team wiped out, the time running out, the bomb, a rescue, and also sv_restart. A round ended by another plugin through rg_round_end does not pass that hook, so no balancing happens there.

Settings (addons/amxmodx/configs/plugins/olds_teambalance.cfg)

  olds_tb_diff 1       largest allowed difference between the team sizes (1 - 31)
  olds_tb_skill 0      1 = choose by skill (frags minus deaths), 0 = by score and death order
  olds_tb_maxmoves 2   most players moved at one round end (0 = balancing off, up to 31)
  olds_tb_warn 1       1 = announce each move in chat, 0 = move players silently

Commands None.

Tested on ReHLDS 3.15.0.896, ReGameDLL_CS 5.30.0.814, Metamod-R 1.3.0.149, AMX Mod X 1.10.0-git5490, ReAPI 5.29.0.358, with bots: even teams left alone, 6 vs 3 balanced with one move, the dead player with the lowest score chosen first, the one who died first on a tie, the bomb carrier never moved, the move limit, skill mode, and silent mode.

No sounds, models or sprites are added.

Credits and licence Written from scratch by alexit (olds.ro workshop) for workshop card LIB-2193. Licence: GNU GPL version 3 or later (GPL-3.0-or-later).

Install

Download the ZIP above and copy its folders into cstrike/. Compile the .sma in addons/amxmodx/scripting with the AMX Mod X 1.10 compiler, put the .amxx in addons/amxmodx/plugins, and add it to plugins.ini.

Files: addons/amxmodx/scripting/olds_teambalance.sma

License: GPL-3.0-or-later.
Written for the olds.ro plugin workshop (LIB-2193), by alexit, reviewed by alexit and checked by the automated Claude review.

Automatic Team Balance
v1.0.0Counter-Strike 1.6PluginTests passed
AMX Mod X 1.10Server engine ReHLDSNeeds ReAPI YesMetamod Metamod-R0 downloads5.7 KBUpdated 12 hours ago
Sign in to download
Pawn (AMX Mod X) · 293 lines
/*
 * Automatic Team Balance (olds.ro workshop card LIB-2193)
 *
 * When a round ends with one team bigger than the other by more than
 * olds_tb_diff players, players are moved from the bigger team to the
 * smaller one until the difference is small enough, at most
 * olds_tb_maxmoves players per round end. Moved players are not killed: they
Show all 293 lines

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.