We're good now??
gScramble, a Comprehensive Team Manager for TF2
- 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
Shameless money begging
This is Me on Steam!
- 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
(Please PM me before adding me on steam though, scammers are annoying)
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)
- 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
- scramble when one team is over-powered
- can trigger a vote instead of scrambling
- 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
- Admin can execute force-balance command
- Force-balance can happen between rounds
- Force-balance can happen if teams become too imbalanced
- 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.
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
add hooks to make round state tracking more reliable for all different maps
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
- 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
// Time immunity to grant a player for deploying an uber, also is granted to the heal target.
// Time immunity to grant a player for killing a charged medic
// Time immunity to grant a player for touching a control point
// Time immunity to grant a player for capturing a control point (also functions on the payload cart)
// Time immunity to grant a player for blocking a capture
// Time immunity to grant a player for placing a sapper
// Time immunity for killing an engineer's building
// Time immunity from auto-balance to grant when a player extinguishes a team-mate.
-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. :)
- Tweak the force-prio function so that admins should have the most immunity during forces.
- FOUND AND FIXED BUGG WITH FORCE BALANCE PRIORITY SORTING D:<<<<<<<<<<
-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)
- Fix bugs with immunity check for balance
- Fix force timer not being closed when balance is solved.
*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
- 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.
- 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
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
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
-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
- compiled with newest gameme plugin
- svn reset derp derp
- 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
- 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 :(
- 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
- fix scramble selecting the default mode for auto
- 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
- fix KillTimer runtime error... i hope
- 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
+ add compiler switches to allow for compiling without the hlxce and gameme includes.
-fix timer close bug that could break the force-balance function
- made gameME session skill change a function of player connection time.
- update hlxce inc and forward usage in plugin.
- fixed the death notice blocking
- 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
- 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
- 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.
- fix hlxcE api detection I HOPE :D
+ allow for 3 vote triggers
- removed a bunch of pointless lines from the vote callback
- changed vote triggers to use commands, and not saychat
+ 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
- fixed immunity being given during scramble when it's not supposed to be
- fixed new random algorithm when immunity is used
+ add HlXCe sorting function via the HLXCE api plugin!
- skipped on accident :X
- changed the random sort mode to choose a percentage of players controlled by convar
- added convar to control random player selection gs_random_selections
- found out old code for detecting ubercharge was no longer correct... fixed
- add code to add immunity for people being critted
- add session skill change sort mode
- 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
- 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
+ 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
- fixed the vote logging to show who voted against the vote when it
- 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
- *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
+ 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.
- 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.
- fix auto-balance message coming up when auto-balance is disabled
- fix center text error message being logged
- updated French translation
- fix force-balance (again) D:<
- fix small bug with sequential auto-scramble checking
- updated ES translation
- fix typo in EN translation
- 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.
- 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
- 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
- fix it printing messages about balance when auto-balance is disabled
- !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
French Translation: Cadav0r
Danish Translation: OziOn
-- NOT COMPLETE
Russian Translation: krolus
-- NOT COMPLETE
Spanish Translation: jack_wade
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.
"host" "localhost (or address if remote)"
"database" "hlstatsx (whatever you named the db)"
"user" "goerge (db user)"
"pass" "bestpluginsever (db pass)"
To test recent changes:
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.