From 5d63d283e4102ee8b3d62956660bc264d37459e3 Mon Sep 17 00:00:00 2001 From: zaCade Date: Sat, 13 Apr 2019 22:43:22 +0200 Subject: [PATCH] entWatch4: Drop anything thats not a knife on Death and Disconnect. Should probably look into making it actually check weaponslots somehow... --- _entWatch4/scripting/entWatch-core.sp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/_entWatch4/scripting/entWatch-core.sp b/_entWatch4/scripting/entWatch-core.sp index bb517934..5c5a2cb4 100644 --- a/_entWatch4/scripting/entWatch-core.sp +++ b/_entWatch4/scripting/entWatch-core.sp @@ -417,6 +417,17 @@ public void OnClientDisconnect(int client) if (item.bClient && item.iClient == client) { + if (item.bWeapon) + { + char sWeaponClass[32]; + GetEntityClassname(item.iWeapon, sWeaponClass, sizeof(sWeaponClass)) + + if (!StrEqual(sWeaponClass, "weapon_bayonet") && strncmp(sWeaponClass, "weapon_knife", 12) != 0) + { + SDKHooks_DropWeapon(item.iClient, item.iWeapon, NULL_VECTOR, NULL_VECTOR); + } + } + item.iClient = INVALID_ENT_REFERENCE; Call_StartForward(g_hFwd_OnClientItemDisconnect); @@ -443,6 +454,17 @@ public void OnClientDeath(Event hEvent, const char[] sEvent, bool bDontBroadcast if (item.bClient && item.iClient == client) { + if (item.bWeapon) + { + char sWeaponClass[32]; + GetEntityClassname(item.iWeapon, sWeaponClass, sizeof(sWeaponClass)) + + if (!StrEqual(sWeaponClass, "weapon_bayonet") && strncmp(sWeaponClass, "weapon_knife", 12) != 0) + { + SDKHooks_DropWeapon(item.iClient, item.iWeapon, NULL_VECTOR, NULL_VECTOR); + } + } + item.iClient = INVALID_ENT_REFERENCE; Call_StartForward(g_hFwd_OnClientItemDeath);