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.
This commit is contained in:
zaCade 2019-03-09 12:40:29 +01:00
parent c5bcfa65a8
commit 96c640b58d

View File

@ -897,6 +897,24 @@ stock WeaponsRemoveAllClientWeapons(client, bool:weaponsdrop)
// Remove left-over projectiles. // Remove left-over projectiles.
WeaponsClearClientWeaponSlot(client, Slot_Projectile, weaponsdrop); 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) // Give zombie a new knife. (If you leave the old one there will be glitches with the knife positioning)
GivePlayerItem(client, "weapon_knife"); GivePlayerItem(client, "weapon_knife");
} }