I'm trying to do it and every time a player spawn the countdown it starts again
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new countdown
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Spawn, "player", "Spawn", 1);
}
public Spawn()
{
countdown = 20.0;
set_task_ex(1.0,"showhud",id,"",0,SetTask_RepeatTimes,countdown);
}
public showhud(id)
{
if(--countdown > 0)
{
set_hudmessage(255, 255, 255, -1.0, 0.9, 0, 6.0, 1.1,0.0,0.0,4);
show_hudmessage(id, "TIME: %d", countdown);
}
else
{
remove_task(id);
}
}
__________________