Moved mapchooser tf2 fix into 1.0.1

--HG--
branch : sourcemod-1.0.1
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.1%402111
This commit is contained in:
Matt Woodrow 2008-05-01 02:39:19 +00:00
parent 4be098c694
commit b637ab794b

View File

@ -106,6 +106,7 @@ public OnPluginStart()
if (g_Cvar_Winlimit != INVALID_HANDLE || g_Cvar_Maxrounds != INVALID_HANDLE)
{
HookEvent("round_end", Event_RoundEnd);
HookEventEx("teamplay_round_win", Event_TeamPlayRoundWin);
}
if (g_Cvar_Fraglimit != INVALID_HANDLE)
@ -223,6 +224,16 @@ public Action:Timer_StartMapVote(Handle:timer)
return Plugin_Stop;
}
public Event_TeamPlayRoundWin(Handle:event, const String:name[], bool:dontBroadcast)
{
new isFull = GetEventInt(event, "full_round");
new winningTeam = GetEventInt(event, "team");
if (isFull == 1)
{
RoundCompleted(winningTeam);
}
}
/* You ask, why don't you just use team_score event? And I answer... Because CSS doesn't. */
public Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
@ -233,6 +244,11 @@ public Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
new winner = GetEventInt(event, "winner");
RoundCompleted(winner);
}
public RoundCompleted(winner)
{
if (winner == 0 || winner == 1)
{
return;