%trans = serverconnection.getcontrolob ject().gettransform(); returns your client-sided transform, which is basically your position and rotation as a long string.
the first 2 words of the above are your position in 2d space. you dont need the y axis because your height is irellevent
2 * 3.14159 - (getword(%trans,5) * getword(%trans,6)); returns your rotation as an angle out of 360 (i think) or possibly radians.
once you have the angle you can basically decide which direction you're facing. 0 degrees is N, 45 is NE, 90 is E, 135 is SE 180 W etc