Code:
#define anm skill100
#define idle 0
#define attack 1


void _hold_fps_weapon()
{
   set(my, PASSABLE | ZNEAR);
   while(my){
      // place weapon on screen
      vec_set(my.x, camera.x);
      vec_set(my.pan, camera.pan);

      my.skill1 += time_step; 
      if (my.anm == idle)  ent_animate(me, "idle", my.skill1, ANM_CYCLE);
      if (my.anm == attack)ent_animate(me, "attack", my.skill1, NULL);

      if (mouse_left && my.anm != attack){
         my.skill1 = 0;
         my.anm = attack;
      }
      // my.skill1 %= 100;
      if (my.skill1 >= 100){
         my.anm = idle;
         my.skill1 = 0;
      }
      wait(1);
   }
}
action myPlayer(){
   ent_create("sword.mdl", vector(my.x, my.y, my.z), _hold_fps_weapon);
}



Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;