Moved mapchooser tf2 fix into trunk
authorMatt Woodrow <pred@alliedmods.net>
Thu May 01 02:39:35 2008 +0000 (2008-05-01)
changeset 2032444fe6d52e25
parent 2031 6f141bd82d73
child 2033 932b053ad2b9
Moved mapchooser tf2 fix into trunk
plugins/mapchooser.sp
     1.1 --- a/plugins/mapchooser.sp	Wed Apr 30 04:15:09 2008 +0000
     1.2 +++ b/plugins/mapchooser.sp	Thu May 01 02:39:35 2008 +0000
     1.3 @@ -5,7 +5,7 @@
     1.4   * Creates a map vote at appropriate times, setting sm_nextmap to the winning
     1.5   * vote
     1.6   *
     1.7 - * SourceMod (C)2004-2008 AlliedModders LLC.  All rights reserved.
     1.8 + * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
     1.9   * =============================================================================
    1.10   *
    1.11   * This program is free software; you can redistribute it and/or modify it under
    1.12 @@ -106,6 +106,7 @@
    1.13  	if (g_Cvar_Winlimit != INVALID_HANDLE || g_Cvar_Maxrounds != INVALID_HANDLE)
    1.14  	{
    1.15  		HookEvent("round_end", Event_RoundEnd);
    1.16 +		HookEventEx("teamplay_round_win", Event_TeamPlayRoundWin);
    1.17  	}
    1.18  	
    1.19  	if (g_Cvar_Fraglimit != INVALID_HANDLE)
    1.20 @@ -223,6 +224,16 @@
    1.21  	return Plugin_Stop;
    1.22  }
    1.23  
    1.24 +public Event_TeamPlayRoundWin(Handle:event, const String:name[], bool:dontBroadcast)
    1.25 +{
    1.26 +	new isFull = GetEventInt(event, "full_round");
    1.27 +	new winningTeam = GetEventInt(event, "team");
    1.28 +	
    1.29 +	if (isFull == 1)
    1.30 +	{
    1.31 +		RoundCompleted(winningTeam);
    1.32 +	}
    1.33 +}
    1.34  /* You ask, why don't you just use team_score event? And I answer... Because CSS doesn't. */
    1.35  public Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
    1.36  {
    1.37 @@ -233,6 +244,11 @@
    1.38  
    1.39  	new winner = GetEventInt(event, "winner");
    1.40  	
    1.41 +	RoundCompleted(winner);
    1.42 +}
    1.43 +	
    1.44 +public RoundCompleted(winner)
    1.45 +{
    1.46  	if (winner == 0 || winner == 1)
    1.47  	{
    1.48  		return;