You can take code from here :
http://forums.alliedmods.net/showthread.php?p=761924
If you don't care about bpammo, here are 2 other simpler ways :
PHP Code:
const NODROP_WPNS_BITSUM = (1<<CSW_KNIFE)|(1<<CSW_HEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_SMOKEGRENADE)
#define FIRST_WEAPON = CSW_P228
#define LAST_WEAPON = CSW_P90
DropPlayerWeapons( id )
{
new iWeapons[32], iNum, iWeapon
get_user_weapons(id, iWeapons, iNum)
new szWeaponName[22]
for(--iNum; iNum>=0; iNum--)
{
iWeapon = iWeapons[iNum]
if( iWeapons & (1<<iWeapon) && ~NODROP_WPNS_BITSUM & (1<<iWeapon) )
{
get_weaponname(iWeapon, szWeaponName, charsmax(szWeaponName))
engclient_cmd(id, "drop", szWeaponName)
}
}
}
DropPlayerWeapons2( id )
{
new iWeapons = pev(id, pev_weapons)
new szWeaponName[22]
for(new iWeapon = FIRST_WEAPON; iWeapon<=LAST_WEAPON; iWeapons++)
{
if( iWeapons & (1<<iWeapon) && ~NODROP_WPNS_BITSUM & (1<<iWeapon) )
{
get_weaponname(iWeapon, szWeaponName, charsmax(szWeaponName))
engclient_cmd(id, "drop", szWeaponName)
}
}
}
__________________