Hey i found some little errors... replace the volume part of the function with this:
Code:
 
volume = radius / 10;
volume -= vec_dist(camera.x,vec_pos) * volume / max(0.1,radius); //result:radius = x:volume -- ex with result = 10: 10:700=x:70

trace_mode = ignore_models + ignore_passents + ignore_passable;
if(trace(vec_pos,camera.x) != 0) {volume /= 2;}



And tell me if it works for you