entity_get_button(id,EV_INT_button)
And then check & IN_ATTACK
So you have:
Code:
if(entity_get_button(id,EV_INT_button) & IN_ATTACK)
{
// code
}
And do the same for IN_ATTACK2 for alt attack.
To restrict it, it involves a bit more work. You basically have to constantly run this, in something like client_PreThink:
Code:
entity_set_int(id,EV_INT_button,entity_get_int(id,EV_INT_button) & ~IN_ATTACK)
Or if that doesn't work, you can use:
Code:
entity_set_int(id,EV_INT,button,IN_CANCEL)
__________________