PHP Code:
#include <amxmodx>
#define TIME 5
#define TASKID 1337
new iTime
public plugin_init() {
register_logevent("logevent_round_start", 2, "1=Round_Start")
}
public logevent_round_start( client )
{
iTime = TIME
// every 1 sec will show the countdown & taskid = when the countdown is 0 don't show countdown again
set_task( 1.0, "countdown", TASKID, _, _, "a", TIME )
set_hudmessage(179, 0, 0, -1.0, -1.0, 2, 0.02, 1.0, 0.01, 0.1, 10)
show_hudmessage( client, "The Infected Will Start In: 5 Seconds", iTime )
}
// countdown (5 - 4 - 3 - 2 ...)
public countdown()
{
if( iTime >= 2 )
{
// iTime-- : every 1 sec decrease 1 iTime
iTime--
set_hudmessage(179, 0, 0, -1.0, -1.0, 2, 0.02, 1.0, 0.01, 0.1, 10)
show_hudmessage( 0, "The Infected Will Start In: %i Seconds", iTime )
}
}
__________________