PlayerRankings: adjustement for nemesis

This commit is contained in:
Dogan 2019-09-29 16:15:23 +02:00
parent ceea253a98
commit 79dec7c33e

View File

@ -44,7 +44,7 @@ public Plugin myinfo =
name = "Player Rankings",
author = "Neon & zaCade",
description = "Show Top Defenders & Infections after each round",
version = "1.0.0"
version = "1.1.0"
};
//----------------------------------------------------------------------------------------------------
@ -88,6 +88,7 @@ public void OnPluginStart()
HookEvent("round_end", OnRoundEnding);
HookEvent("player_hurt", OnClientHurt);
HookEvent("player_spawn", OnClientSpawn);
HookEvent("player_death", OnClientDeath);
SetCookieMenuItem(MenuHandler_CookieMenu, 0, "Player Rankings");
}
@ -825,6 +826,26 @@ public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, boo
g_iPlayerInfections[attacker] += 1;
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public void OnClientDeath(Event hEvent, const char[] sEvent, bool bDontBroadcast)
{
int killer = GetClientOfUserId(hEvent.GetInt("attacker"));
int victim = GetClientOfUserId(hEvent.GetInt("userid"));
char weapon[32];
hEvent.GetString("weapon", weapon, sizeof(weapon));
if (killer < 1 || killer > MaxClients || victim < 1 || victim > MaxClients)
return;
if (killer == victim || (IsPlayerAlive(killer) && ZR_IsClientHuman(killer)) || StrEqual(weapon, "zombie_claws_of_death", true))
return;
g_iPlayerInfections[killer] += 1;
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------