Guest User

Untitled

a guest
Nov 17th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <fakemeta>
  4. #include <zombieplague>
  5.  
  6. #define PLUGIN "[ ZP ] CSO Countdown"
  7. #define VERSION "5.2"
  8. #define AUTHOR "jc980/kiryxapro"
  9.  
  10. new zp_cso_sec, zp_cso_sec_text , zp_center_textmsg
  11.  
  12.  
  13. new zp_cso_countchant[10][] =
  14. {
  15. "zombie_plague/avenue_zombie/mod/1.wav",
  16. "zombie_plague/avenue_zombie/mod/2.wav",
  17. "zombie_plague/avenue_zombie/mod/3.wav",
  18. "zombie_plague/avenue_zombie/mod/4.wav",
  19. "zombie_plague/avenue_zombie/mod/5.wav",
  20. "zombie_plague/avenue_zombie/mod/6.wav",
  21. "zombie_plague/avenue_zombie/mod/7.wav",
  22. "zombie_plague/avenue_zombie/mod/8.wav",
  23. "zombie_plague/avenue_zombie/mod/9.wav",
  24. "zombie_plague/avenue_zombie/mod/10.wav"
  25. }
  26.  
  27. public plugin_init()
  28. {
  29. register_plugin(PLUGIN , VERSION, AUTHOR)
  30. register_event("HLTV", "zp_cso_round_start", "a", "1=0", "2=0")
  31. zp_center_textmsg = get_user_msgid("TextMsg")
  32. }
  33.  
  34. public plugin_precache()
  35. {
  36. new i
  37.  
  38. for(i = 0; i < sizeof zp_cso_countchant; i++)
  39. engfunc(EngFunc_PrecacheSound, zp_cso_countchant[i])
  40.  
  41. register_dictionary("zms_zombie_plague.txt")
  42. }
  43.  
  44. public zp_cso_round_start()
  45. {
  46. set_task(2.0, "sound");
  47.  
  48. zp_cso_sec = 15
  49.  
  50. zp_cso_sec_text = 10
  51.  
  52. zp_cso_countdown()
  53. }
  54.  
  55. public zp_round_started(mode, id)
  56. {
  57. zp_cso_sec = 0
  58. zp_cso_sec_text = -1
  59. }
  60.  
  61.  
  62. public zp_cso_countdown()
  63. {
  64. zp_cso_sec -= 1
  65.  
  66. if(zp_cso_sec < 10)
  67. {
  68. zp_cso_chantdown()
  69. }
  70.  
  71. if(zp_cso_sec >= 1)
  72. {
  73. set_task(1.0, "zp_cso_countdown")
  74. set_task(10.0, "text")
  75. }
  76. }
  77.  
  78. public text()
  79. {
  80. new texts
  81.  
  82. texts = zp_cso_sec_text
  83.  
  84. if(texts == -1)
  85. return PLUGIN_CONTINUE
  86.  
  87. new iText[64]
  88.  
  89. format(iText, charsmax(iText), "%L", LANG_PLAYER, "COUNTDOWN_NOTICE", zp_cso_sec_text)
  90. zp_clientcenter_text(0, iText)
  91.  
  92. zp_cso_sec_text -=1
  93.  
  94. return PLUGIN_CONTINUE
  95. }
  96.  
  97. public zp_cso_chantdown()
  98. {
  99. new iChant[64], iSound
  100.  
  101. iSound = zp_cso_sec
  102.  
  103. if(iSound == -1)
  104. return PLUGIN_CONTINUE
  105.  
  106. copy(iChant, charsmax(iChant), zp_cso_countchant[iSound])
  107. client_cmd(0,"speak ^"%s^"", iChant)
  108. return PLUGIN_CONTINUE
  109. }
  110.  
  111. stock zp_clientcenter_text(id, zp_message[])
  112. {
  113. new dest
  114. if (id) dest = MSG_ONE
  115. else dest = MSG_ALL
  116.  
  117. message_begin(dest, zp_center_textmsg, {0,0,0}, id)
  118. write_byte(4)
  119. write_string(zp_message)
  120. message_end()
  121. }
Add Comment
Please, Sign In to add comment