Advertisement
Mister_Stefan

hud v4ot

Jun 16th, 2021
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. notspam = 0; netspam = 0; x = -45; y = Render.GetScreenSize()[1] - 75; w = 360; h = 75; whit = 0; bomb = 0; bombsite = -1; white = 200;health2 = 0;armor2 = 0;
  2.  
  3. UI.AddSubTab(["Visuals", "SUBTAB_MGR"], "Better Hud")
  4. UI.AddCheckbox(["Visuals", "Better Hud", "SHEET_MGR", "Better Hud"], "Enable Better Hud");
  5. UI.AddCheckbox(["Visuals", "Better Hud", "SHEET_MGR", "Better Hud"], "Gamesense Menu");
  6.  
  7. if (Convar.GetString("cl_detail_max_sway") == 5){
  8. Cheat.PrintColor([255,255,255,255], ("["));
  9. Cheat.PrintColor([60,255,60,255], ("SCRIPT"));
  10. Cheat.PrintColor([255,255,255,255], ("] By"));
  11. Cheat.PrintColor([255,60,60,255], (" Zero Two \n"));
  12. Convar.SetString ("cl_detail_max_sway", "5.1");
  13. }
  14.  
  15. function on_bomb_beginplant(){
  16. bomb = 1;
  17. bombsite = Event.GetInt("site");
  18. last_time = Globals.Curtime();
  19. }
  20. function on_bomb_abortplant()
  21. {
  22. bomb = 0;
  23. bombsite = -1;
  24. }
  25. function on_bomb_exploded()
  26. {
  27. bomb = 0;
  28. bombsite = -1;
  29. }
  30. function endround(){
  31. bomb = 0;
  32. bombsite = -1;
  33. }
  34. function on_bomb_defused(){
  35. bomb = 0;
  36. bombsite = -1;
  37. white = 200;
  38. }
  39. function on_bomb_begindefuse(){
  40. white = 50;
  41. }
  42. function on_bomb_abortdefuse(){
  43. white = 200;
  44. }
  45. function calcDist(local, target) {
  46. var lx = local[0];
  47. var ly = local[1];
  48. var lz = local[2];
  49. var tx = target[0];
  50. var ty = target[1];
  51. var tz = target[2];
  52. var dx = lx - tx;
  53. var dy = ly - ty;
  54. var dz = lz - tz;
  55.  
  56. return Math.sqrt(dx * dx + dy * dy + dz * dz);
  57. }
  58.  
  59. function main(){
  60. if (!Entity.IsValid(Entity.GetLocalPlayer())) return
  61. if (UI.GetValue(["Visuals", "Better Hud", "Enable Better Hud"])){
  62. health = Entity.GetProp(Entity.GetLocalPlayer(), "CBasePlayer", "m_iHealth");
  63. armor = Entity.GetProp(Entity.GetLocalPlayer(), "CCSPlayerResource", "m_iArmor");
  64.  
  65. if (health2 != health){
  66. if (health2 < health){
  67. health2 = health2 + 1;
  68. }else{
  69. health2 = health2 - 1;
  70. }
  71. }
  72. if (armor2 != armor){
  73. if (armor2 < armor){
  74. armor2 = armor2 + 1;
  75. }else{
  76. armor2 = armor2 - 1;
  77. }
  78. }
  79.  
  80. var text = "" + health2;
  81. var text2 = "" + armor2;
  82.  
  83. var red = 255 - (health2 * 2.55);
  84. var green = health2 * 2.55
  85.  
  86. var font = Render.AddFont( "Arial", 15, 100);
  87.  
  88. if (Entity.IsAlive(Entity.GetLocalPlayer())){
  89. if (UI.GetValue(["Visuals", "Better Hud", "Gamesense Menu"])){
  90. Render.FilledRect( x + 45, y, w, h, [ 40, 40, 40, 255 ] );
  91. Render.FilledRect( x + 50, y + 7, w-11, h-12 , [ 19, 19, 19, 255 ] );
  92. Render.Rect( x + 50, y + 5, w-10, h-9, [ 50, 50, 50, 255 ] );
  93. colors = HSVtoRGB(Global.Realtime() * 0.1, 1, 1);
  94. Render.GradientRect(x + 51, y + 6, w-12, 1, 1, [colors.g, colors.b, colors.r, 255], [colors.r, colors.g, colors.b, 255]);
  95.  
  96. h = 75;
  97. y = Render.GetScreenSize()[1] - 75;
  98. if (bomb == 1){
  99. arfor = Entity.GetProp(Entity.GetLocalPlayer(), "CCSPlayerResource", "m_iArmor");
  100. var c4 = Entity.GetEntitiesByClassID(128)[0];
  101.  
  102. h = 105;
  103. y = Render.GetScreenSize()[1] - 105;
  104. if (bombsite % 2 == 0){
  105. Render.String( x + 70, y + 18, 0, "Bombsite: B", [ 255, 255, 255, 255 ], font );
  106. }else{
  107. Render.String( x + 70, y + 18, 0, "Bombsite: A", [ 255, 255, 255, 255 ], font );
  108. }
  109. Render.Rect( x + 190, y + 26, 140, 8, [ 200, 200, 200, 200] );
  110.  
  111. if ((Globals.Curtime() - last_time) / 3.125 < 1){
  112. Render.FilledRect( x + 191, y + 27, ((Globals.Curtime() - last_time) / 3.125)*140, 6, [ 200, 200, 200, 200] )
  113. }
  114.  
  115. if (c4 != undefined) {
  116. var timer = (Entity.GetProp(c4, "CPlantedC4", "m_flC4Blow") - Globals.Curtime());
  117. var eLoc = Entity.GetRenderOrigin(c4);
  118. var lLoc = Entity.GetRenderOrigin(Entity.GetLocalPlayer())
  119. var distance = calcDist(eLoc, lLoc);
  120. var willKill = false;
  121. var dmg;
  122. var length = Entity.GetProp(c4, "CPlantedC4", "m_flTimerLength");
  123. var timer2 = timer^ 0;
  124. var timer2 = timer2 + 1;
  125. var text3 = "" + timer2;
  126. Render.String( x + 195 + (timer * 3.47), y + 31, 0, text3, [ 255, 255, 255, 255 ], 2 );
  127. Render.FilledRect( x + 191, y + 27, (timer * 3.47), 6, [ white, white, 200, 200] )
  128.  
  129. const a = 450.7;
  130. const b = 75.68;
  131. const c = 789.2;
  132.  
  133. const d = (distance - b) / c;
  134.  
  135. var damage = a * Math.exp(-d * d);
  136.  
  137. if (arfor > 0) {
  138. var newDmg = damage * 0.5;
  139. var armorDmg = (damage - newDmg) * 0.5;
  140.  
  141. if (armorDmg > arfor) {
  142. arfor = arfor * (1 / .5);
  143. newDmg = damage - armorDmg;
  144. }
  145. damage = newDmg;
  146. }
  147. dmg = Math.ceil(damage);
  148.  
  149. if (dmg >= health)
  150. willKill = true;
  151. else
  152. willKill = false;
  153.  
  154. if (willKill) {
  155. Render.String(x + 333, y + 19, 0, "LETHAL", [255, 0, 0, 255], 9);
  156. } else if (damage > 10) {
  157. Render.String(x + 340, y + 18, 0, "-" + dmg, [255, 255, 255, 255], font);
  158. }
  159. }
  160. }
  161.  
  162. whit = 200;
  163. }else{
  164. whit = 0;
  165. }
  166. //hp
  167. Render.Rect( 25, Render.GetScreenSize()[1] - 27, 116, 8, [ whit, whit, whit, 200 ] );
  168. Render.String( 99, Render.GetScreenSize()[1] - 53, 0, "HP", [ 0, 0, 0, 255 ], font );
  169. Render.String( 100, Render.GetScreenSize()[1] - 52, 0, "HP", [ 255, 255, 255, 255 ], font );
  170.  
  171. Render.String( 27, Render.GetScreenSize()[1] - 53, 0, text, [ 0, 0, 0, 255 ], font );
  172. Render.String( 28, Render.GetScreenSize()[1] - 52, 0, text, [ red, green, 0, 255 ], font );
  173. Render.FilledRect( 26, Render.GetScreenSize()[1] - 26, (health2 * 1.145), 6, [red, green, 0, 255]);
  174.  
  175. //armor
  176. Render.Rect( 174, Render.GetScreenSize()[1] - 27, 160, 8, [ whit, whit, whit, 200] );
  177. Render.String( 244, Render.GetScreenSize()[1] - 53, 0, "ARMOR", [ 0, 0, 0, 255 ], font );
  178. Render.String( 245, Render.GetScreenSize()[1] - 52, 0, "ARMOR", [ 255, 255, 255, 255 ], font );
  179.  
  180. Render.String( 173, Render.GetScreenSize()[1] - 53, 0, text2, [ 0, 0, 0, 255 ], font );
  181. Render.String( 174, Render.GetScreenSize()[1] - 52, 0, text2, [ 7, 169, 232, 255 ], font );
  182. Render.FilledRect( 175, Render.GetScreenSize()[1] - 26, (armor2 * 1.58), 6, [7, 169, 232, 255]);
  183.  
  184. if ((UI.GetValue(["Visuals", "Better Hud", "Enable Better Hud"])) && (notspam == 0)){
  185. Cheat.ExecuteCommand("hidehud 8");
  186. notspam = 1;
  187. }
  188. if (netspam == 1){
  189. Cheat.ExecuteCommand("hidehud 8");
  190. netspam = 0;
  191. }
  192. }else{
  193. if (netspam == 0){
  194. Cheat.ExecuteCommand("hidehud 0");
  195. netspam = 1;
  196. }
  197. }
  198. }else{
  199. if (notspam == 1){
  200. Cheat.ExecuteCommand("hidehud 0");
  201. notspam = 0;
  202. }
  203. }
  204. }
  205.  
  206. function HSVtoRGB(h, s, v)
  207. {
  208. var r, g, b, i, f, p, q, t;
  209.  
  210. i = Math.floor(h * 6);
  211. f = h * 6 - i;
  212. p = v * (1 - s);
  213. q = v * (1 - f * s);
  214. t = v * (1 - (1 - f) * s);
  215.  
  216. switch (i % 6)
  217. {
  218. case 0: r = v, g = t, b = p; break;
  219. case 1: r = q, g = v, b = p; break;
  220. case 2: r = p, g = v, b = t; break;
  221. case 3: r = p, g = q, b = v; break;
  222. case 4: r = t, g = p, b = v; break;
  223. case 5: r = v, g = p, b = q; break;
  224. }
  225.  
  226. return { r: Math.round(r * 255), g: Math.round(g * 255), b: Math.round(b * 255) };
  227. }
  228.  
  229. Cheat.RegisterCallback("bomb_abortdefuse", "on_bomb_abortdefuse");
  230. Cheat.RegisterCallback("bomb_begindefuse", "on_bomb_begindefuse");
  231. Global.RegisterCallback('round_end', 'endround');
  232. Cheat.RegisterCallback("bomb_exploded", "on_bomb_exploded");
  233. Cheat.RegisterCallback("bomb_defused", "on_bomb_defused");
  234. Cheat.RegisterCallback("bomb_abortplant", "on_bomb_abortplant");
  235. Cheat.RegisterCallback("bomb_beginplant", "on_bomb_beginplant");
  236. Cheat.RegisterCallback("Draw", "main");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement