I'd do it like this smile

Code:
temp.x = crosshair_x;
temp.y = crosshair_y;
temp.z = 0;
 
vec_set(target,temp);
target.z = 10000;
 
vec_for_screen(temp,view_build);
vec_for_screen(target,view_build);
 
if(c_trace(temp,target,IGNORE_ME) > 0)
{
	ent_create("crate.mdl",target,null);
}