PHP Code:
#include <amxmodx>
#include <csx>
#pragma semicolon 1
new g_hMessageSync;
new g_iC4Timer;
public plugin_init()
{
register_plugin("Bcd Hudtimer", "1.0", "claudiuhks");
register_event("HLTV", "Event_RoundStart", "a", "1=0", "2=0");
g_hMessageSync = CreateHudSyncObj();
}
public Event_RoundStart()
remove_task(652452);
public bomb_planted()
{
g_iC4Timer = get_cvar_num("mp_c4timer") - 1;
set_task(1.0, "Func_DisplayTime", 652452, _, _, "a", g_iC4Timer);
}
public bomb_defused()
remove_task(652452);
public bomb_explode()
remove_task(652452);
public Func_DisplayTime()
{
switch(g_iC4Timer)
{
case 40:
{
client_cmd(0, "speak ^"vox/forty seconds until explosion^"");
set_hudmessage(221, 221, 221, -1.0, 0.25, 0, 1.0, 3.0, 0.01, 0.01, -1);
ShowSyncHudMsg(0, g_hMessageSync, "40 seconds until explosion!");
}
case 30:
{
client_cmd(0, "speak ^"vox/thirty seconds until explosion^"");
set_hudmessage(221, 221, 221, -1.0, 0.25, 0, 1.0, 3.0, 0.01, 0.01, -1);
ShowSyncHudMsg(0, g_hMessageSync, "30 seconds until explosion!");
}
case 20:
{
client_cmd(0, "speak ^"vox/twenty seconds until explosion^"");
set_hudmessage(221, 221, 221, -1.0, 0.25, 0, 1.0, 3.0, 0.01, 0.01, -1);
ShowSyncHudMsg(0, g_hMessageSync, "20 seconds until explosion!");
}
}
if( g_iC4Timer < 11)
{
static numword[25];
num_to_word( g_iC4Timer, numword, charsmax(numword));
client_cmd(0, "speak ^"vox/%s^"", numword);
set_hudmessage(221, 221, 221, -1.0, 0.80, 0, 1.0, 1.0, 0.01, 0.01, -1);
ShowSyncHudMsg(0, g_hMessageSync, "%i", g_iC4Timer);
}
g_iC4Timer--;
}