Have a look at the syntax of c_trace in the manual.

c_trace (player.x, vector(player.x + 128, player.y, player.z),USE_BOX);
if(trace_hit) { don't move }
else { move }

To be on the safe side (the wall could be f.i. 128.1 quants away, depending on your movement code) you could increase the distance of your trace instruction. If c_trace hits something it will return the distance to the object/ wall.

result = c_trace (player.x, vector(player.x + 150, player.y, player.z),USE_BOX);
if(trace_hit && result < 129 or some other value) { don't move }
else { move }


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends