Imgur: The magic of the Internet - gif
JavaScript:
UI.AddSliderInt("Y", 0, Global.GetScreenSize()[1])
UI.AddSliderInt("X", 0, Global.GetScreenSize()[0])
function normalize_yaw(angle) {
var adjusted_yaw = angle;
if (adjusted_yaw < -180)
adjusted_yaw += 360;
if (adjusted_yaw > 180)
adjusted_yaw -= 360;
return adjusted_yaw;
}
function draw () {
if (!World.GetServerString()) return;
real = Local.GetRealYaw();
fake = Local.GetFakeYaw();
font = Render.AddFont("Verdanab", 18, 800);
delta = Math.abs(normalize_yaw(real % 360 - fake % 360)) / 2;
color = [ 170 + (154 - 186) * delta / 60 , 0 + (255 - 0) * delta / 60 , 16 + (0 - 16) * delta / 60 , 255 ];
black = [ 10, 10, 10, 255 ];
y = UI.GetValue("Script Items", "Y");
x = UI.GetValue("Script Items", "X");
Render.StringCustom(x + 1, y + 1, 1, "FAKE", black, font)
Render.StringCustom(x, y, 1, "FAKE", color, font)
}
Cheat.RegisterCallback("Draw", "draw")