My first post had sufficient information to answer the question, but:
PHP Code:
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_flashbang", "fwd_flashbang");
PHP Code:
public fwd_flashbang(ent)
{
new id = get_pdata_cbase(ent, m_pPlayer, XO_CBASEPLAYERITEM);
if(get_pdata_int(id, m_afButtonReleased, XO_CBASEPLAYER) & IN_ATTACK)
{
client_print(id, print_chat, "-attack");
}
}
__________________