Here it is, also you can change the countdown number by changing the cvar "countdown_time"
PHP Code:
#include <amxmodx>
#include <amxmisc>
new cvar_countdown, g_countdown, g_countdown_hud;
enum (+= 100)
{
TASK_COUNTDOWN
}
public plugin_init()
{
register_plugin("Countdown each round", "1.0", "Drakunovu");
register_event("HLTV", "start_countdown", "a", "1=0", "2=0");
cvar_countdown = register_cvar("countdown_time", "13");
g_countdown_hud = CreateHudSyncObj();
}
public start_countdown()
{
remove_task(TASK_COUNTDOWN);
g_countdown = get_pcvar_num(cvar_countdown);
set_task(1.0, "countdown", TASK_COUNTDOWN, _, _, "b");
}
public countdown()
{
set_hudmessage(0, 255, 0, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10);
ShowSyncHudMsg(0, g_countdown_hud, "The round will start in %d", g_countdown);
new number[20];
num_to_word(g_countdown, number, charsmax(number));
client_cmd(0, "spk ^"fvox/%s^"", number); // you can change the sound right here.
g_countdown--;
if (g_countdown < 0)
{
remove_task(TASK_COUNTDOWN);
// here your code to happen after the countdown is over.
return;
}
}