First, use get_players instead of get_maxplayers to run loops.
Second, ExecuteHam(Ham_Weapon_PrimaryAttack...) ?
EDIT: animation of player model, not weapon. Then the problem is your stock I think.
Code:
stock Util_PlayAnimation(index, sequence, Float: framerate = 1.0)
{
entity_set_float(index, EV_FL_animtime, get_gametime());
entity_set_float(index, EV_FL_framerate, framerate);
entity_set_float(index, EV_FL_frame, 0.0);
entity_set_int(index, EV_INT_sequence, sequence);
}
__________________