Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <fakemeta>
  3. #include <dhudmessage>
  4. #include <zombieplague>
  5.  
  6. new const g_light_levels[][] = { "", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m","n" }
  7. new const g_countdown_sounds[][] =
  8. {
  9. "",
  10. "DyingLight/battle_begins.wav",
  11. "",
  12. "",
  13. "",
  14. "DyingLight/5secremain.wav",
  15. "",
  16. "",
  17. "",
  18. "",
  19. "DyingLight/10secremain.wav",
  20. "",
  21. "",
  22. "DyingLight/start5.wav",
  23. "",
  24. "DyingLight/prepare.wav",
  25. "",
  26. "",
  27. "",
  28. "",
  29. "DyingLight/reserve.wav",
  30. "",
  31. "",
  32. "",
  33. "", "", "", "", "", "",
  34. "DyingLight/30secremain.wav",
  35. "", "",
  36. "DyingLight/sirena.wav"
  37. }
  38.  
  39. const g_light_levels_size = sizeof g_light_levels - 1
  40. const g_countdown_sounds_size = sizeof g_countdown_sounds
  41.  
  42. new g_delay, g_seconds, g_lighting[2], cvar_effects
  43.  
  44. public plugin_init()
  45. {
  46. register_plugin("[ZPNM] Countdown Light", "1.3", "D i 5 7 i n c T")
  47. register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
  48. register_dictionary("DyingLight_countdown.txt")
  49.  
  50. cvar_effects = register_cvar("zpnm_countdown_effects", "1")
  51. }
  52.  
  53. public plugin_precache()
  54. {
  55. static i;
  56.  
  57. for (i = 0; i < g_countdown_sounds_size; i++)
  58. if (g_countdown_sounds[i][0])
  59. engfunc(EngFunc_PrecacheSound, g_countdown_sounds[i])
  60. }
  61.  
  62. public plugin_cfg()
  63. set_task(1.57, "cache_settings", 757)
  64.  
  65. public cache_settings()
  66. {
  67. g_delay = get_cvar_num("zp_delay")
  68. get_cvar_string("zp_lighting", g_lighting, 1)
  69. }
  70.  
  71. // Event Round Start
  72. public event_round_start()
  73. {
  74. if (!g_delay)
  75. return;
  76.  
  77. remove_task(57)
  78. remove_task(75)
  79. remove_task(577)
  80.  
  81. if (get_pcvar_num(cvar_effects))
  82. {
  83. g_seconds = 10
  84. ThunderClap1(75)
  85.  
  86. set_cvar_string("zp_lighting", "0")
  87. }
  88. else
  89. {
  90. g_seconds = g_delay
  91. set_task(1.0, "CountDown", 57)
  92. }
  93. }
  94.  
  95. public ThunderClap1(taskid)
  96. {
  97. if (g_seconds)
  98. {
  99. if (g_seconds % 2 == 0)
  100. engfunc(EngFunc_LightStyle, 0, "c")
  101. else
  102. engfunc(EngFunc_LightStyle, 0, "b")
  103.  
  104. g_seconds--
  105. set_task(0.1, "ThunderClap1", taskid)
  106. }
  107. else
  108. {
  109. if (g_delay > g_light_levels_size)
  110. engfunc(EngFunc_LightStyle, 0, g_light_levels[g_light_levels_size])
  111. else
  112. engfunc(EngFunc_LightStyle, 0, g_light_levels[g_delay])
  113.  
  114. g_seconds = g_delay
  115. CountDown(57)
  116. }
  117. }
  118.  
  119. public CountDown(taskid)
  120. {
  121. // Check for the external "TASK_MAKEZOMBIE" from inside ZPNM
  122. if (!task_exists(3000, 1)) //2010
  123. return;
  124.  
  125. set_dhudmessage(random_num(57, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.1000, 2, 1.1, 1.1, 0.0, 0.0)
  126. show_dhudmessage(0, "%L", LANG_PLAYER, "TALRASHA_COUNTDOWN", g_seconds)
  127.  
  128. if (get_pcvar_num(cvar_effects) && g_seconds <= g_light_levels_size)
  129. engfunc(EngFunc_LightStyle, 0, g_light_levels[g_seconds])
  130.  
  131. if (g_seconds < g_countdown_sounds_size && g_countdown_sounds[g_seconds][0])
  132. client_cmd(0, "spk %s", g_countdown_sounds[g_seconds])
  133.  
  134. g_seconds--
  135.  
  136. if (g_seconds)
  137. set_task(1.0, "CountDown", taskid)
  138. }
  139.  
  140. public ThunderClap2(taskid)
  141. {
  142. if (g_seconds)
  143. {
  144. if (g_seconds % 2 != 0)
  145. engfunc(EngFunc_LightStyle, 0, "z")
  146. else
  147. engfunc(EngFunc_LightStyle, 0, "b")
  148.  
  149. g_seconds--
  150. set_task(0.1, "ThunderClap2", taskid)
  151. }
  152. else
  153. {
  154. engfunc(EngFunc_LightStyle, 0, g_lighting)
  155. set_cvar_string("zp_lighting", g_lighting)
  156. }
  157. }
  158.  
  159. public zp_round_started(mode, id)
  160. {
  161. remove_task(57)
  162. remove_task(75)
  163. remove_task(577)
  164.  
  165. client_cmd(0, "spk %s", g_countdown_sounds[0])
  166.  
  167. if (!get_pcvar_num(cvar_effects))//|| mode == MODE_ASSASSIN)
  168. return;
  169.  
  170. g_seconds = 15
  171. ThunderClap2(577)
  172. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement