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);