From b68f66c85ab9199f5b3de5722581fa51a0a106b7 Mon Sep 17 00:00:00 2001 From: BotoX Date: Fri, 4 Oct 2019 12:03:43 +0200 Subject: [PATCH] Fix OnLibrary* spam --- .../scripting/AdvancedTargeting.sp | 17 +++++++++++++++-- ReservedSlot/scripting/ReservedSlot.sp | 17 +++++++++++++++-- SelfMute/scripting/SelfMute.sp | 19 +++++++++++++++++-- 3 files changed, 47 insertions(+), 6 deletions(-) diff --git a/AdvancedTargeting/scripting/AdvancedTargeting.sp b/AdvancedTargeting/scripting/AdvancedTargeting.sp index 15a9d800..35815027 100644 --- a/AdvancedTargeting/scripting/AdvancedTargeting.sp +++ b/AdvancedTargeting/scripting/AdvancedTargeting.sp @@ -105,8 +105,21 @@ public void OnAllPluginsLoaded() (g_Extension_Voice ? "loaded" : "not loaded")); } -public void OnLibraryAdded(const char[] name) { OnAllPluginsLoaded(); } -public void OnLibraryRemoved(const char[] name) { OnAllPluginsLoaded(); } +public void OnLibraryAdded(const char[] name) +{ + if(StrEqual(name, "voiceannounce_ex")) + g_Plugin_voiceannounce_ex = true; + else if(StrEqual(name, "Voice")) + g_Extension_Voice = true; +} + +public void OnLibraryRemoved(const char[] name) +{ + if(StrEqual(name, "voiceannounce_ex")) + g_Plugin_voiceannounce_ex = false; + else if(StrEqual(name, "Voice")) + g_Extension_Voice = false; +} public Action Command_Admins(int client, int args) { diff --git a/ReservedSlot/scripting/ReservedSlot.sp b/ReservedSlot/scripting/ReservedSlot.sp index a982c212..c23e8742 100644 --- a/ReservedSlot/scripting/ReservedSlot.sp +++ b/ReservedSlot/scripting/ReservedSlot.sp @@ -44,8 +44,21 @@ public void OnAllPluginsLoaded() (g_Plugin_UNLOZE ? "loaded" : "not loaded")); } -public void OnLibraryAdded(const char[] name) { OnAllPluginsLoaded(); } -public void OnLibraryRemoved(const char[] name) { OnAllPluginsLoaded(); } +public void OnLibraryAdded(const char[] name) +{ + if(StrEqual(name, "AFKManager")) + g_Plugin_AFKManager = true; + else if(StrEqual(name, "UNLOZE_ForumIntegration")) + g_Plugin_UNLOZE = true; +} + +public void OnLibraryRemoved(const char[] name) +{ + if(StrEqual(name, "AFKManager")) + g_Plugin_AFKManager = false; + else if(StrEqual(name, "UNLOZE_ForumIntegration")) + g_Plugin_UNLOZE = false; +} public void OnClientPostAdminCheck(int client) { diff --git a/SelfMute/scripting/SelfMute.sp b/SelfMute/scripting/SelfMute.sp index a17d9985..11d6c0b1 100644 --- a/SelfMute/scripting/SelfMute.sp +++ b/SelfMute/scripting/SelfMute.sp @@ -102,8 +102,23 @@ public void OnAllPluginsLoaded() (g_Extension_Voice ? "loaded" : "not loaded")); } -public void OnLibraryAdded(const char[] name) { OnAllPluginsLoaded(); } -public void OnLibraryRemoved(const char[] name) { OnAllPluginsLoaded(); } +void OnLibrary(const char[] name, bool added) +{ + if(StrEqual(name, "ccc")) + g_Plugin_ccc = added; + else if(StrEqual(name, "zombiereloaded")) + g_Plugin_zombiereloaded = added; + else if(StrEqual(name, "voiceannounce_ex")) + g_Plugin_voiceannounce_ex = added; + else if(StrEqual(name, "AdvancedTargeting")) + g_Plugin_AdvancedTargeting = added; + else if(StrEqual(name, "Voice")) + g_Extension_Voice = added; + +} + +public void OnLibraryAdded(const char[] name) { OnLibrary(name, true); } +public void OnLibraryRemoved(const char[] name) { OnLibrary(name, false); } public void OnClientPutInServer(int client) {