From 47ae247fcdc3b245a01df44f0a289a2249dad016 Mon Sep 17 00:00:00 2001 From: "zer0.k" Date: Sun, 23 Oct 2022 15:04:35 +0200 Subject: [PATCH 1/2] Avoid SDKHooking irrelevant entities --- addons/sourcemod/scripting/gokz-core.sp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/sourcemod/scripting/gokz-core.sp b/addons/sourcemod/scripting/gokz-core.sp index 05596759..fbcc3f29 100644 --- a/addons/sourcemod/scripting/gokz-core.sp +++ b/addons/sourcemod/scripting/gokz-core.sp @@ -384,6 +384,13 @@ public Action OnNormalSound(int clients[MAXPLAYERS], int &numClients, char sampl public void OnEntityCreated(int entity, const char[] classname) { + // Don't react to player related entities + if (StrEqual(classname, "predicted_viewmodel") + || StrEqual(classname, "cs_bot") || StrEqual(classname, "player") + || StrContains(classname, "weapon") != -1) + { + return; + } SDKHook(entity, SDKHook_Spawn, OnEntitySpawned); SDKHook(entity, SDKHook_SpawnPost, OnEntitySpawnedPost); OnEntityCreated_Triggerfix(entity, classname); From b719918bdec657099549a51fdd83e5f159141e35 Mon Sep 17 00:00:00 2001 From: "zer0.k" Date: Sun, 23 Oct 2022 15:50:25 +0200 Subject: [PATCH 2/2] Add player armor to ignore list --- addons/sourcemod/scripting/gokz-core.sp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sourcemod/scripting/gokz-core.sp b/addons/sourcemod/scripting/gokz-core.sp index fbcc3f29..aaa1cd7b 100644 --- a/addons/sourcemod/scripting/gokz-core.sp +++ b/addons/sourcemod/scripting/gokz-core.sp @@ -385,7 +385,7 @@ public Action OnNormalSound(int clients[MAXPLAYERS], int &numClients, char sampl public void OnEntityCreated(int entity, const char[] classname) { // Don't react to player related entities - if (StrEqual(classname, "predicted_viewmodel") + if (StrEqual(classname, "predicted_viewmodel") || StrEqual(classname, "item_assaultsuit") || StrEqual(classname, "cs_bot") || StrEqual(classname, "player") || StrContains(classname, "weapon") != -1) {