Made it better for you.. and more efficient, if you're interested.
PHP Code:
#include < amxmodx >
#include < zombieplague >
#define PLUGIN "[ZP] Extra Addon: Countdown with HUD (fixed)"
#define VERSION "1.0"
#define AUTHOR "FOX & kapitana"
#define TASKID_COUNTDOWN 123456
#define START_SPEAKING 10
new cvarInfCountdown;
new Timer;
public plugin_init()
{
register_plugin( PLUGIN, VERSION, AUTHOR );
register_event( "HLTV", "evRoundStart", "a", "1=0", "2=0" );
cvarInfCountdown = register_cvar( "zp_inf_countdown", "1" );
}
public evRoundStart()
{
if ( task_exists( TASKID_COUNTDOWN ) )
remove_task( TASKID_COUNTDOWN );
Timer = 30;
set_task( 5.0, "cmdCountdown", TASKID_COUNTDOWN );
}
public cmdCountdown()
{
if ( !get_pcvar_num( cvarInfCountdown ) )
return 1;
if ( Timer < 1 )
{
// End of countdown
return 1;
}
if ( Timer > 0 )
{
if ( Timer <= START_SPEAKING )
{
static szVox[ 32 ];
num_to_word( Timer, szVox, charsmax( szVox ) );
client_cmd( 0, "spk ^"vox/%s second%s^"", szVox, (Timer > 1) ? "s" : "" );
}
set_hudmessage( random(256), random(256), random(256), -1.0, 0.28, 0, 1.0, 1.0 );
show_hudmessage( 0, "/=====================\^n GREEN Zombie^n Infection In %i^n \=====================/", Timer );
Timer--;
}
return 1;
}
__________________