From 1c3352f08a3c82be59089f7c27ebb87caccd37fb Mon Sep 17 00:00:00 2001 From: Dogan Date: Tue, 28 May 2019 21:02:07 +0200 Subject: [PATCH] hlxstatsx_ze: dont be racist to zombies --- hlstatsx/scripting/hlstatsx_ze.sp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hlstatsx/scripting/hlstatsx_ze.sp b/hlstatsx/scripting/hlstatsx_ze.sp index c516fe20..0a09374a 100644 --- a/hlstatsx/scripting/hlstatsx_ze.sp +++ b/hlstatsx/scripting/hlstatsx_ze.sp @@ -133,11 +133,18 @@ public void OnRoundEnding(Event hEvent, const char[] sEvent, bool bDontBroadcast bool bAwardZombies = ((g_tMinimalRoundDuration == INVALID_HANDLE) && (hEvent.GetInt("winner") == CS_TEAM_T)); int iAliveHumans; + int iAliveZombies; for (int client = 1; client <= MaxClients; client++) { if (IsValidClient(client) && GetClientTeam(client) == CS_TEAM_CT) + { iAliveHumans++; + } + else if(IsValidClient(client) && GetClientTeam(client) == CS_TEAM_T) + { + iAliveZombies++; + } } for (int client = 1; client <= MaxClients; client++) @@ -160,7 +167,12 @@ public void OnRoundEnding(Event hEvent, const char[] sEvent, bool bDontBroadcast } else if (bAwardZombies && g_bIsZombie[client]) { - if (g_bMotherZM[client]) + + if (iAliveZombies == 1) + { + LogPlayerEvent(client, "triggered", "ze_z_win_solo"); + } + else if (g_bMotherZM[client]) { char sPlayerEvent[32]; Format(sPlayerEvent, sizeof(sPlayerEvent), "ze_m_win_%d", g_cvarDifficultyZombie.IntValue);