ZombieManager: minor fixes for mzombie flag

This commit is contained in:
dogan 2020-08-07 19:30:56 +02:00
parent 4a32c8f52a
commit 2987042549

View File

@ -45,7 +45,6 @@ public void OnPluginStart()
HookEvent("round_start", OnRoundStart);
HookEvent("player_spawn", OnClientSpawn);
HookEvent("player_team", OnPlayerTeam);
HookEvent("player_hurt", OnPlayerHurt);
ConVar cvar;
@ -203,11 +202,6 @@ public void OnRoundStart(Event hEvent, const char[] sName, bool bDontBroadcast)
}
}
public void ZR_OnClientHumanPost(int client, bool respawn, bool protect)
{
g_bMotherZM[client] = false;
}
public Action ZR_OnClientInfect(int &client, int &attacker, bool &motherInfect, bool &respawnOverride, bool &respawn)
{
if(g_bTestRound)
@ -235,9 +229,15 @@ public Action ZR_OnClientMotherZombieEligible(int client)
public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn)
{
g_bMotherZM[client] = motherInfect;
g_iZHPMax[client] = GetClientHealth(client);
if(g_bMotherZM[client]) //Motherzombies that die and respawn
{
g_bMotherZM[client] = true;
return;
}
g_bMotherZM[client] = motherInfect;
}
public Action ZR_OnInfectCountdown()
@ -253,14 +253,6 @@ public void OnClientSpawn(Event hEvent, const char[] sName, bool bDontBroadcast)
int client = GetClientOfUserId(hEvent.GetInt("userid"));
g_iZShield[client] = 0;
g_bMotherZM[client] = false;
}
public Action OnPlayerTeam(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(GetEventInt(event, "userid"));
g_bMotherZM[client] = false;
}
public Action OnPlayerHurt(Event event, const char[] name, bool dontBroadcast)
@ -285,7 +277,7 @@ public bool Filter_Motherzombies(const char[] sPattern, Handle hClients, int cli
{
for(int i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i) && !IsFakeClient(i))
if(IsClientInGame(i) && !IsFakeClient(i) && GetClientTeam(client) == CS_TEAM_T)
{
if(g_bMotherZM[i])
PushArrayCell(hClients, i);
@ -302,7 +294,7 @@ public Action Command_DisplayMotherzombies(int client, int args)
for(int i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i) && !IsFakeClient(i))
if(IsClientInGame(i) && !IsFakeClient(i) && GetClientTeam(client) == CS_TEAM_T)
{
if(g_bMotherZM[i])
{