Your posting in the wrong section. Look below.

Code:
action mball_action()
{
you = player;  // not needed
vec_set(my.pan,you.pan);

while(my)
{
c_move(my,vector(20*time_step,0,0),nullvector,IGNORE_YOU | IGNORE_PASSABLE | ACTIVATE_SHOOT);
if(event_type == EVENT_SHOOT)
{
wait(1);
ent_remove(my);
}
wait(1);
}
}


function mball_damage()
{
if(event_type == EVENT_SHOOT)
my.HEALTH -= 10;
}

action enemy_action()
{
my.emask |= ENABLE_SHOOT;
my.event = mball_damage;
// more code here  ///
}

action player_code()
{
VECTOR vec_mball;


// your code here ///

if(mouse_left && !mlock)
{
mlock = 1;
vec_set(vec_mball,vector(50,0,0));
vec_add(vec_mball,my.x)
vec_rotate(vec_mball,my.pan);
ent_create("mball.mdl",vec_mball,mball_action);
}
if(!mouse_left)
mlock =0;


// more code here //
}



EDIT change a little... I did it from the player and mouse fire but you should get the idea

event_type == EVENT_SHOOT is your true/false

EDIT2 also look at c_move and this
Quote:
hit.flags The HIT_TARGET macro is nonzero when something was hit.

Last edited by Malice; 06/12/13 05:19.