Maybe
- > make a const and insert all Primary Weapons bits ( CSW_M4A1, etc ... )
- > user get_user_weapons and check if they have const bits, make a loop using the stock and drop them.
Here's the code:
Spoiler
Code:
#include <amxmodx>
#include <fun>
const PWBits = ( ( 1 << CSW_ELITE ) | ( 1 << CSW_XM1014 ) | ( 1 << CSW_MAC10 ) | ( 1 << CSW_AUG ) | ( 1 << CSW_UMP45 ) | ( 1 << CSW_SG550 ) | ( 1 << CSW_GALIL ) | ( 1 << CSW_FAMAS ) | ( 1 << CSW_AWP ) | ( 1 << CSW_MP5NAVY ) | ( 1 << CSW_M249 ) | ( 1 << CSW_M3 ) | ( 1 << CSW_M4A1 ) | ( 1 << CSW_TMP ) | ( 1 << CSW_G3SG1 ) | ( 1 << CSW_SG552 ) | ( 1 << CSW_AK47 ) | ( 1 << CSW_SCOUT ) | ( 1 << CSW_P90 ) )
public plugin_init( )
{
register_clcmd( "say /shield" , "shield_x" );
}
public shield_x( id )
{
new Weapons[32], Num, szWeaponName[20];
get_user_weapons( id, Weapons, Num );
for( new i = 0; i < Num ;i++ )
{
if( PWBits & ( 1 << Weapons[ i ] ) )
{
get_weaponname( Weapons[ i ] , szWeaponName, charsmax( szWeaponName ) );
engclient_cmd( id, "drop", szWeaponName );
}
}
give_item( id, "weapon_shield" );
return PLUGIN_HANDLED;
}
__________________