-- DESCRIPTION: Compass test --local compass_display = {} local compass = {} function compass_init(e) for i=1, 360, 1 do if i == 1 then compass[i] = "N" elseif i == 46 then compass[i] = "NE" elseif i == 91 then compass[i] = "E" elseif i == 136 then compass[i] = "SE" elseif i == 181 then compass[i] = "S" elseif i == 226 then compass[i] = "SW" elseif i == 271 then compass[i] = "W" elseif i == 316 then compass[i] = "NW" elseif math.fmod(i,10) == 1 then compass[i] = "|" else compass[i] = "." end end end function compass_main(e) local start=0 local compass_str="" local bearing=0 bearing = math.floor(math.fmod(g_PlayerAngY, 360)) if bearing < 0 then bearing=bearing+360 end if bearing < 45 then start = 315 + bearing else start=bearing-45 end local arraypos=start for i=1,91, 1 do if arraypos==360 or arraypos<=0 then arraypos=1 else arraypos=arraypos+1 end compass_str=compass_str..compass[arraypos] end TextCenterOnXColor(50,1,2,"Navigation Compass",100,255,100) TextCenterOnXColor(50,3,2,compass_str,100,255,100) TextCenterOnXColor(50,4,2,"^",255,255,255) TextCenterOnXColor(50,5,2,bearing,100,255,100) end