Hey, im trying to create a plugin that checks if player is in winning or in losing team when round ends. So far i found some snippets from other threads and got to this:
Code:
HookEvent("teamplay_round_win", Event_RoundWin);
Code:
public Action:Event_RoundWin(Handle:event, const String:name[], bool:dontBroadcast)
{
new team;
new winteam = GetEventInt(event, "winning_team");
for(new i=1; i<=MaxClients; i++)
{
if (IsClientInGame(i))
{
// Spectator or other
if ((team = GetClientTeam(i)) <= 1)
continue;
if (team == winteam)
{
// win team
}
else
{
// lost team
}
}
}
}
Now i need to find out if client is in winning or losing team, and store it in a variable so i can use it in if-statement in PlayerSpawn event. I bet this is a simple thing, but i just cant figure out how to do it without creating like hundreds of variables, one for each possible client
So for example: I want to find out if client is in winning team or in losing team, and print text to each client individually. Or give hp/armor according to it, or weapons.
Also i just noticed that teamplay_round_win is not valid event in CSS, any idea how to fix this aswell?
Do i have to hook all possible events that cause round win/lose, such as bomb_exploded, bomb_defused etc?