easiest way if you're just looking for an entity is mouse_ent.

if you need to do something using c_trace try
Code:
ENTITY* trace_getEntity(long flags){
	
	VECTOR vecFrom, vecTo;
	
	vec_set(vecFrom, vector(mouse_pos.x, mouse_pos.y, 0));
	vec_set(vecTo, vector(mouse_pos.x, mouse_pos.y, 5000));
	vec_for_screen(vecFrom, camera);
	vec_for_screen(vecTo, camera);
	
	var trace = c_trace(vecFrom, vecTo, flags);
	
	if(trace){
		return(hit.entity);
	}else{
		return(NULL);
	}
}

the code is pretty obvious as to what it's doing, just call this function on your event to direct the player

hope this helps