I'm trying to register the forwards for main rifles and machine gun only, but it seems as though this isn't working out so well for me.
Can anyone help out? Thanks!
PHP Code:
const NOCLIP_WPN_BS = ((1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_UMP45)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M3)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))
public plugin_init()
{
register_plugin("blah", "1.0", "blah")
for (new i=CSW_AUG;i<=CSW_AK47;i++)
{
if( get_weaponname(i, szWeapon, charsmax(szWeapon)) )
{
if( i & ~NOCLIP_WPN_BS & 1<<i )
{
RegisterHam( Ham_Weapon_PrimaryAttack, szWeapon, "fw_primary_attack" )
RegisterHam( Ham_Weapon_PrimaryAttack, szWeapon, "fw_primary_attack_post", 1 )
RegisterHam(Ham_Weapon_Reload, szWeapon, "ham_Reload_Post", 1)
}
}
}
}