View Single Post
Author Message
Downtown1
Veteran Member
Join Date: Mar 2004
Old 03-16-2009 , 03:02   [L4D] Score/Team Manager 1.1.1
Reply With Quote #1

L4D Score/Team Manager 1.1.1

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

This plugin provides functionality to:
  • unscramble the teams after a map change
  • change the order of which team goes survivor first
  • swap players around to a different team
  • swap an entire team with the other team
  • see the scores for previous levels and campaign scores at any time
  • swap or reset the campaign scores

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_swapscores - swaps the campaign scores
  • sm_resetscores - resets the campaign scores to 0/0

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

Cvars
  • l4d_team_manager_ver - the version of this plugin
  • l4d_team_order - who goes survivor first after a map change?
    • 0 - default behaviour (highest score goes survivor first)
    • 1 - inverse default behaviour (highest score goes infected first)
    • 2 - classic behavior (teams are never swapped)
    • 3 - ABABA (teams are swapped every map)
    • 4 - AABBB (teams are swapped on 3rd map, ala CAL)
    • 5 - maps 1-4 highest goes survivor, 5 highest goes infected first
l4d_team_order 5 appears to be broken atm, I suggest avoiding it. Usually the highest score goes survivor first, which means that if the winning team from maps 1-4 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 incompatible with any other plugins that changes a player's team at the beginning of the map, so you should probably avoid using those other plugins. I was using Unscrambler myself during the testing of this and found that it would almost completely reverse my team changes every time.

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:
"Commands"
{
	"Left 4 Dead"
	{
		"Swap Player"
		{
			"cmd"		"sm_swap #1"
			"execute"	"player"
			"1"
			{
				"type" 		"teamplayer"
				"method"	"name"
				"title"		"Player:"
			} 
		}
	}
}
CHANGELOG
  • 1.1.1
    • bugfix: 06/25/2009 L4D update breaks GetCampaignScores which is used to detect when a new campaign has started
    • dependency: update to Left4Downtown Extension 0.3.1+ to fix the above problem
  • 1.1.0
    • command: sm_swapto - swap players to a specific team
    • command: sm_swapmenu - bring up a menu to swap players to opposite team
    • command: sm_scores - bring up the team round/campaign scores in a menu display
    • bugfix: campaign scores will reset properly (i.e. on a manual changelevel), score should no longer carry over from previous campaigns
    • bugfix: clients will no longer be infinitely moved back to spectate when their automatic team placement fails
    • bugfix: support teams larger than 4 by checking the survivor_limit and z_max_player_zombies cvars
    • bugfix: when round is restarted using l4dready plugin, the team score will no longer reset (l4dready 0.16.2 or later necessary)
  • 1.0.3
    • feature: added 'highest score goes survivor first, except on finale' to use this set the cvar l4d_team_order 5
  • 1.0.2
    • bugfix: sm_swap wouldn't work with more than 1 player due to a typo
  • 1.0.1
    • command: sm_swap now takes an unlimited number of players (i.e. "sm_swap joe bob fred smith" will swap them all to opposite teams)
    • bugfix: improve detection when the game automatically swaps teams
  • 1.0.0 - Initial release

Views:
1.0.3 - 534
1.1.0 - 272

L4D2 stable release by AtomicStryker is available at http://forums.alliedmods.net/showthread.php?t=113188
The .SP file will fail to compile using the web compiler, download the .SMX file instead.
Attached Files
File Type: sp Get Plugin or Get Source (l4dscores.sp - 2541 views - 51.9 KB)
File Type: smx l4dscores.smx (18.4 KB, 4391 views)

Last edited by Downtown1; 12-24-2009 at 15:57.
Downtown1 is offline