This will print each seconds and to every player how many seconds are remaining :
Code:
#include <amxmodx>
#define TASKID 87654
new seconds, rt
new roundtime
public plugin_init() {
register_plugin("remaining seconds","0.1","connor")
register_logevent("eRoundStart", 2, "1=Round_Start")
register_logevent("eRoundEnd", 2, "1=Round_End")
register_event("TextMsg", "eRestart", "a", "2&#Game_C", "2&#Game_w")
roundtime = get_cvar_pointer("mp_roundtime")
}
public eRestart() {
if(task_exists(TASKID))
remove_task(TASKID)
}
public eRoundStart() {
seconds = 0
rt = floatround(get_pcvar_float(roundtime) * 60.0) - 1
set_task(1.0, "count", TASKID, _, _, "b")
}
public count(taskid) {
seconds++
client_print(0, print_center, "%i seconds left", rt - seconds)
}
public eRoundEnd() {
remove_task(TASKID)
seconds = 0
}