not so Simple Team Balancer
This plugin is no longer supported. Please see the new thread for the new version of Simple Team Balancer
Description:
Balances the teams based upon player count in TF2,
and beta for DOD.
Features:- Admins with RESERVATION flag are immune by default
- Admin flag can be set in simpleteambalancer.cfg
- A player will not be switched more than once in 5 (default) minutes
- Balance buddy systems tries to keep players together
- Ability to restrict the buddy system to stb_adminflag
- Ability to lock buddy selection
- Ability to prioritize players; always prefers dead players
- Ability to control built-in cvars for TF2
- Ability to force the player to accept the balanced team
- Ability to log balancer activity
- Bypassed when in Arena Mode
Commands:- buddy <userid> - Adds a balance buddy
- lockbuddy - Locks your balance buddy selection so only you can change it
Console Variables:- stb_enabled - Enable or Disable Simple Team Balancer
- stb_balancedelay - Delay in seconds to start an autobalance
- stb_logactivity - Enable or Disable the displaying of events in the log
- stb_logactivity2 - Enable or Disable the displaying of detailed events in the log (This will spam log) *NEW*
- stb_unbalancelimit - Amount of players teams are allowed to be unbalanced by
- stb_deadonly - Enable or Disable the switching of only dead players
- stb_forcedenabled - Enable or Disable forcing the player to accept the balanced team
- stb_priorityenabled - Enable or Disable the prioritization of living players
- stb_uberlevel - Min level medic must have to have priority over other players. Setting to 0 will rarely switch a living medic
- stb_switchbackforced - Amount of time in seconds to not switch a player twice and force the team if enabled
- stb_livingplayercheckdelay - Delay in seconds to start checking living players once teams become unbalanced
- stb_livingplayerswitchdelay - Delay in seconds to switch living players once selected
- stb_roundstartdelay - Delay in seconds to start balancing teams after the start of a round
- stb_adminflag - Admin flag to use for immunity. Must be in char format
- stb_buddyenabled - Enable or Disable the buddy system
- stb_buddyrestriction - Enable or Disable Admin Only buddy lists
- stb_convarcontrol - Enable or Disable the control of builtin console variables
- stb_mp_autoteambalance
- stb_mp_teams_unbalance_limit
A simpleteambalancer.cfg file will be made when first ran. It will be located in /cfgs/sourcemod
If upgrading to a newer version and you want the .cfg file to have all the settings, delete it and it will be recreated.
Installation:Place the simpleteambalancer.smx in the /sourcemod/plugins dir.
Place the simpleteambalancer.phrases.txt in the /sourcemod/translations dir.
Place the simpleteambalancer.inc in the /sourcemod/scripting/include dir. (optional)
Changelog:
Quote:
1.4.6
Natives now respawn players and allow unforced moves to spectator
No longer made the TF2 stocks required
|
Include File
PHP Code:
/**
* Moves player to the specified team.
* This will use Simple Team Balancer's function to swap the players team,
* and will fire the built-in event so the player see's the TF2 balance message.
* This will also reset his forced status to none.
*
* @param client Client index.
* @param team Team to swap player to.
* @return True if successful, false if not.
* @errors Invalid client or team index. Bots are not supported
*/
native bool:STB_MovePlayerUnForced(client, team);
/**
* Moves player to the specified team and forces them to stay there.
* This will use Simple Team Balancer's function to swap the players team,
* and will fire the built-in event so the player see's the TF2 balance message.
*
* @param client Client index.
* @param team Team to swap player to.
* @return True if successful, false if not.
* @errors Invalid client or team index. Bots are not supported
*/
native bool:STB_MovePlayerForced(client, team);
/**
* Removes player from the forced player list.
*
* @param client Client index.
* @noreturn
* @errors Invalid client index. Bots are not supported
*/
native STB_RemoveForcedPlayer(client);
/**
* Sets the client and players autobalance buddy to each other.
* A player index of 0 will reset the clients balance buddy to none.
* This does not reset the players buddy, you will have to repeat with player
* as client and then player index of 0 to completly reset both balance buddies.
*
* @param client Client index.
* @param player Player index.
* @noreturn
* @errors Invalid client or player index. Bots are not supported
*/
native STB_SetBalanceBuddies(client, player);
Frequently Asked Questions:
Q: How does it determine if the teams are unbalanced?
A: Purely by player count. Example: 10vs13
Q: Does it take the players score into account?
A: No.
Q: Does it take the players K/D ratio into account?
A: No.
Q: How does it pick a player to switch?
A: The plugin goes through three layers of prioritization:
Find a dead player in the following order:
- If he is an admin, skip him
- If he has been switched before, skip him
- If he has a buddy and is on the same team, skip him
- If he has a buddy and is not on the same team, switch him
- If has buildings built, skip him (stb_priorityenabled 1)
- If he is just a regular dead player, switch him
Find a living player in the following order:
- If he is an admin, skip him.
- If he has been switched before, skip him
- If he has a uber, skip him (stb_priorityenabled 1)
- If he has buildings built, skip him (stb_priorityenabled 1)
- If he has a buddy and is on the same team, skip him (stb_buddyenabled 1)
- If he has a buddy and is not on the same team, switch him (stb_buddyenabled 1)
- If he is just a regular live player, switch him
If the plugin still cannot find a player to switch, it will get a random non admin player, and switch him after the delay.
If someone dies and fits the requirements after a live player has been selected the plugin will then switch that player. With the delays involved is more than likely that a dead player with be switched before a living one. Of course, you can always increase the two delays involved to increase the odds of a dead player being switched. It is also very rare for it to have to result to finding a random living player. You can also now just have it search for dead players with the dead only cvar.
Q: Does this replace the built-in autobalancer in TF2?
A: Yes.
Q: Do I have to disable the built-in autobalancer in TF2?
A: By default this plugin takes control of the console variables that control the built-in autobalancer and team balance limits. I have never been a fan of forcing changes to servers with plugins without the ability to turn it off. Therefore stb_convarcontol can turn this off.
But I highly suggest you leave it on.
Q: Does disabling this plugin turn on the built-in autobalancer?
A: No. If you have stb_convarcontol on, it will release the console variables so you can then set them.
Q: Can someone joining the game and picking a team make the teams unbalanced?
A: Only if you don't let it control the built-in console variables and have a different mp_teams_unbalance_limit.
Q: Can admins join any team making the teams unbalanced?
A: No. Admins are immune to switches, but not the built-in team joining controls.
Q: What is a balance buddy?
A: A balance buddy is a person that you pair up with. It will try to keep you and your buddy on the same team.
Q: Can I have more than 1 balance buddy?
A: No.
Q: Can anyone make me their balance buddy?
A: Depends on stb_buddyrestriction. By default only admins can select a buddy. If open to the public, than anyone can.
Q: If someone else selects me as a balance buddy does that override my selection?
A: Yes. You can now lock it so that only you can change your balance buddy with the command lockbuddy.
Q: Does my balance buddy remain during a map change?
A: No. You have to reselect your buddy on a map change.
Q: What does stb_forcedenabled do?
A: This forces the player to accept his team for five(default) mins. It follows the following rules:
- It now disallows changing to spectator during the force period if that would cause an inbalance.
- If teams would not become unbalanced a forced players team change is permitted.
- If during the force period the teams become unbalanced and the forced player is on the wrong team he is switched back.
- Each time the player is forced back to the team his timer is reset; this cannot be avoided.
Future Updates:
Looking for additional translations! If you have or can translate the phrases, please do and post with the new translations. I will add them to the file and certainly credit you.
French - by Slipenbois
German - by gH0sTy
Hungarian - by KhyrOO
Notes:
This plugin is no longer supported. Please see the new thread for the new version of
Simple Team Balancer