The thing that sucks is that the sound file is pooly made. Whoever made it, really messed up on the timing, and the timing if off a bit. H.RED.ZONE is correct in saying to splice it into different parts but it's the same thing.
Code:
#include <amxmodx>
#include <zombieplague>
#define PLUGIN "ZP Countdown"
#define VERSION "1.0"
#define AUTHOR "yokomo/lambda"
#define TASK_COUNT 72941
new zp_count
public plugin_precache()
{
precache_sound("zombie_plague/count/20.wav")
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}
public event_round_start()
{
remove_task(TASK_COUNT)
zp_count = get_cvar_num("zp_delay")
zp_count -= 2
set_task(1.0, "CountDownTask", TASK_COUNT, _, _, "b")
}
public CountDownTask()
{
if (!zp_count) remove_task(TASK_COUNT)
else
{
client_cmd(0, "spk zombie_plague/count/%i", zp_count)
client_print(0, print_center, "*** Infection will start on %i ***", zp_count)
}
zp_count -= 1
}
public zp_round_started() remove_task(TASK_COUNT)
public zp_round_ended() remove_task(TASK_COUNT)
This is the best I can do. I don't think that the sound file is actually 2 seconds behind, maybe 1 second...but it's the sound file itself that is not in sync, not really the plugin. If the sounds aren't in sync in an audio file there is nothing I can do.