Code:
#define speed_animation skill30
#define id_animation    skill31
#define id_per          skill32
var c_animate(ENTITY* ent,ENTITY* ent2,STRING* animation ,var percentage_speed ,var animation_speed)
{
   STRING* animation_act = "";	
   var animeperc;
	if(ent2)
	{
		if(my.id_animation == 2){me.id_animation=0;}
		
		if(str_cmpi(animation_act, animation) == 1)
		{
			ent_animatefrom(ent,ent2,animation_act,ent.speed_animation,ANM_CYCLE);
			ent.speed_animation += animation_speed * time_step;
		}
		else
		{
			if((ent.id_animation == 0)&&(str_cmpi(animation_act, animation) == 0))
			{
				ent.id_per = 0;
				ent.id_animation = 1;
			}
			if(ent.id_animation == 1)
			{
				animeperc = ent_animatefrom(ent,ent2,animation_act,ent.speed_animation,ANM_CYCLE);
				ent_blendframe(ent,ent2,animation,0,ent.id_per);
				ent.id_per += percentage_speed;
				if(ent.id_per >= 100)
				{
					str_cpy(animation_act, animation);
					ent.id_animation = 2;
					ent.speed_animation=0;
				}		
			}
		}
	}
	return animeperc;
	
}



use it like ent_animate :
Code:
c_animate(me,me,"stand",70,1);