Solved!
Thx Superku, I read a few things and now I unsderstand c_scan. It works fine.

Here is my finished code:

Code:
function event_scan_attack1_damage()
{
	if (event_type == EVENT_SCAN)
	{
		my.health -= 10;
	}
}

action enemy_with_pointer()
{
	var death_percentage;
	enemy = my;
	c_updatehull(my, 1);
	my.emask |= ENABLE_SCAN;
	my.event = event_scan_attack1_damage;
	while(1)
	{
		if (my.health <= 0) // Check life
		{
			ent_animate(my, "death", death_percentage, 0);
			death_percentage += 3 * time_step; // Animationspeed
		} 	
	wait (1);	
	}
	
}

--------> c_scan(guard1.x, guard1.pan, vector(45, 60, 50), IGNORE_ME);





Last edited by h34dl4g; 06/01/10 13:19.

1338, beyond leet.