From 96f8590fda9cfc7ba9440f31f0f16512bbb88b99 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Fri, 25 Apr 2008 05:26:07 +0000 Subject: [PATCH] TF2 Round count mapchooser fix. --HG-- branch : sourcemod-1.0.x extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402099 --- plugins/mapchooser.sp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/mapchooser.sp b/plugins/mapchooser.sp index bf978f05..173a1cfe 100644 --- a/plugins/mapchooser.sp +++ b/plugins/mapchooser.sp @@ -106,6 +106,7 @@ public OnPluginStart() if (g_Cvar_Winlimit != INVALID_HANDLE || g_Cvar_Maxrounds != INVALID_HANDLE) { HookEvent("round_end", Event_RoundEnd); + HookEvent("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;