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
This commit is contained in:
parent
b7cc3b7670
commit
96f8590fda
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user