Does this help?

mouse_pos3d

The world coordinate position of the mouse cursor in relation to the 3D level, calculated from mouse_pos and the view parameters.
Type:
VECTOR*, read/only
Example:

// use the mouse to trace a ray into the level,
// and trigger EVENT_SHOOT of hit entities
function shoot_with_mouse()
{
VECTOR to;
vec_set(to,mouse_dir3d);
vec_scale(to,1000); // set a range
vec_add(to,mouse_pos3d);
c_trace(mouse_pos3d,to,ACTIVATE_SHOOT);