here this musted work;
________________________________________________________________________________
function enemy_event();
function remove_bullets();
action your_player()
{
VECTOR bullet_pos;
.....
if (mouse_left && (total_frames % 24 == 1))
{
vec_for_vertex(bullet_pos, my, ...);
ent_create("....mdl", bullet_pos, move_bullets);
}
......
}
.....
action your_enemy()
{
my.emask = ENABLE_IMPACT | ENABLE_ENTITY;
my.event = enemy_event;
.....
}
function enemy_event()
{
if (you.skill100 != 999999) {return;}
my.event = NULL;
wait (1);
set (my, PASSABLE);
wait (1);
ent_remove(me);
}
action bullet()
{
VECTOR bullet_speed[3];
my.emask = ENABLE_IMPACT | ENABLE_ENTITY | ENABLE_BLOCK;
my.event = remove_bullets;
my.pan = you.pan;
my.tilt = you.tilt;
my.skill100 = 999999;
bullet_speed.x = 35 * time_step;
bullet_speed.y = 0;
bullet_speed.z = 0;
while (my)
{
c_move (my, bullet_speed, nullvector, IGNORE_PASSABLE | IGNORE_YOU);
wait (1);
}
}
function remove_bullets()
{
wait (1);
ent_remove (my);
}
________________________________________________________________________________
Last edited by Blackchuck; 12/06/09 13:48.