Advertisement
Guest User

watermark_gamesense

a guest
Dec 11th, 2018
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. local abs_frame_time = globals.AbsoluteFrameTime; local frame_rate = 0.0; local get_abs_fps = function() frame_rate = 0.9 * frame_rate + (1.0 - 0.9) * abs_frame_time(); return math.floor((1.0 / frame_rate) + 0.5); end
  2. frequency = 0.1 -- range: [0, oo) | lower is slower
  3. intensity = 180 -- range: [0, 255] | lower is darker
  4. saturation = 1 -- range: [0.00, 1.00] | lower is less saturated
  5.  
  6. function hsvToR(h, s, v)
  7. local r, g, b
  8.  
  9. local i = math.floor(h * 6);
  10. local f = h * 6 - i;
  11. local p = v * (1 - s);
  12. local q = v * (1 - f * s);
  13. local t = v * (1 - (1 - f) * s);
  14.  
  15. i = i % 6
  16.  
  17. if i == 0 then r, g, b = v, t, p
  18. elseif i == 1 then r, g, b = q, v, p
  19. elseif i == 2 then r, g, b = p, v, t
  20. elseif i == 3 then r, g, b = p, q, v
  21. elseif i == 4 then r, g, b = t, p, v
  22. elseif i == 5 then r, g, b = v, p, q
  23. end
  24.  
  25. return r * intensity
  26. end
  27.  
  28. function hsvToG(h, s, v)
  29. local r, g, b
  30.  
  31. local i = math.floor(h * 6);
  32. local f = h * 6 - i;
  33. local p = v * (1 - s);
  34. local q = v * (1 - f * s);
  35. local t = v * (1 - (1 - f) * s);
  36.  
  37. i = i % 6
  38.  
  39. if i == 0 then r, g, b = v, t, p
  40. elseif i == 1 then r, g, b = q, v, p
  41. elseif i == 2 then r, g, b = p, v, t
  42. elseif i == 3 then r, g, b = p, q, v
  43. elseif i == 4 then r, g, b = t, p, v
  44. elseif i == 5 then r, g, b = v, p, q
  45. end
  46.  
  47. return g * intensity
  48. end
  49.  
  50. function hsvToB(h, s, v)
  51. local r, g, b
  52.  
  53. local i = math.floor(h * 6);
  54. local f = h * 6 - i;
  55. local p = v * (1 - s);
  56. local q = v * (1 - f * s);
  57. local t = v * (1 - (1 - f) * s);
  58.  
  59. i = i % 6
  60.  
  61. if i == 0 then r, g, b = v, t, p
  62. elseif i == 1 then r, g, b = q, v, p
  63. elseif i == 2 then r, g, b = p, v, t
  64. elseif i == 3 then r, g, b = p, q, v
  65. elseif i == 4 then r, g, b = t, p, v
  66. elseif i == 5 then r, g, b = v, p, q
  67. end
  68.  
  69. return b * intensity
  70. end
  71.  
  72.  
  73.  
  74. function use_Crayon()
  75. local ff = draw.CreateFont('Tahoma', 60)
  76. local classicf = draw.CreateFont('Tahoma', 12)
  77. local name = client.GetPlayerNameByIndex(client.GetLocalPlayerIndex())
  78. local x, y = draw.GetScreenSize()
  79. local R = hsvToR((globals.RealTime() * frequency) % 1, saturation, 1)
  80. local G = hsvToG((globals.RealTime() * frequency) % 1, saturation, 1)
  81. local B = hsvToB((globals.RealTime() * frequency) % 1, saturation, 1)
  82.  
  83. -- box
  84. --draw.Color(math.floor(R), math.floor(G), math.floor(B), 255)
  85. --draw.FilledRect(0, 0, x, 1)
  86. draw.Color(35, 35, 35, 255)
  87. draw.FilledRect(3, 5, 180, 30)
  88. draw.Color(15, 15, 15, 180)
  89. draw.FilledRect(8, 10, 175, 25)
  90. draw.Color(70, 70, 70, 180)
  91. draw.OutlinedRect(8, 10, 176, 26)
  92. draw.Color(0, 0, 0, 255)
  93. draw.OutlinedRect(2, 4, 181, 31)
  94. draw.Color(70, 70, 70, 180)
  95. draw.OutlinedRect(3, 5, 179, 29)
  96. -- fps
  97. draw.SetFont(classicf)
  98. draw.Color(math.floor(R), math.floor(G), math.floor(B), 255)
  99. draw.Text(82, 11, "fps: ".. get_abs_fps())
  100. --ping
  101. local m_iPing = entities.GetPlayerResources():GetPropInt("m_iPing", client.GetLocalPlayerIndex())
  102. draw.Color(math.floor(R), math.floor(G), math.floor(B), 255)
  103. draw.Text(130, 11, "Ping: ".. m_iPing)
  104. -- text
  105. draw.SetFont(classicf)
  106. draw.Color(159, 202, 43, 230)
  107. draw.Text(15, 11, "gamesense")
  108. draw.Color(159, 202, 43, 230)
  109. draw.Text(74, 11, "|")
  110. draw.Color(159, 202, 43, 230)
  111. draw.Text(123, 11, "|")
  112.  
  113. end
  114. callbacks.Register('Draw', 'use_Crayon', use_Crayon)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement