Advertisement
Ultranite

Untitled

Dec 11th, 2019
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. var killcount = 0;
  2. var waitingTimeout = 0;
  3. var runTime = Global.Curtime();
  4. var shouldDraw = 1;
  5. var waitingClear = 0;
  6. var drawTime = Global.Curtime();
  7. var headshot = 0;
  8. var headshotTime = Global.Curtime();
  9. var waitingHeadshot = 0;
  10.  
  11. setup();
  12.  
  13.  
  14. function onKill() {
  15. if(!Entity.IsLocalPlayer(Entity.GetEntityFromUserID(Event.GetInt("attacker"))))
  16. return;
  17.  
  18. runTime = Global.Curtime();
  19. waitingTimeout = 1;
  20. killcount++;
  21.  
  22. if(Event.GetInt("headshot") == 1) {
  23. Sound.Play("C:\\Program Files (x86)\\Steam\\steamapps\\common\\Counter-Strike Global Offensive\\ot\\scripts\\headshot.wav");
  24. headshot = 1;
  25. headshotTime = Global.Curtime();
  26. waitingHeadshot = 1;
  27. }
  28. }
  29.  
  30. function draw() {
  31. screenSize = Render.GetScreenSize();
  32.  
  33. if(shouldDraw != 1)
  34. return;
  35. if(killcount < 1 || headshot != 1)
  36. return;
  37.  
  38. waitingClear = 1;
  39.  
  40. if(killcount == 2) {
  41. pic = Render.AddTexture("ot/scripts/badge_multi2.tga");
  42. Render.TexturedRect(screenSize[0]*.5,screenSize[1]*.75,100, 100, pic );
  43. drawTime = Global.Curtime();
  44. } else
  45. if(killcount == 3) {
  46. pic = Render.AddTexture("ot/scripts/badge_multi3.tga");
  47. Render.TexturedRect(screenSize[0]*.5,screenSize[1]*.75,100, 100, pic );
  48. drawTime = Global.Curtime();
  49. } else
  50. if(killcount == 4) {
  51. pic = Render.AddTexture("ot/scripts/badge_multi4.tga");
  52. Render.TexturedRect(screenSize[0]*.5,screenSize[1]*.75,100, 100, pic );
  53. drawTime = Global.Curtime();
  54. } else
  55. if(killcount >= 5) {
  56. pic = Render.AddTexture("ot/scripts/badge_multi6.tga");
  57. Render.TexturedRect(screenSize[0]*.5,screenSize[1]*.75,100, 100, pic );
  58. drawTime = Global.Curtime();
  59. }
  60.  
  61. if(headshot == 1) {
  62. pic = Render.AddTexture("ot/scripts/badge_headshot_gold.tga");
  63. Render.TexturedRect(screenSize[0]*.5,screenSize[1]*.75,100, 100, pic );
  64. drawTime = Global.Curtime();
  65. }
  66. }
  67.  
  68. function setup() {
  69. UI.AddCheckbox("[KS] Enable Killstreaks");
  70. UI.AddSliderInt("[KS] Killstreaks Timeout", 0,15);
  71. }
  72.  
  73. function check()
  74. {
  75. if (waitingTimeout == 1)
  76. {
  77. if (Global.Curtime() - runTime > UI.GetValue("Script items", "[KS] Killstreaks Timeout"))
  78. {
  79. runTime = Global.Curtime();
  80. waitingTimeout = 0;
  81. killcount = 0;
  82. headshot = 0;
  83. }
  84. }
  85. if(waitingClear == 1)
  86. {
  87. if(Global.Curtime() - drawTime > UI.GetValue("Script items", "[KS] Killstreaks Timeout")) {
  88. drawTime = Global.Curtime();
  89. shouldDraw = 1;
  90. waitingClear = 0;
  91. headshot = 0;
  92. }
  93. }
  94.  
  95. if(waitingHeadshot == 1) {
  96. if(Global.Curtime() - headshotTime > (UI.GetValue("Script items", "[KS] Killstreaks Timeout"))) {
  97. headshot = 0;
  98. headshotTime = 0;
  99. waitingHeadshot = 0;
  100. headshotTime = Global.Curtime();
  101. }
  102. }
  103. }
  104.  
  105. Global.RegisterCallback("player_death", "onKill");
  106. Global.RegisterCallback("Draw", "check");
  107. Global.RegisterCallback("Draw", "draw");
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117. /*function drawTexture()
  118. {
  119. forumBG = Render.AddTexture("ot/scripts/badge_multi2.tga");
  120. Render.TexturedRect( 300, 300, 100, 100, forumBG );
  121. }
  122. Cheat.RegisterCallback("Draw", "drawTexture");*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement