Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <fakemeta>
- #include <zombieplague>
- #define PLUGIN "[ ZP ] CSO Countdown"
- #define VERSION "5.2"
- #define AUTHOR "jc980/kiryxapro"
- new zp_cso_sec, zp_cso_sec_text , zp_center_textmsg
- new zp_cso_countchant[10][] =
- {
- "zombie_plague/avenue_zombie/mod/1.wav",
- "zombie_plague/avenue_zombie/mod/2.wav",
- "zombie_plague/avenue_zombie/mod/3.wav",
- "zombie_plague/avenue_zombie/mod/4.wav",
- "zombie_plague/avenue_zombie/mod/5.wav",
- "zombie_plague/avenue_zombie/mod/6.wav",
- "zombie_plague/avenue_zombie/mod/7.wav",
- "zombie_plague/avenue_zombie/mod/8.wav",
- "zombie_plague/avenue_zombie/mod/9.wav",
- "zombie_plague/avenue_zombie/mod/10.wav"
- }
- public plugin_init()
- {
- register_plugin(PLUGIN , VERSION, AUTHOR)
- register_event("HLTV", "zp_cso_round_start", "a", "1=0", "2=0")
- zp_center_textmsg = get_user_msgid("TextMsg")
- }
- public plugin_precache()
- {
- new i
- for(i = 0; i < sizeof zp_cso_countchant; i++)
- engfunc(EngFunc_PrecacheSound, zp_cso_countchant[i])
- register_dictionary("zms_zombie_plague.txt")
- }
- public zp_cso_round_start()
- {
- set_task(2.0, "sound");
- zp_cso_sec = 15
- zp_cso_sec_text = 10
- zp_cso_countdown()
- }
- public zp_round_started(mode, id)
- {
- zp_cso_sec = 0
- zp_cso_sec_text = -1
- }
- public zp_cso_countdown()
- {
- zp_cso_sec -= 1
- if(zp_cso_sec < 10)
- {
- zp_cso_chantdown()
- }
- if(zp_cso_sec >= 1)
- {
- set_task(1.0, "zp_cso_countdown")
- set_task(10.0, "text")
- }
- }
- public text()
- {
- new texts
- texts = zp_cso_sec_text
- if(texts == -1)
- return PLUGIN_CONTINUE
- new iText[64]
- format(iText, charsmax(iText), "%L", LANG_PLAYER, "COUNTDOWN_NOTICE", zp_cso_sec_text)
- zp_clientcenter_text(0, iText)
- zp_cso_sec_text -=1
- return PLUGIN_CONTINUE
- }
- public zp_cso_chantdown()
- {
- new iChant[64], iSound
- iSound = zp_cso_sec
- if(iSound == -1)
- return PLUGIN_CONTINUE
- copy(iChant, charsmax(iChant), zp_cso_countchant[iSound])
- client_cmd(0,"speak ^"%s^"", iChant)
- return PLUGIN_CONTINUE
- }
- stock zp_clientcenter_text(id, zp_message[])
- {
- new dest
- if (id) dest = MSG_ONE
- else dest = MSG_ALL
- message_begin(dest, zp_center_textmsg, {0,0,0}, id)
- write_byte(4)
- write_string(zp_message)
- message_end()
- }
Add Comment
Please, Sign In to add comment