Try this:

Code:


vec_set(temp, my.x);
temp.x += 1000; //distance ahead
c_trace(my.x,temp,IGNORE_ME+IGNORE_PASSABLE+IGNORE_MODELS+IGNORE_SPRITES+use_box);
if(trace_hit != 0 && you == null) //hitted something that isnt an entity
{
if(vec_dist(my.x, target) < 500)
{
beep;
}
}