diff --git a/ZombieManager/scripting/ZombieManager.sp b/ZombieManager/scripting/ZombieManager.sp index 4249911c..6ea10439 100644 --- a/ZombieManager/scripting/ZombieManager.sp +++ b/ZombieManager/scripting/ZombieManager.sp @@ -5,11 +5,14 @@ #include #include #include +#tryinclude bool g_bTestRound; bool g_bAdminTestRound; bool g_bMotherZM[MAXPLAYERS + 1] = { false, ...}; +bool g_Plugin_entWatch; + int g_iAFKTime; public Plugin myinfo = @@ -17,7 +20,7 @@ public Plugin myinfo = name = "Zombie Manager", author = "Dogan", description = "Tools to manage testround and zombies", - version = "1.2.0", + version = "1.3.0", url = "" }; @@ -46,6 +49,23 @@ public void OnPluginStart() RegConsoleCmd("sm_mzombies", Command_DisplayMotherzombies, "Current Mother Zombies"); } +public void OnAllPluginsLoaded() +{ + g_Plugin_entWatch = LibraryExists("entWatch-core"); +} + +public void OnLibraryAdded(const char[] name) +{ + if(StrEqual(name, "entWatch-core")) + g_Plugin_entWatch = true; +} + +public void OnLibraryRemoved(const char[] name) +{ + if(StrEqual(name, "entWatch-core")) + g_Plugin_entWatch = false; +} + public void OnPluginEnd() { RemoveMultiTargetFilter("@mzombie", Filter_Motherzombies); @@ -82,10 +102,16 @@ public Action ZR_OnClientInfect(int &client, int &attacker, bool &motherInfect, public Action ZR_OnClientMotherZombieEligible(int client) { - if(GetClientIdleTime(client) > g_iAFKTime || IsFakeClient(client)) - return Plugin_Handled; + bool bHasItem; + #if defined entWatch_core_included + if(g_Plugin_entWatch) + bHasItem = EW_ClientHasItem(client); + #endif - return Plugin_Continue; + if(GetClientIdleTime(client) > g_iAFKTime || IsFakeClient(client) || bHasItem) + return Plugin_Handled; + + return Plugin_Continue; } public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn)