There's an example in the manual, see "path_scan":

Code:
action patrol_path()
 {
 // attach entity to nearest path
  result = path_scan(me,my.x,my.pan,vector(360,180,1000));
  if (result == 0) { return; } // no path found
 
 // find first waypoint
  var node = 1; // start at first node
  path_nodepos(my,node,my.skill20);
 
  while (1)
  {
    var angle[3];
 // find direction
    result = vec_to_angle(angle,vec_diff(temp,my.skill20,my.x));
 
 // near target? Find next waypoint of the path
    if (result < 25) {
      node = path_nextnode(my,node,1);
      path_nodepos(my,node,my._TARGET_X);
    }
 
 // turn and walk towards target
    my.pan = angle[0];
    c_move(me,vector(3*time_step,0,0),NULL,GLIDE); // walk ahead...
    wait(1);
  }
}




"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends