PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <zombieplague>
#include <dhudmessage>
#define VERSION "1.0"
new time_s
new const g_zm3_roundstart[][] = {"sound/cso/zombi_start.mp3"}
new const g_zm3_infectchant[][] = {"cso/zombi_coming_1_cn","cso/zombi_coming_2_cn"}
new const g_zm3_countchant[][] = { "cso/one.wav", "cso/two.wav", "cso/three.wav", "cso/four.wav", "cso/five.wav", "cso/six.wav", "cso/seven.wav", "cso/eight.wav", "cso/nine.wav", "cso/ten.wav" }
public plugin_init()
{
register_plugin("[CSO ZM3] - Zombie Countdown", VERSION, "jc980, JeproKs Productions Team")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}
public plugin_precache()
{
register_dictionary("csozm3_countdown.txt")
new iStart, iChant, iCount
for ( iStart = 0; iStart < sizeof g_zm3_roundstart; iStart++ )
for ( iChant = 0; iChant < sizeof g_zm3_infectchant; iChant++ )
for ( iCount = 0; iCount < sizeof g_zm3_countchant; iCount++ )
precache_sound ( g_zm3_roundstart [ iStart ] )
precache_sound ( g_zm3_infectchant [ iChant ] )
precache_sound ( g_zm3_countchant [ iCount ] )
}
public event_round_start()
{
csozm3_countdown()
time_s = 20
}
public csozm3_countdown()
{
client_cmd(0,"mp3 play %s", g_zm3_roundstart)
set_dhudmessage(0, 160, 0, -1.0, 0.25, 2, 6.0, 3.0, 0.1, 1.5)
show_dhudmessage(0, "%L", "COUNTDOWN_NOTICE",time_s);
--time_s;
if(time_s >= 1)
{
set_task(1.0, "csozm3_countdown")
}
if(time_s == 10)
{
emit_sound( 0, CHAN_VOICE, g_zm3_countchant[time_s - 1], 1.0, ATTN_NORM, 0, PITCH_NORM )
}
}
public zp_user_infected_post( id, infector, nemesis )
{
if ( !infector || nemesis )
return;
if(zp_get_user_first_zombie(id))
{
set_dhudmessage(0, 160, 0, -1.0, 0.25, 2, 6.0, 3.0, 0.1, 1.5)
show_dhudmessage(0, "%L", "FIRST_NOTICE",id)
//client_print(0,print_center,"%L", "FIRST_NOTICE",id)
emit_sound( 0, CHAN_VOICE, g_zm3_infectchant [random_num(1,2)], 1.0, ATTN_NORM, 0, PITCH_NORM )
}
else
{
set_dhudmessage(0, 160, 0, -1.0, 0.25, 2, 6.0, 3.0, 0.1, 1.5)
show_dhudmessage(0,"%L", "INFECTED_NOTICE",id,infector)
//client_print(0,print_center,"%L", "INFECTED_NOTICE",id,infector)
emit_sound( 0, CHAN_VOICE, g_zm3_infectchant [random_num(1,2)], 1.0, ATTN_NORM, 0, PITCH_NORM )
}
}