add states.
if weapon_state == 1
weapon.frame += 1 * time;
if(weapon.frame > x) { weapon_frame = x; }
if(weapon.frame < y) { weapon_frame = y; }

where x is the last frame from the animation (just a section of the whole animation) and y is the first.
do that for every section of the animation. if weapon_state == 2...3...


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201