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

[CS:S] Auto Team Scrambler


Post New Thread Reply   
 
Thread Tools Display Modes
Author
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Plugin ID:
2417
Plugin Version:
1.5.3
Plugin Category:
Server Management
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Scramble teams when certain conditions are met.
    Old 07-03-2011 , 04:59   [CS:S] Auto Team Scrambler
    Reply With Quote #1

    Auto Team Scrambler

    v. 1.5.3

    Foreword : here is version 2, which works for CS:S/GO+DoD:S, but it is not stand-alone (does relate on another plugin). That version 2 comes with an interface that allows manual intervention in the team scrambling process. It is also why I can't present the number of servers with this plugin anymore.

    Introduction/Features :

    Tired of unbalanced teams during the whole map? You want people to be able to play with different teamates on the same map (also works with jailbreak-like)? That is how this plugin become useful. It is all about team scrambling (NOT balancing). This means fun situation can happen, but it can also be used to break "imba" teams.

    This plugin scramble teams at round end when certain situation are met.

    Currently the three following "rules" are possible :
    • Round scrambling - Scramble teams every X rounds.
    • Bestof scrambling - Scramble teams when a team reaches X win.
    • Winstreak scrambling - Scramble teams when a team keeps winning without losing (I believe this option is preferable over the two others if you want to keep your server rather normal, but preventing teams to always win).

    Do note that the three above "rules" can work together. It does also generate a lot of verbose, so you might want to change verbose CVars and take less "rules" possible.

    Teams' scores are by default reset to 0 everytime there is a team scramble, however that can be avoided (CVar ats_real_score; I believe you'll want to remove that option if you're using roundlimits).

    Finally, you might want to use this plugin with a team controller plugin (to avoid people switching teams themselves). i.e. : http://forums.alliedmods.net/showthread.php?p=521116.

    EDIT : Since 1.3.0 a random sound can now be played when teams are scrambled (need to put ats_sound's value to 1). They won't be downloaded if they are disabled (and they are disabled by default).

    EDIT #2 : I highly suggest you to set mp_autoteambalance 0, mp_limitteams 0 and mp_teams_unbalance_limit 0 to prevent any conflict with my plugins.

    Known bugs :
    • None at the moment.

    CVars :
    • autoteamscrambleversion: Gives version -_-'
    • ----------
    • ats : Is the plugin enabled? 0 = disabled, 1 = enabled (fair team), 2 = enabled (possible unfair, i.e. 12v5), 3 = for custom maps (i.e. jailbreak 2vALL). Def. 1.
    • ----------
    • ats_rule_round : Frequence (in round) of team scrambling. 0 = disabled, 1+ = enabled. Def. 0.
    • ats_rule_bestof : Scramble when a team win a best-of-X (odd number recommended; even will go with an additionnal round; i.e. 4 -> 5). 0 = disabled, 1+ = enabled. Def. 0.
    • ats_rule_winstreak : Scramble when a team win X victories in a row. 0 = disabled, 1+ = enabled. Def. 4.
    • ----------
    • ats_verbose_score : Tell players the score after every rounds. 0 = disabled, 1 = enabled (Default).
    • ats_verbose_rule : Tell players every X rounds how team can get scrambled. 0 = disabled, 1+ = enabled. Def. 1.
    • ats_verbose_scramble : Tell players when team are scrambled. 0 = disabled, 1 = enabled (Default).
    • ----------
    • ats_sound : Play a sound when teams are scrambled. 0 = disabled, 1 = enabled. Def. 0. If set to 0 sounds won't be downloaded.
    • ----------
    • ats_real_score : Reset team scores when scrambling teams (recommended for timelimits only). 0 = disabled, 1 = enabled (Default).
    • ----------
    • ats_required_value : If CVar 'ats' value is '3', then a team will have X players. Min 1.
    • ats_required_team : If CVar 'ats' value is '3', then specified team will have an exact number of players. 0 = terro, 1 = CTs.
    • ----------
    • ats_delay : Time in seconds before round start when team will be scrambled. Default 0.1 ; meaning slightly before round start.
    • ats_blockdmg : If damage is blocked between scrambling and round start. 0=no, 1=yes (default).
    • ----------since 1.5.0----------
    • ats_fade : Fade-in players screens when teams are scrambled. 0 = no, 1 = yes (default).
    • ats_fade_duration : Duration of the fade-in. Best values are around 250-1000. Def. 500.

    --------------

    Any suggestions/comments on the code or the plugin are welcomed and appreciated.

    Changelog :
    • 1.0.0 Initial release. (03-07-2011)
    • 1.1.0 (06-07-2011)
      • Fixed bug where draw games (pre-1st round end & map end) would generate verbose & a game count. Thanks to Bacardi for reporting.
      • Fixed bug where verbose wouldn't be show due to low value of CVar "mp_round_restart_delay". Thanks to Bacardi for reporting.
    • 1.1.1 Fixed bug where spectator and teamless players would be teamscrambled. Thanks to Bacardi. (07-07-2011)
    • 1.1.2 Fixed translations code (some phrases could be in another language). Thanks to Bacardi. (07-07-2011)
    • Added norwegian translation. Thanks to leetgamer. Also removed some double-space in phrases. (08-07-2011)
    • 1.2.0 If CVar "ats" value is '3', a mode for custom maps (i.e. jailbreak) will be enabled and a team (specified by CVar "ats_required_team") will have a specific number of players (specified by CVar "ats_required_value"). (10-07-2011)
    • 1.2.1 Fixed teams being scrambled on game end (in CS : S, only for timelimit, since mp_maxrounds need to spawn players to trigger map end). (10-07-2011)
    • 1.3.0 Added support for optional sounds; a random one can be played when teams are scrambled (at the beginning of the round to be exact). New CVar "ats_sound" (default sounds are disabled = 0). I'm using custom sounds since I want my plugin approved (so I can't put awesome TF2 sounds "teamscramble02.wav" nor "teamscramble03.wav"; but I hope you look around for better sounds ;) ). (20-07-2011)
    • 1.3.1 Corrected 3rd mode (ats 3). Also corrected 3rd-mode related CVar descriptions (minimum --> exact number). It should now always put the exact number of people in the team. Big thanks to namine who get me to work on it & report the bug. Changed a dynamic array to static array. (11-08-2011)
    • 1.4.0 (13-08-2011)
      • You can now choose when you want teams to be scrambled. See CVar ats_delay.
      • Players can no longer get killed during the time between team scrambling and round start. Only exception is bomb explosion. See CVar ats_blockdmg.
      • SDKHooks is now needed to compile.
    • 1.4.1 Added FCVAR_DONTRECORD flag. This means the config file the plugin creates won't contain the version number anymore. (24-02-2012)
    • 1.5.0 (10-03-2012)
      • Added a fading color at the beginning of the rounds when teams get scrambled. It is on by default. See CVar ats_fade and ats_fade_duration. Was requested by "Shit on shoe".
      • Clarified a log message (when using differents sounds; if it fails to find one).
      • Cleaned a bit code (comments++, scoped a global var.).
    • 1.5.1 Corrected crappy scrambling when a team has a fixed amount of players (i.e. 2vALL). (01-07-2012)
    • 1.5.2 Changed the way the end-game-scrambling-prevention works so it is more robust (KillTimer apparently brought some rare bug, having TIMER_FLAG_NO_MAPCHANGE flag concurence the "cs_win_panel_match" event sometimes...). Thanks to KyleS. (12-07-2012)
    • Approved by KyleS. Thanks. (06-10-2012)
    • 1.5.2b Little optimization : turned one FormatEx into strcopy. (06-10-2012)
    • Removed the version CVar for this thread, as AM now enforce 1pluginthread-1versioncvar rule = (╯°□°)╯︵ ┻━┻). (27-12-2012)
    • 1.5.3 (28-12-2012)
      • Fixed bug where mp_restartgame wouldn't reset winstreak.
      • Fixed bug when using 1+ other rule with ats_rule_round.
      • Removed FCVAR_REPLICATED from version ConVar.
      • Removed FCVAR_NOTIFY from non-version ConVars.
    • Reverted from [Any] to [CSS], since my code wasn't intended to work on CS:GO anyway (:$). See ATS 2 for a CSGO-capable version.

    How to install sounds :
    Extract "ATSsound" at your cstrike folder...
    • "ats1.wav" and "ats2.wav" should now be in "sound/misc".
    • Have CVar "ats_sound"'s value to "1".
    • ----------
    • Don't hesitate to replace them by your own sounds ! (Visit http://www.tf2sounds.com/ for more interesting sounds ).
    • You can add up to "ats9.wav" for more randomness.
    • Do know that there needs to be a "ats1.wav" to use a "ats2.wav", a "ats2.wav" to use a "ats3.wav" and so on (max 9 sounds; 1 to 9).
    • ----------
    • If you want to compile the plugin yourself, you'll need SDKHooks

    Todo list :
    • Nothing at the moment.

    Credits :
    • Bacardi for bug reporting (1.1 & 1.1.1 & 1.1.2 & 1.2.1).
    • leetgamer for norwegian translation.
    • Bakr for testing without bots 1.2.0.
    • Darkclaw Deathstrike and XxXworlockzXxX for their sounds (1.3.0) on GameBanana (respectively here and here)
    • namine for reporting about 3rd-mode bug (1.3.1).

    Other notes :
    • I couldn't play the sound before the beginning of the round; because it would be played over 2 rounds; and since ALL sounds are reset at Roundstart, I can't do that.
    • There can be map with not enough spawn points... so you might want to use map specific configs.
    Attached Files
    File Type: txt autoteamscramble.phrases.txt (2.5 KB, 1075 views)
    File Type: zip ATSsound.zip (1.21 MB, 941 views)
    File Type: sp Get Plugin or Get Source (autoteamscramble.sp - 701 views - 21.0 KB)
    File Type: smx autoteamscramble.smx (11.9 KB, 639 views)
    __________________
    My plugins :
    Red Maze
    Afk Bomb
    RAWR (per player/rounds Awp Restrict.)
    Kill Assist
    Be Medic

    You can also Donate if you appreciate my work

    Last edited by RedSword; 09-01-2013 at 07:59. Reason: changed sounds website; 154/183 dl lost; reverted to 'css'
    RedSword is offline
    smithy
    SourceMod Donor
    Join Date: Sep 2008
    Location: United Kingdom
    Old 07-04-2011 , 05:05   Re: [CS:S] Auto Team Scrambler
    Reply With Quote #2

    Oh

    I like this , gunna test asap

    Another usefull plugin thanks red
    __________________

    smithy is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: mom's basement
    Old 07-04-2011 , 05:16   Re: [CS:S] Auto Team Scrambler
    Reply With Quote #3

    What I have tested mp_forceautoteam 1, it not work. It have came with OB-update and works TF2.
    Somebody proof me wrong.
    Bacardi is offline
    RedSword
    SourceMod Plugin Approver
    Join Date: Mar 2006
    Location: Quebec, Canada
    Old 07-04-2011 , 10:09   Re: [CS:S] Auto Team Scrambler
    Reply With Quote #4

    Quote:
    Originally Posted by smithy View Post
    Oh

    I like this , gunna test asap

    Another usefull plugin thanks red
    Thanks.

    Quote:
    Originally Posted by Bacardi View Post
    mp_forceautoteam not work in Cs:s, dead cvars what have came with orangebox-version (i think)
    Quote:
    Originally Posted by Bacardi View Post
    What I have tested mp_forceautoteam 1, it not work. It have came with OB-update and works TF2.
    Somebody proof me wrong.
    Oh well... my bad. I didn't tested with it. Thanks for telling me. I didn't know useless vars would be shown (I did read and apparently it was for TF2). I re-tested and you seems right.

    Also in ur 2nd sentence, did you mean that mp_forceautoteam only works for TF2 or that you did get my plugin to work with TF2 ?

    Thanks for pointing that out,

    Red
    __________________
    My plugins :
    Red Maze
    Afk Bomb
    RAWR (per player/rounds Awp Restrict.)
    Kill Assist
    Be Medic

    You can also Donate if you appreciate my work
    RedSword is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: mom's basement
    Old 07-04-2011 , 15:43   Re: [CS:S] Auto Team Scrambler
    Reply With Quote #5

    Quote:
    Originally Posted by RedSword View Post
    Also in ur 2nd sentence, did you mean that mp_forceautoteam only works for TF2 or that you did get my plugin to work with TF2 ?
    I was mention, haven't test plugin at all yet.
    Bacardi is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: mom's basement
    Old 07-06-2011 , 08:41   Re: [CS:S] Auto Team Scrambler
    Reply With Quote #6

    Suggestion

    When new map start, first round ends when there are player in both team.
    This why plugin add extra "winner" even game is going to start.

    So check event "round_end" and reset team wins when this happens (reason 15)
    Code:
    round_end:
    reason = 15
    message = #Game_Commencing
    Another what I noticed, when map/match ends, plugin scrample team even that time.
    Hook event "cs_win_panel_match" and stop plugin scrample team.

    *edit
    Seems you have harcoded round end restart delay, when scrample team.
    There is cvar for this
    Code:
    "mp_round_restart_delay" = "7.0" min. 0.000000 max. 10.000000
     game replicated
     - Number of seconds to delay before restarting a round after a win
    Get this cvar in global Handle and hook convar change. Then minus time out...

    Otherwise plugin work like charm, but there is lot of players what immediatelly disconnect when they are not in winning team...

    Last edited by Bacardi; 07-06-2011 at 08:58. Reason: ...
    Bacardi is offline
    RedSword
    SourceMod Plugin Approver
    Join Date: Mar 2006
    Location: Quebec, Canada
    Old 07-06-2011 , 12:20   Re: [CS:S] Auto Team Scrambler
    Reply With Quote #7

    Quote:
    Originally Posted by Bacardi View Post
    Suggestion

    When new map start, first round ends when there are player in both team.
    This why plugin add extra "winner" even game is going to start.

    So check event "round_end" and reset team wins when this happens (reason 15)
    Code:
    round_end:
    reason = 15
    message = #Game_Commencing
    Another what I noticed, when map/match ends, plugin scrample team even that time.
    Hook event "cs_win_panel_match" and stop plugin scrample team.

    *edit
    Seems you have harcoded round end restart delay, when scrample team.
    There is cvar for this
    Code:
    "mp_round_restart_delay" = "7.0" min. 0.000000 max. 10.000000
     game replicated
     - Number of seconds to delay before restarting a round after a win
    Get this cvar in global Handle and hook convar change. Then minus time out...

    Otherwise plugin work like charm, but there is lot of players what immediatelly disconnect when they are not in winning team...
    1.1 is out, thanks for your bug report =).

    And round restart delay is now hardcoded relatively.

    Btw if you did translate into Finnish or Swedish your language I'd be happy to add it to the translation file above (I'm a bit curious about northern languages xD).

    Thanks for your interest,

    Red
    __________________
    My plugins :
    Red Maze
    Afk Bomb
    RAWR (per player/rounds Awp Restrict.)
    Kill Assist
    Be Medic

    You can also Donate if you appreciate my work

    Last edited by RedSword; 07-06-2011 at 12:23.
    RedSword is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: mom's basement
    Old 07-07-2011 , 00:09   Re: [CS:S] Auto Team Scrambler
    Reply With Quote #8

    Quote:
    Originally Posted by RedSword View Post
    Btw if you did translate into Finnish or Swedish your language I'd be happy to add it to the translation file above (I'm a bit curious about northern languages xD).

    Thanks for your interest,

    Red
    Ok, I could make that, finnish version.

    I noticed from logs that this scrample even spectators to teams... purposely ?
    Bacardi is offline
    RedSword
    SourceMod Plugin Approver
    Join Date: Mar 2006
    Location: Quebec, Canada
    Old 07-07-2011 , 01:27   Re: [CS:S] Auto Team Scrambler
    Reply With Quote #9

    Quote:
    Originally Posted by Bacardi View Post
    Ok, I could make that, finnish version.

    I noticed from logs that this scrample even spectators to teams... purposely ?
    :$

    Not purposely.

    I'll fix that. (I'll add a CVar).

    For that finnish version; just give it to me if you've already did translate it (I saw that a finnish server is running it; I'm guessing it's yours and that you might have translated it). Don't bother otherwise.

    Thanks for reporting again xD.

    Red

    EDIT : 1.1.1 is out : corrected the said bug. I first thought giving spectator & teamless players a team with CVar would be a cool possibility, but then they wouldn't self-respawn with round restart, so I decided to remove that option.
    __________________
    My plugins :
    Red Maze
    Afk Bomb
    RAWR (per player/rounds Awp Restrict.)
    Kill Assist
    Be Medic

    You can also Donate if you appreciate my work

    Last edited by RedSword; 07-07-2011 at 02:12.
    RedSword is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: mom's basement
    Old 07-07-2011 , 07:57   Re: [CS:S] Auto Team Scrambler - 1.1.1@Updated 07-07-2011
    Reply With Quote #10

    ok... I'm not to be mean

    Round end first chat messages not translate, only last sentence... this happen every "rule"
    Quote:
    [SM] Consecutive win(s) : 2.
    [SM] Les équipes sont mélangées : lorsqu'une équipe gagne 4 tours de suite.
    Bacardi 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 20:39.


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