Advertisement
AMGShowtime

Untitled

Nov 26th, 2021
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <csx>
  3.  
  4. #define PLUGIN "Bomb Countdown HUD Timer"
  5. #define VERSION "1.0"
  6. #define AUTHOR "x"
  7.  
  8. new g_c4timer, pointnum;
  9. new bool:b_planted = false;
  10.  
  11. new g_msgsync;
  12.  
  13.  
  14. public plugin_init()
  15. {
  16. register_plugin(PLUGIN,VERSION,AUTHOR);
  17.  
  18. pointnum = get_cvar_pointer("mp_c4timer");
  19.  
  20. register_logevent("newRound", 2, "1=Round_Start");
  21. register_logevent("endRound", 2, "1=Round_End");
  22. register_logevent("endRound", 2, "1&Restart_Round_");
  23.  
  24. g_msgsync = CreateHudSyncObj();
  25. }
  26.  
  27. public newRound()
  28. {
  29. g_c4timer = -1;
  30. remove_task(652450);
  31. b_planted = false;
  32. }
  33.  
  34. public endRound()
  35. {
  36. g_c4timer = -1;
  37. remove_task(652450);
  38. }
  39.  
  40. public bomb_planted()
  41. {
  42. b_planted = true;
  43. g_c4timer = get_pcvar_num(pointnum);
  44. dispTime()
  45. set_task(1.0, "dispTime", 652450, "", 0, "b");
  46. }
  47.  
  48. public bomb_defused()
  49. {
  50. if(b_planted)
  51. {
  52. remove_task(652450);
  53. b_planted = false;
  54. }
  55.  
  56. }
  57.  
  58. public bomb_explode()
  59. {
  60. if(b_planted)
  61. {
  62. remove_task(652450);
  63. b_planted = false;
  64. }
  65.  
  66. }
  67.  
  68. public dispTime()
  69. {
  70. if(!b_planted)
  71. {
  72. remove_task(652450);
  73. return;
  74. }
  75.  
  76.  
  77. if(g_c4timer >= 0)
  78. {
  79. if(g_c4timer > 13) set_hudmessage(0, 150, 0, -1.0, 0.80, 0, 1.0, 1.0, 0.01, 0.01, -1);
  80. else if(g_c4timer > 7) set_hudmessage(150, 150, 0, -1.0, 0.80, 0, 1.0, 1.0, 0.01, 0.01, -1);
  81. else set_hudmessage(150, 0, 0, -1.0, 0.80, 0, 1.0, 1.0, 0.01, 0.01, -1);
  82.  
  83. ShowSyncHudMsg(0, g_msgsync, "C4: %d", g_c4timer);
  84.  
  85. --g_c4timer;
  86. }
  87.  
  88. }
  89. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  90. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
  91. */
  92.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement