hlxstatsx_ze: dont be racist to zombies

This commit is contained in:
Dogan 2019-05-28 21:02:07 +02:00
parent 7c8147a50c
commit 1c3352f08a

View File

@ -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);