From 96c640b58d0543d374a31a64d26c21a802ab9c28 Mon Sep 17 00:00:00 2001 From: zaCade Date: Sat, 9 Mar 2019 12:40:29 +0100 Subject: [PATCH] General: Fix random csgo extra slots not being stripped propperly. Yeah this couldve been written cleaner, this way its atleast slightly future proof. Since slot 13 is currently the last slot. --- src/zr/weapons/weapons.inc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/zr/weapons/weapons.inc b/src/zr/weapons/weapons.inc index 8c1e756..241a5f7 100644 --- a/src/zr/weapons/weapons.inc +++ b/src/zr/weapons/weapons.inc @@ -897,6 +897,24 @@ stock WeaponsRemoveAllClientWeapons(client, bool:weaponsdrop) // Remove left-over projectiles. WeaponsClearClientWeaponSlot(client, Slot_Projectile, weaponsdrop); + // Clear all higher slots in csgo. Damn game keeps adding sloots. + if (g_Game == Game_CSGO) + { + for (new slot = 6; slot < 20; slot++) + { + new weapon = GetPlayerWeaponSlot(client, slot); + while (weapon != -1) + { + // Strip the weapon. + RemovePlayerItem(client, weapon); + AcceptEntityInput(weapon, "Kill"); + + // Find next weapon. + weapon = GetPlayerWeaponSlot(client, slot); + } + } + } + // Give zombie a new knife. (If you leave the old one there will be glitches with the knife positioning) GivePlayerItem(client, "weapon_knife"); }