So you're trying a arm face the crosshair (not literally ofc as the crosshair is in 2d space whereas the arm is 3d space) try below one, untested.

Code:
VECTOR* trace_to;
var trace_distance = 500;
function trace_to_crosshair(ENTITY* ent)
{
   VECTOR temp;
   vec_set(temp,nullvector);
   vec_set(trace_to,nullvector);
   while(ent)
   {
 //Replace mouse cursor and trace_distance with your own variables!     
      vec_set(trace_to,vector(mouse_cursor.x,mouse_cursor.y,trace_distance);
      vec_set(temp,trace_to.x); 
      vec_sub(temp,ent.x);
      vec_to_angle(ent.pan,temp);
   wait(1);
   }
return 1;
}