0 = N
90 = E
180 = S
270 = W
function findRotation(x1,y1,x2,y2)
local t = -math.deg(math.atan2(x2-x1,y2-y1))
if t < 0 then t = t + 360 end;
return t;
end
addCommandHandler( "get",
function ( thePlayer )
local x, y, z, x1, y1, z1 = getCameraMatrix ( thePlayer )
local rx, ry, rz = findRotation(x, y, x1, y1)
outputChatBox( rz, thePlayer)
end
)