EVENT_DETECT

ENABLE_DETECT

Performed c_scan and found one or more entities with ENABLE_SCAN within the scan cone. For each entity found the event is triggered separately.

Modifies:

you - Pointer to the detected entity.
result - Distance to the detected entity.

Example:

function detect_event() 
{
  if (event_type == EVENT_DETECT) 
  {
    ent_playsound(you,whamm,50);
    ent_remove(you); // kill detected entity
  }
}

action time_bomb() 
// explodes after 100 seconds and kills all entities in 500 quants range
{
  my.ENABLE_DETECT = ON; 
  my.emask |= ENABLE_DETECT;
  my.event = scan_event;
  wait(-100); // wait 100 seconds to explode
  c_scan(my.x,my.pan,vector(0,0,500),SCAN_ENTS | SCAN_LIMIT | IGNORE_ME);
  ent_remove(me);
}

See also:

event, c_scan