if (client < 1 || client > MaxClients || !IsClientInGame(client)) { return; } int weapon; for (int i = 1; i <=2; i++) { if ((weapon = GetPlayerWeaponSlot(client, i)) != -1) { if (IsValidEntity(weapon)) { RemovePlayerItem(client, weapon); AcceptEntityInput(weapon, "Kill"); } } } }
Haven't tested (I think this will only work on CS:GO or maybe css if i'm not wrong).
EDIT: and i just think if you have less than 4 players on your server, it would probably crash with my code , fixed so the team choosing system won't work unless you have 4 players connected.