ZombieManager: strip sm_zhp

and fix retarded mzombie bug
This commit is contained in:
dogan 2020-08-08 21:56:59 +02:00
parent 0c35ff8841
commit 9a4b654ba8

View File

@ -12,8 +12,8 @@ bool g_bTestRound;
bool g_bAdminTestRound; bool g_bAdminTestRound;
bool g_bMotherZM[MAXPLAYERS + 1] = { false, ...}; bool g_bMotherZM[MAXPLAYERS + 1] = { false, ...};
bool g_bZHP[MAXPLAYERS + 1] = { false, ... }; /*bool g_bZHP[MAXPLAYERS + 1] = { false, ... };
Handle g_hCookieZHP = null; Handle g_hCookieZHP = null;*/
int g_iZHPMax[MAXPLAYERS + 1]; int g_iZHPMax[MAXPLAYERS + 1];
int g_iZShield[MAXPLAYERS + 1]; int g_iZShield[MAXPLAYERS + 1];
bool g_bShield; bool g_bShield;
@ -54,9 +54,9 @@ public void OnPluginStart()
g_bShield = cvar.BoolValue; g_bShield = cvar.BoolValue;
delete cvar; delete cvar;
RegConsoleCmd("sm_zhp", OnToggleZHP, "Toggle blocking Zombie HP and Shield display"); /*RegConsoleCmd("sm_zhp", OnToggleZHP, "Toggle blocking Zombie HP and Shield display");
g_hCookieZHP = RegClientCookie("zhp_blocked", "are zombie hp and shield display blocked", CookieAccess_Protected); g_hCookieZHP = RegClientCookie("zhp_blocked", "are zombie hp and shield display blocked", CookieAccess_Protected);
SetCookieMenuItem(MenuHandler_CookieMenu, 0, "Zombie HP Shield Display"); SetCookieMenuItem(MenuHandler_CookieMenu, 0, "Zombie HP Shield Display");*/
AutoExecConfig(true, "plugin.ZombieManager"); AutoExecConfig(true, "plugin.ZombieManager");
@ -92,7 +92,7 @@ public void OnMapStart()
g_bShield = GetConVarBool(FindConVar("sm_zombieshield")); g_bShield = GetConVarBool(FindConVar("sm_zombieshield"));
} }
public Action OnToggleZHP(int client, int args) /*public Action OnToggleZHP(int client, int args)
{ {
ToggleZHP(client); ToggleZHP(client);
return Plugin_Handled; return Plugin_Handled;
@ -104,9 +104,9 @@ public void ToggleZHP(int client)
SetClientCookie(client, g_hCookieZHP, g_bZHP[client] ? "1" : ""); SetClientCookie(client, g_hCookieZHP, g_bZHP[client] ? "1" : "");
CPrintToChat(client, "{green}[ZR] {yellow}%s", g_bZHP[client] ? "Zombie HP and Shield display disabled." : "Zombie HP and Shield display enabled."); CPrintToChat(client, "{green}[ZR] {yellow}%s", g_bZHP[client] ? "Zombie HP and Shield display disabled." : "Zombie HP and Shield display enabled.");
} }*/
public void OnClientCookiesCached(int client) /*public void OnClientCookiesCached(int client)
{ {
char sBuffer[2]; char sBuffer[2];
@ -115,16 +115,16 @@ public void OnClientCookiesCached(int client)
g_bZHP[client] = true; g_bZHP[client] = true;
else else
g_bZHP[client] = false; g_bZHP[client] = false;
} }*/
public void OnClientDisconnect(int client) public void OnClientDisconnect(int client)
{ {
g_bZHP[client] = false; //g_bZHP[client] = false;
g_iZHPMax[client] = 0; g_iZHPMax[client] = 0;
g_iZShield[client] = 0; g_iZShield[client] = 0;
} }
public void ShowSettingsMenu(int client) /*public void ShowSettingsMenu(int client)
{ {
Menu menu = new Menu(MenuHandler_MainMenu); Menu menu = new Menu(MenuHandler_MainMenu);
@ -177,7 +177,7 @@ public int MenuHandler_MainMenu(Menu menu, MenuAction action, int client, int se
delete menu; delete menu;
} }
} }
} }*/
public void Cvar_AFKTime(ConVar convar, const char[] oldValue, const char[] newValue) public void Cvar_AFKTime(ConVar convar, const char[] oldValue, const char[] newValue)
{ {
@ -277,7 +277,7 @@ public bool Filter_Motherzombies(const char[] sPattern, Handle hClients, int cli
{ {
for(int i = 1; i <= MaxClients; i++) for(int i = 1; i <= MaxClients; i++)
{ {
if(IsClientInGame(i) && !IsFakeClient(i) && GetClientTeam(client) == CS_TEAM_T) if(IsClientInGame(i) && !IsFakeClient(i) && GetClientTeam(i) == CS_TEAM_T)
{ {
if(g_bMotherZM[i]) if(g_bMotherZM[i])
PushArrayCell(hClients, i); PushArrayCell(hClients, i);
@ -300,7 +300,7 @@ public Action Command_DisplayMotherzombies(int client, int args)
for(int i = 1; i <= MaxClients; i++) for(int i = 1; i <= MaxClients; i++)
{ {
if(IsClientInGame(i) && !IsFakeClient(i) && GetClientTeam(client) == CS_TEAM_T) if(IsClientInGame(i) && !IsFakeClient(i) && GetClientTeam(i) == CS_TEAM_T)
{ {
if(g_bMotherZM[i]) if(g_bMotherZM[i])
{ {
@ -475,7 +475,7 @@ public Action Timer_UpdateHintMessage(Handle timer)
bool bVote = IsVoteInProgress(); bool bVote = IsVoteInProgress();
if(g_bZHP[i] || bVote) if(/*g_bZHP[i] || */bVote)
continue; continue;
if(g_iZShield[i] <= 0) if(g_iZShield[i] <= 0)