hlstatsx: update ZE module.

Seems the ZR native's require people to actually be alive??
This commit is contained in:
zaCade 2018-12-03 16:55:17 +01:00
parent 5792332f34
commit 49b1e6eed4

View File

@ -22,6 +22,8 @@ Handle g_tMinimalRoundDuration = INVALID_HANDLE;
int g_iKillCount[MAXPLAYERS+1] = 0;
/* BOOLEANS */
bool g_bIsHuman[MAXPLAYERS+1] = false;
bool g_bIsZombie[MAXPLAYERS+1] = false;
bool g_bMotherZM[MAXPLAYERS+1] = false;
//----------------------------------------------------------------------------------------------------
@ -93,11 +95,23 @@ public Action OnRoundMinimalDuration(Handle timer)
g_tMinimalRoundDuration = INVALID_HANDLE;
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public void ZR_OnClientHumanPost(int client, bool respawn, bool protect)
{
g_bIsHuman[client] = true;
g_bIsZombie[client] = false;
g_bMotherZM[client] = false;
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn)
{
g_bIsHuman[client] = false;
g_bIsZombie[client] = true;
g_bMotherZM[client] = motherInfect;
}
@ -113,14 +127,14 @@ public void OnRoundEnding(Event hEvent, const char[] sEvent, bool bDontBroadcast
{
if (IsValidClient(client))
{
if (bAwardHumans && ZR_IsClientHuman(client))
if (bAwardHumans && g_bIsHuman[client])
{
char sPlayerEvent[32];
Format(sPlayerEvent, sizeof(sPlayerEvent), "ze_h_win_%d", g_cvarDifficultyHuman.IntValue);
LogPlayerEvent(client, "triggered", sPlayerEvent);
}
else if (bAwardZombies && ZR_IsClientZombie(client))
else if (bAwardZombies && g_bIsZombie[client])
{
if (g_bMotherZM[client])
{
@ -179,14 +193,14 @@ public void EndKillStreak(int client)
if (g_iKillCount[client] > g_cvarMaximumStreak.IntValue)
g_iKillCount[client] = g_cvarMaximumStreak.IntValue;
if (ZR_IsClientHuman(client))
if (g_bIsHuman[client])
{
char sPlayerEvent[32];
Format(sPlayerEvent, sizeof(sPlayerEvent), "ze_h_kill_streak_%d", RoundToFloor(float(g_iKillCount[client]) / float(g_cvarStreakInterval.IntValue)) * g_cvarStreakInterval.IntValue);
LogPlayerEvent(client, "triggered", sPlayerEvent);
}
else if (ZR_IsClientZombie(client))
else if (g_bIsZombie[client])
{
if (g_bMotherZM[client])
{
@ -213,8 +227,10 @@ public void EndKillStreak(int client)
//----------------------------------------------------------------------------------------------------
stock void ResetClient(int client)
{
g_iKillCount[client] = 0;
g_bIsHuman[client] = true;
g_bIsZombie[client] = false;
g_bMotherZM[client] = false;
g_iKillCount[client] = 0;
}
//----------------------------------------------------------------------------------------------------