Raised This Month: $154 Target: $400
 38% 

[TF2] gScramble Team Balancer/Scrambler -- 3.0.33 4/14/2015


Post New Thread Reply   
 
Thread Tools Display Modes
Author
BrutalGoerge
SourceMod Donor
Join Date: Jul 2007
Plugin ID:
864
Plugin Version:
3.0.33
Plugin Category:
Server Management
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    59 
    Plugin Description:
    Auto Manged team balance and skill sorting; or use admin commands. Dueling Immunity.
    Old 04-02-2009 , 18:05   [TF2] gScramble Team Balancer/Scrambler -- 3.0.33 4/14/2015
    Reply With Quote #1

    We're good now??

    gScramble, a Comprehensive Team Manager for TF2

    Requirements
    - Optional HlxCE api Plugin for HlxCE sorting I take no credit at all for this api plugin, but I will support it, and change it if needed
    - Optional gameME plugin for the gameME sorting
    - Optional clientprefs plugin/extension for disconnect tracking
    - TF2 extension

    Thanks
    • Antithasys for all the help every time i bugged him when I didn't know what i was doing, letting me use his project site, and approving the plugin!
    • MikeJS for help with team-score manipulation and Auto-Update
    • _david_ for keeping things going while I was gone
    • GameMe for adding the native functions for querying the DB
    • Psychonic for all his help and HLX Community
    • Everyone for making suggestions and finding my dumb bugs so this could be such a useful script

    Shameless money begging


    This is Me on Steam! (Please PM me before adding me on steam though, scammers are annoying)
    BrutalGoerge Is my reddit username. Feel free to PM me there as well.

    Features 3.0.33(most features have a corresponding ConVar in cfg/sourcemod/plugin.gscramble.cfg)

    Scramble-Modes
    • 14 Sort Modes
      • 1 = Random
      • 2 = Scoreboard Scores
      • 3 = A ratio of score and connection time
      • 4 = Player kill/death ratios
      • 5 = Swap the top players on each team
      • 6 = Use GameMe rank
      • 7 = Use GameMe Skill
      • 8 = Use GameMe Global Rank
      • 9 = Use GameMe Global Skill
      • 10 = Use GameME session skill change
      • 11 = Use HlxCE Rank
      • 12 = Use HlxCE Skill
      • 13 = Sort players by player class
      • 14 = Plugin randomly chooses a mode from all the available
    • Make admins, medics, or engineers immune from scramble
    • Respawn everyone after scramble depending on time and setting
    • Charge medic ubercannon if scramble occurs during setup
    • Reset setup timer if scramble occurs during setup
    • Disable immunities when too many players are immune
    Auto-Scramble
    • scramble when one team is over-powered
    • can trigger a vote instead of scrambling
    Auto-Balance
    • Dueling players immune from auto-balance
    • Balance valid players (admin, engineers, top scoring players, players helping their team (cp captures, flag touching, sentry destroying), and medics all can be made immune)
    • Force balance after teams have been imbalanced too long
    Force-Balance
    • Admin can execute force-balance command
    • Force-balance can happen between rounds
    • Force-balance can happen if teams become too imbalanced
    General
    • Admin menu integration
    • Force clients to accept their new team by blocking join team commands (detect reconnecting with clientprefs)
    • RTV-style votescramble starting
    • Admin commands for starting a scramble vote
    • Allow clients to choose what team they'd prefer to be on (overrides auto-balance)
    • Native bool gs_isBlocked(client) to see if the plugin is blocking someone from swapping teams
    • (Experimental) Ask clients recently swapped if they want to rejoin their old team when someone reconnects and gets forced onto a team
    • If enabled, block clients from changing to spectate if it will cause an imbalance
    • If enabled, allow clients to choose a buddy to protect themselves from auto-balance and scramble.
    • If enabled, block public voting when admins are present.
    • If enabled, block clients from changing teams when mp_forceautoteam is enabled
    • If enabled, select spectators during scramble and force-balance. (People who have recently connected, and people who have chosen spectator)
    • *NEW If enabled, disable auto balance as the payload cart nears the final objective.
    Commands
    Code:
    sm_cancel         admin        Cancels any active scramble.  Blocks auto-scramble check if run during bonusround
    sm_forcebalance   admin        Forces a team balance if an imbalance exists.
    sm_preference     console      Allows clients to choose what team they prefer
    sm_resetvotes     admin        Resets all public votes.
    sm_scramble       admin        sm_scramble <delay> <respawn> <mode>
    sm_scrambleround  admin        Scrambles at the beginning of the next round
    sm_scramblevote   admin        Start a vote. sm_scramblevote <now/end>
    sm_addbuddy        console     add a buddy

    Changes/Additions:
    Code:
    3.0.33
    add hooks to make round state tracking more reliable for all different maps
    
    3.0.32
    For Today's TF2 UPDATE
    - change sound caching to use the mp3 instead of wav
    - fix mem leak error if scramble command is run on empty server
    
    3.0.31
    - Changed gs_teamwork_protect to an on/off toggle set to 0/1
    - Added convars to control how much time each different teamwork action grants
    // Time immunity to grant a player for touching the CTF flag
    gs_ab_teamwork_flagevent "30"
    
    // Time immunity to grant a player for deploying an uber, also is granted to the heal target.
    gs_ab_teamwork_uber_deploy "30"
    
    // Time immunity to grant a player for killing a charged medic
    gs_ab_teamwork_kill_medic "30"
    
    // Time immunity to grant a player for touching a control point
    gs_ab_teamwork_cp_touch "30"
    
    // Time immunity to grant a player for capturing a control point (also functions on the payload cart)
    gs_ab_teamwork_cp_capture "30"
    
    // Time immunity to grant a player for blocking a capture
    gs_ab_teamwork_cp_block "30"
    
    // Time immunity to grant a player for placing a sapper
    gs_ab_teamwork_sapper_place "30"
    
    // Time immunity for killing an engineer's building
    gs_ab_teamwork_building_kill "30"
    
    // Time immunity from auto-balance to grant when a player extinguishes a team-mate.
    gs_gs_ab_teamwork_extinguish "30"
    
    3.0.30
    -Add convarchange listener to mp_autoteambalance to make sure that stays shut off as gs_autobalance and gs_enabled are buth set to 1
    -MAJOR BUG FIX FOUND AND FIXED BUG THAT DISABLED ADMIN IMMUNITY CHECK WHEN IT WASN'T SUPPOSED TO. SO SORRY FOR TAKING SO LONG TO FIND IT.......... You guys can thank Phaiz for that. :)
    
    3.0.29
    - Tweak the force-prio function so that admins should have the most immunity during forces.
    
    3.0.28
    - FOUND AND FIXED BUGG WITH FORCE BALANCE PRIORITY SORTING D:<<<<<<<<<<
    
    3.0.27
    -Add firing of the scramble notification event
    -Set convar sv_vote_issue_scramble_teams_allowed to false when using auto-scramble functions
    
    +Add new translation and say messages:
    -- When the plugin is running force balance, it will print a message
    -- When the plugin is disabling immunity because of the check immunity convars (wont spam, can only send once every 5 minutes)
    
    3.026
    - Fix bugs with immunity check for balance
    - Fix force timer not being closed when balance is solved. 
    
    3.0.25
    *good news everyone
    - Fix timer not updating on cart capture points, thus killing autobalance. 
    - Fix block join team function from blocking allowed switches. 
    - Add admin priority return for the force balance function
    
    3.0.24
    - Add option cvar to disable admin immunity check for balance/scramble when a specified percentage of the server is given immunity.
    - This will make balance and scramble more effective if your server is majority admin/donator.
    - Disabled by default. 
    
    NEW CVARS:
    - gs_ab_duel_immunity "1"
    - gs_ab_protect_medic "1" //protects team's only medic
    - gs_ab_protectmedic_chargelevel ".50"
    - gs_balance_checkummunity_percent "0" // set between 0.0 and 1.0 to control what percentage of the players are immune to disable admin immunity
    - gs_scramble_checkummunity_percent "0" // same as above, but for the scramble function
    
    3.0.23
    Fix PL cart disable
    Change time tracking function to be more reliable, should solve balancer halting auto swapping players
    Add option to protect only medic
    Redo Ask is valid target function
    Add option to protect duellers from balance
    
    3.0.22
    Fix bug in random function, #of swaps will now match the convar (unless you use immunity)
    Replace depreciated function in API plugin
    Fix bug in API plugin
    
    3.0.21
    -Commit changes made by Dave, THANK YOU, I am back to support this plugin everyone. Compiling this against the latest sourcemod version seems to have gotten things working again, let me know.
    -Include HLXce API plugin, this is no longer officially supported, but seems to still work
    -Add new convar gs_ab_cartprogress_disable ".90" to disable auto-balancing when the cart is near the end of the objective. 
    -Change event hook for teamwork protection from event that returned no player data. 
    
    * denotes a late change/addition that didn't warrant a new version
    3.0.13
    - compiled with newest gameme plugin
    
    3.0.12
    - svn reset derp derp
    
    3.0.11
    - found and fixed MAJOR bug with scramble swapping where if you had gs_ab_protect set, those top players would not be swapped.
    - chi translation fixed
    
    3.0.10
    - fix issues with jointeam listening 
    -> blocks should disable when teams are imbalanced so players can swap to the smaller team
    -> team locking for mp_forceautoteam should only affect those on red/blu and will disable when teams are imbalanced
    - fix issue with scramble sorting
    - added beginnings of compiler #if statements for debugging. 
    ** another error with chi translation :(
    
    3.0.9
    - use new SM TF2 function for detecting client conditions, removed depreciated ones
    - unmarked dueling check as optional now that it's part of the current official SM release
    - fix pre-game scramble trigger
    *** fix CHI translaiton
    
    3.0.8
    - fix scramble selecting the default mode for auto
    
    3.0.7
    - should prevent sourcetv and replay from being checked to join a team with 'select spectators' enabled
    - fixed the name of the zip files, lol sorry about that
    * fix array size issue in force balance function with select spectators enabled
    
    3.0.6
    - fix KillTimer runtime error... i hope
    
    3.0.5
    - broke the plugin into multiple files
    - removed error line about death blocking
    - prevent automatic force balance from happening during bonusround
    + add cookie setting to prevent client reconnect force-team after a server crash or restart
    - renamed the var that fills medic cannons during setup scramble to gs_setup_fill_ubers. Previously named 'gs_setup_recharge'
    - fixed the medigun charging happening during an automatic scramble
    
    3.0.4
    + add compiler switches to allow for compiling without the hlxce and gameme includes.
    -fix timer close bug that could break the force-balance function
     
    3.0.3
    - made gameME session skill change a function of player connection time.
    
    3.0.3
    - update hlxce inc and forward usage in plugin.
    
    3.0.2
    - fixed the death notice blocking
    
    3.0.2
    - fixed issue with death notices getting blocked due to error in force-balance function
    - delayed scramble at the beginning of the round slightly due to rare overflow error
    + updated ES translation
    + updated FR translation
    
    3.0.1
    - moved the gscramble menu to SERVER COMMANDS category. Always hated that it made a cat on the root menu.
    - update FR Translation
    + Add option to ignore bots from balance
    - Updated HLXCE Include and functions to work with the latest API
    + Add option to select spectators who have recently started spectating in scrambles and force-balance
    - fix auto-balance fail on maps with no time limit or round time limit
    
    3.0.0
    - I think we're stable now
    - Added native function to return the tf2 round time left.
    - found and fixed bug with top-swap function
    - added printing of scramble stats after scramble, and cvar to turn on/off: this will show how many players got swapped, and the %of the client count.
    - You should update your cfg and translation files with this.
    
    3.0.09b
    - fix hlxcE api detection I HOPE :D
    
    3.0.08b
    + allow for 3 vote triggers
    - removed a bunch of pointless lines from the vote callback
    - changed vote triggers to use commands, and not saychat
    
    3.0.07b
    + add new scramble mode to distribute players depending on what class they're playing.
    + add warning message when HLXCE is selected, but not available
    - improve random sort-mode selector
    
    3.0.06b
    - fixed immunity being given during scramble when it's not supposed to be
    
    3.0.05b
    - fixed new random algorithm when immunity is used
    
    3.0.04b
    + add HlXCe sorting function via the HLXCE api plugin!
    
    3.0.03b
    - skipped on accident :X
    
    3.0.02b
    - changed the random sort mode to choose a percentage of players controlled by convar
    - added convar to control random player selection gs_random_selections
    
    3.0.02b
    - found out old code for detecting ubercharge was no longer correct... fixed
    - add code to add immunity for people being critted
    
    3.0.01b
    - add session skill change sort mode
    
    3.0.0b
    - fix hopefully issues with the old release
    - add dueling immunity that will still work with old versions of sm
    - add optional gameMe stats integration for sorting
    - lots of other small tweaks and fixes
    - add option to lock teams between rounds to prevent players from avoiding scramble in spectator mode
    
    2.5.32
    - noticed that top player protection was not included in
    the normal auto-balance immunity check
    + add flag carrier tracking and immunity from force-balance
    - changed some default convar settings in the cfg
    
    2.5.31
    + added covnar to disable auto-balance when there is less than a 
    certain amount of time remaining in a round.
    - fixed auto-balance being active during arena maps with queue 
    enabled hopefully
    
    2.5.3 
    - fixed the vote logging to show who voted against the vote when it 
    fails
    - tried to add safeguards from potential overflow from force-balance.. 
    didn't see any really, but still added safe-guards =\
    - updated RU translation
    - added check for the translation file, if it doesn't exist, the plugin goes 
    into fail-state
    - *add PL translation
    - *check for medigun in medic's slot 2 before attempting to set/read the charge-level.  Just prevents errors from being logged when a mod changes
    the weapon, or takes it away. 
    - * fixed auto-balance running during sudden death/ hopefully
    
    2.5.2
    + add kill-death ratio sort mode
    + add top-players swap sort mode
    + add convar to control how many top players get swapped
    - fixed rare instance where a player leaves one server while teamchange blocked and joins a different server, only to be forced to the team he was on while playing on the first server. This was due to a global clientprefs db.
    - You should update your cfg files with this.
    
    2.5.1
    - fixed minor buggie with ES translation
    - changed vote callback so votes with less than 50% can succeed if the menu convar is set less than 50%
    - fix FOR SHAME message being spammed like INSANELY CRAZY
    + add convar to disable jointeam command and use the mp_forceautoteam convar
    + add convar to control the vote-scramble trigger
    + add convar and function to repeatedly advertise what the vote-scramble command is
    + add convar to disable the "Imabalance detected" and "FOR SHAME" messages
    + Translation phrases corresponding to the new functions BE SURE TO UPDATE THAT XD
    
    2.5 -- wow didn't realize how fuxed up this plugin was... SORRY
    - fix auto-balance on maps with no setup round
    - fix admins disabling voting
    - fix people being blocked from team changing after a scramble
    - fix scramble switching less normal people for every immune person
    + added covnar to disable automatic admin menu integration
    - updated to 1.3 command listener and askpluginload2 functions
    - fixed blocking changes to spectator that would cause an imbalance
    - fixed small bugs dealing with event hooks and entity properties
    + added fail-safes to make sure the plugin is running on TF2 and the TF2 extension is running
    - forgot to re-add the line that prevents that auto-balance message from coming up when it's supposed to be disabled.
    
    2.4.53
    - fix auto-balance message coming up when auto-balance is disabled
    - fix center text error message being logged
    - updated French translation
    
    2.4.52
    - fix force-balance (again) D:<
    
    2.4.51
    - fix small bug with sequential auto-scramble checking
    - updated ES translation
    - fix typo in EN translation
    
    2.4.5
    - add convar to disable public voting when an admin is present.
    - add simple buddy system that protects you and your buddy from auto-balance. disabled by default
    - add feature to block people from changing to spectator if it will cause an imbalance. disabled by default. obeys the admin team-swap block convar and flags.
    - re-do the scramble function to better deal with people immune from scramble.
    - added a bunch to the translation. be sure to update that, or you will get errors.
    
    2.4.02
    - amended version since i believe any further changes will be minor
    - add more options to the scramble now menu
    - removed the restartround option for scramble now, since the command mp_restartround is bugged
    
    2.4.2
    - fix instances where force-balance timer wasn't getting started
    - added more events to the teamwork protection section:
    => medic death *add when charged medic is killed
    => sapper placed *add when spy places sapper
    => charge deployed *add for medic and target when medic deploys uber
    
    2.4.1
    - fix it printing messages about balance when auto-balance is disabled
    
    2.4
    - !fix death message blocking for when an admin starts a long scramble delay
    - !minor fixes and tweaks with autobalance checking:
    => changed way priority is gotten, should improve selection during force balance
    - +convar to block auto-scramble when a scramble has happened recently
    - be sure to update translation files and note the new convars in the cfg
    Translations THANKS!!
    French Translation:
    Cadav0r -- COMPLETE
    Danish Translation: OziOn -- NOT COMPLETE
    Russian Translation: krolus -- NOT COMPLETE
    Spanish Translation: jack_wade -- COMPLETE
    Hungarian Translation: KhyrOO-- NOT COMPLETE
    German Translation: Guggie-- NOT COMPLETE
    Italian Translation: Dagon-- NOT COMPLETE
    Polish Translation:
    Mariano-- NOT COMPLETE

    To use HLXCE Api plugin, you will need a database entry for your HLXCE database. For those anal about security, you can create a read-only user for the sourcemod connection to this database.
    Code:
    	"hlxce"
       	{
            "driver"        "mysql"
            "host"            "localhost (or address if remote)"
            "database"        "hlstatsx (whatever you named the db)"
            "user"            "goerge (db user)"
            "pass"            "bestpluginsever (db pass)"
            "port"            "3306"
        	}
    To test recent changes:
    Linkie

    INSTALL
    unzip to tf dir
    the plugin will auto-make the cfg if it's not there, but the one included is cleaner and organized better.
    Attached Files
    File Type: sp Get Plugin or Get Source (hlxce-sm-api.sp - 496 views - 13.7 KB)
    File Type: zip gscramble_3.0.33.zip (131.2 KB, 688 views)
    File Type: smx gscramble.smx (60.7 KB, 157 views)
    __________________
    My Pluggies If you like, consider to me.

    Last edited by BrutalGoerge; 04-17-2015 at 23:42.
    BrutalGoerge is offline
    MikeJS
    Senior Member
    Join Date: Nov 2008
    Old 04-02-2009 , 18:34   Re: [tf2]Goerge's Scrambler, Automatic Steamroll Scramble
    Reply With Quote #2

    Config files can be made by adding AutoExecConfig to OnPluginStart()

    Line 257: PrintToChatAll("Scrambling has been cancelled");

    Very cool idea though
    __________________
    MikeJS is offline
    BrutalGoerge
    SourceMod Donor
    Join Date: Jul 2007
    Old 04-02-2009 , 18:38   Re: [tf2]Goerge's Scrambler, Automatic Steamroll Scramble
    Reply With Quote #3

    Quote:
    Originally Posted by MikeJS View Post
    Config files can be made by adding AutoExecConfig to OnPluginStart()

    Line 257: PrintToChatAll("Scrambling has been cancelled");

    Very cool idea though
    1 typo? new record for me. ;p

    i got the idea to do a config as i submitted the thread
    __________________
    My Pluggies If you like, consider to me.

    Last edited by BrutalGoerge; 11-06-2009 at 15:01.
    BrutalGoerge is offline
    Inflikted
    SourceMod Donor
    Join Date: Jan 2009
    Old 04-03-2009 , 11:14   Re: [tf2]Goerge's Scrambler, Automatic Steamroll Scramble 1.1
    Reply With Quote #4

    ive seen on some custom tf2 servers, like a team wins 3 rounds in a row, and does a teamswitch based on that. i no some people say its not possible, but obviously some have figured it out hehe anyway to have that put in? but i do like this script its nice
    Inflikted is offline
    BrutalGoerge
    SourceMod Donor
    Join Date: Jul 2007
    Old 04-03-2009 , 23:34   Re: [tf2]gScrambler, Automatic Steamroll Scramble 1.1
    Reply With Quote #5

    I can make it scramble every X rounds, but a team winning so many in a row gets weird.

    like some maps, like dustbowl, you may not want a scramble if a team wins all 3 stages.

    It would only really work on single-stage maps.


    And

    1.2 out,
    --fixed some bugs with the voting
    --added new cvar to control how many people must be connected before steamroll scrambles happen
    __________________
    My Pluggies If you like, consider to me.
    BrutalGoerge is offline
    Inflikted
    SourceMod Donor
    Join Date: Jan 2009
    Old 04-04-2009 , 01:50   Re: [TF2] gScrambler, + Automatic Steamroll Scramble 1.2 (update 4-03-09)
    Reply With Quote #6

    ya, i no
    but like one of the servers i run is a 24/7 1 map server, thats ctf. so something like that would work pretty well for it i think.
    Inflikted is offline
    DontWannaName
    Veteran Member
    Join Date: Jun 2007
    Location: VALVe Land, WA
    Old 04-04-2009 , 02:26   Re: [TF2] gScrambler, + Automatic Steamroll Scramble 1.2 (update 4-03-09)
    Reply With Quote #7

    He can do it, he is just selfish. Give the guy some karma and he will add whatever you need and more... ;)
    __________________

    DontWannaName is offline
    BrutalGoerge
    SourceMod Donor
    Join Date: Jul 2007
    Old 04-05-2009 , 21:52   Re: [TF2] gScrambler, + Automatic Dominating Team Scramble 1.4 (update 4-05-09)
    Reply With Quote #8

    1.4 updated, adds new cvars, logging, and better checks for the auto-scramble triggering.
    __________________
    My Pluggies If you like, consider to me.
    BrutalGoerge is offline
    jasonfrog
    Senior Member
    Join Date: Mar 2008
    Old 04-11-2009 , 14:32   Re: [TF2] gScrambler, + Automatic Dominating Team Scramble 1.5 (update 4-07-09)
    Reply With Quote #9

    Would love this if it had the option of having a vote menu ;P
    jasonfrog is offline
    BrutalGoerge
    SourceMod Donor
    Join Date: Jul 2007
    Old 04-12-2009 , 01:23   Re: [TF2] gScrambler, + Automatic Dominating Team Scramble 1.6 (update 4-11-09)
    Reply With Quote #10

    D:<

    You have no idea how much I loathe vote menus. I wish all the stock vote plugins had options for them to all be text based

    I might add one if I'm bored.

    1.6 uploaded, added a bunch of stuff. Lot of it though is stuff I thought I needed for my servers... but it might be useful to other people.
    __________________
    My Pluggies If you like, consider to me.
    BrutalGoerge is offline
    Reply


    Thread Tools
    Display Modes

    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 10:19.


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