Use c_scan and remember to set my.enable_scan = on;
not testet, but something like this:

Code:
 
function sentry_fun
{
while(me)
{
if(c_scan(me,my.pan,vector(120,40,500),ignore_me | SCAN_ENTS) ==1) && (you == player) //if player is in range and pan
{
c_trace(my.x,player.x,ignore_me | ignore_passable);
if(result != 0) && (you == player)//if nothing is between player and sentry
{
vec_set(temp,player.x);
vec_sub(temp,my.x);
vec_to_angle(my.pan,temp); //look at player
fire(); // another function with fire, sound, particle... etc
}
}
wait(1);
}
}



Last edited by tompo; 07/02/07 08:22.

Never say never.