Raised This Month: $32 Target: $400
 8% 

Old Simple Team Balancer


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Antithasys
Moderator
Join Date: Apr 2008
Plugin ID:
545
Plugin Version:
1.4.6
Plugin Category:
Gameplay
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Balances Teams in TF2, and beta for DOD
    Unapprover:
    Reason for Unapproving:
    requested
    Old 09-11-2008 , 20:40   Old Simple Team Balancer
    Reply With Quote #1

    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(clientteam);
    /**
     * 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(clientteam);
    /**
     * 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(clientplayer); 
    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
    Attached Files
    File Type: txt simpleteambalancer.phrases.txt (4.8 KB, 1512 views)
    File Type: sp Get Plugin or Get Source (simpleteambalancer.sp - 2864 views - 54.0 KB)
    File Type: inc simpleteambalancer.inc (2.1 KB, 1153 views)

    Last edited by Antithasys; 07-26-2009 at 18:38. Reason: Updated Version
    Antithasys is offline
    ThatGuy
    Senior Member
    Join Date: Nov 2007
    Old 09-11-2008 , 21:01   Re: [TF2] Simple Team Balancer
    Reply With Quote #2

    Nice!!!!
    ThatGuy is offline
    HanoverFist
    Member
    Join Date: Oct 2007
    Old 09-11-2008 , 22:21   Re: [TF2] Simple Team Balancer
    Reply With Quote #3

    if I change this
    if (GetUserFlagBits(client) & ADMFLAG_CUSTOM1)

    to this

    if (GetUserFlagBits(client) & ADMFLAG_RESERVATION)

    will it use reserved slots?
    HanoverFist is offline
    Antithasys
    Moderator
    Join Date: Apr 2008
    Old 09-11-2008 , 22:23   Re: [TF2] Simple Team Balancer
    Reply With Quote #4

    Quote:
    Originally Posted by HanoverFist View Post
    if I change this
    if (GetUserFlagBits(client) & ADMFLAG_CUSTOM1)

    to this

    if (GetUserFlagBits(client) & ADMFLAG_RESERVATION)

    will it use reserved slots?
    *Updated* - Flag is now set in .cfg file

    Last edited by Antithasys; 09-12-2008 at 03:31.
    Antithasys is offline
    HanoverFist
    Member
    Join Date: Oct 2007
    Old 09-11-2008 , 22:39   Re: [TF2] Simple Team Balancer
    Reply With Quote #5

    hey thanks some of my admin do not have custom1 but all have reserved slots
    HanoverFist is offline
    DontWannaName
    Veteran Member
    Join Date: Jun 2007
    Location: VALVe Land, WA
    Old 09-12-2008 , 00:01   Re: [TF2] Simple Team Balancer
    Reply With Quote #6

    Use the reservation flag.^ So this disable the built in one and uses its own, very promising. I always like new donator immunitys.
    __________________

    DontWannaName is offline
    Antithasys
    Moderator
    Join Date: Apr 2008
    Old 09-12-2008 , 02:43   Re: [TF2] Simple Team Balancer
    Reply With Quote #7

    *Updated*
    Antithasys is offline
    tcviper
    Veteran Member
    Join Date: Oct 2005
    Location: Netherlands
    Old 09-12-2008 , 04:31   Re: [TF2] Simple Team Balancer
    Reply With Quote #8

    You know what would be a very cool feature ive been thinking over multiple times? if people can set a friend in the server when they join and you wont be switched away from your friend in a server.

    For example: Someone joins the server with 2 friends and suddenly 1 of them gets swapped to the other team. Wouldnt it be way more fun if people could simply assign their friends (with a max of XX) and will stick together?
    __________________
    tcviper is offline
    Send a message via MSN to tcviper
    Antithasys
    Moderator
    Join Date: Apr 2008
    Old 09-12-2008 , 04:34   Re: [TF2] Simple Team Balancer
    Reply With Quote #9

    Quote:
    Originally Posted by tcviper View Post
    You know what would be a very cool feature ive been thinking over multiple times? if people can set a friend in the server when they join and you wont be switched away from your friend in a server.

    For example: Someone joins the server with 2 friends and suddenly 1 of them gets swapped to the other team. Wouldnt it be way more fun if people could simply assign their friends (with a max of XX) and will stick together?
    oooooo that's interesting. Not sure if I am good enough to code that but I will give it a try.
    Antithasys is offline
    dann
    Senior Member
    Join Date: Nov 2007
    Old 09-12-2008 , 04:58   Re: [TF2] Simple Team Balancer
    Reply With Quote #10

    does this switch live players?
    dann is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 03:14.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode