Hello guys,
When trying to detect winners team for l4d2 while hooking round_end event, winners team will be equal to 0 ???
If this method doesnt work, is there any other way to do so?
Thanks
PHP Code:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
public void OnPluginStart()
{
HookEvent("round_end", Event_RoundEnd);
}
void Event_RoundEnd(Event event, const char[] name, bool dontBroadcast)
{
int WinnerTeam = GetEventInt(event, "winner");
for (int i = 1; i <= MaxClients; i++)
{
if(GetClientTeam(i) == WinnerTeam) PrintToChat(i, "Winner Team == %d", WinnerTeam);
else PrintToChat(i, "Losing Team != %d", WinnerTeam);
}
}
__________________