View Single Post
Author Message
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 12-24-2009 , 07:53   [L4D2] Score/Team Manager 1.3.0
Reply With Quote #1

L4D2 Score/Team Manager 1.3.0



Now there is for L4D2 aswell an easy way to manage the teams (who is on what teams), and the order that teams are played in.


The original for L4D can be found >here<. Thank Downtown for his awesome extension and doing most of this Plugin.


The source and changelog will from now on also be available at http://bitbucket.org/downtown1/l4dscores/


This plugin provides functionality to:
  • unscramble the teams after a map change - also fixes team versus spectator bug
  • change the order of which team goes survivor first
  • swap players around to a different team
  • block players from swapping
  • swap an entire team with the other team
  • scramble or vote scramble teams
  • see the scores for previous levels at any time
  • swap the campaign scores/teams

Commands
Admin (BAN flag):
  • sm_swapmenu - bring up a menu to swap players between survivors or infected
  • sm_swap <player1> [player2] ... [playerN] - swap all listed players to opposite teams
  • sm_swapto <player1> [player2] ... [playerN] <teamnum> - swap all listed players to specified team (1,2,3)
  • sm_swapteams - swaps the infected and survivor teams
  • sm_antirage - swaps teams AND scores
  • sm_scrambleteams - scramble teams
  • sm_lockteams - lock/unlock teamchanging by players

Anyone:
  • sm_printscores - prints the scores for each previously played map, and the campaign scores
  • sm_scores - displays the total scores for each map for both teams in a menu similar to sm_admin
  • sm_votescramble - initiate a teamscramble vote

Cvars
  • l4d2_team_manager_ver - the version of this plugin
  • l4d2_votescramble_allowed (default 1) - are players allowed to use the sm_votescramble command
  • l4d2_full_reset_on_empty (default 0) - does the server load a new map when empty, fully resetting itself
  • l4d2_scores_gamemodesactive (default "versus,teamversus,mutation12") - which modes should score managing and team swapping occur in. You cannot add coop, scavenge or survival.
  • l4d2_team_order - who goes survivor first after a map change?
    • 0 - default behaviour (winning team goes survivor first)
    • 1 - inverse default behaviour (winning team goes infected first)
    • 2 - classic behavior (teams are never swapped)
    • 3 - ABAB (teams are swapped every map)
    • 4 - default, except on finales winning team goes infected first
Usually the highest score goes survivor first, which means that if the winning team from the prior maps wins the first round on the finale, the game is now over. Whatever the other team does, it doesn't matter because they already lost.

By having the losing team go survivor first on the finale, this will keep the full game going because they still can win the finale as survivors, and then have the potential to stop the other team as infected.

INSTALLATION
Note: This plugin is probably compatible with any other plugins that changes a player's team at the beginning of the map, but you should avoid using those anyway.


CUSTOM MENU
There is a menu invoked with sm_swapmenu, but it may not suit everyone. You can additional use this snippet, the full instructions are here:
http://wiki.alliedmods.net/Dynamic_A...nu_(SourceMod)
Code:
Code:
"Commands"
{
    "Left 4 Dead 2"
    {
        "Swap Players"
        {
            "cmd"        "sm_swap #1 @2"
            "execute"    "player"
            "1"
            {
                "type"         "teamplayer"
                "method"    "name"
                "title"        "Player A to swap:"
            }
            "2"
            {
                "type"         "teamplayer"
                "method"    "name"
                "title"        "Player B to swap:"
            }
        }
        "Swap Player to Team"
        {
            "cmd"        "sm_swapto #1 @2"
            "execute"    "player"
            "1"
            {
                "type"         "teamplayer"
                "method"    "name"
                "title"        "Player to swap:"
            }
            "2"
            {
                "type"         "list"
                "title"        "Desination Team:"
                "1"        "1"
                "1."        "Spectators"
                "2"        "2"
                "2."        "Survivors"
                "3"        "3"
                "3."        "Infected"
            }
        }
    }
}
CHANGELOG

  • 1.3.0 - updated (pre)finale map list
  • 1.2.9 - tiny fix for rare error with fake clients
  • 1.2.8 - fixes for new campaigns and convars (version B: typo No Mercy 4)
  • 1.2.7 - minor fix for the Sacrifice DLC
  • 1.2.6 - Changed Scramble function to evenly fill new teams
  • 1.2.5 - Added active gamemodes convar to prevent mutation bugs
  • 1.2.4 - Fixed up Finale dependant Teamswapping for The Passing
  • 1.2.3 - re-added missing convars lost in some drive wipe
  • 1.2.2 - Minor fix concerning The Passing Update
  • 1.2.1 - Added Vote Scramble and Full Reset on empty convars
  • 1.2.0 - Added Support for L4D1 finales, fixed Timer Handle errors
  • 1.1.9 - Bugfixes for Antirage command, also fixed rare early Finale end bug
  • 1.1.8 - Hotfix for swapped team order on new Campaigns
  • 1.1.7 - complete new Scoring and Teamswapping system with raw Address SDK Calls
  • 1.1.6 - fix for probable cause of 0 score Rounds with reversed Teamorder
  • 1.1.5 - more for Finale-Only teamswapping
  • 1.1.4 - Attempted Bugfix for Finale-Only teamswapping
  • 1.1.3 - Timer Handle errorfix
  • 1.1.2 - small adjustments
  • 1.1.1 - more fixes for the empty round bug
  • 1.1.0 - Fixes for exotic situations (zero Player rounds)
  • 1.0.9 - minor Fixes about manual swaps
  • 1.0.8 - Fixes about &quot;Finale only&quot; Swaptype Scoring
  • 1.0.7 - More work on Swapping, added sm_lockteams command
  • 1.0.6 - Swapped Finale only Logic
  • 1.0.5 - Adjustments to Swapping
  • 1.0.4 - Critical fix concerning Teamswapping
  • 1.0.3 - Bugfixes concerning L4D2 random team swapping Teams
  • 1.0.2 - Bugfix concerning Tie Breakers on non-Survivor Teams
  • 1.0.1 - Bugfix concerning L4D2 default team order
  • 1.0.0 - Initial release


FAQ:

  • Is this compatible with L4D? - No.
  • WTF our teams and/or scores got royally scrambled?! - I've left Debug Logging enabled. If it screws up for you, please provide your logfile and explain what it did wrong.
  • My Log file is exploding! - See above. If the Plugin works fine for everybody i will disable logging in the next version, if it works fine for you and youre annoyed by detailed logging you can go into the Source and change #define SCORE_DEBUG_LOG 1 in Line 8 to Zero. You need Downtowns Extension Include for compiling this.
Attached Files
File Type: smx l4d2scores.smx (24.9 KB, 3884 views)
File Type: sp Get Plugin or Get Source (l4d2scores.sp - 3010 views - 57.3 KB)
File Type: txt l4d2scores.txt (6.1 KB, 2859 views)
File Type: zip l42dscores old version.zip (39.8 KB, 2393 views)

Last edited by AtomicStryker; 08-06-2013 at 05:15.
AtomicStryker is offline