here is an example!!
PHP Code:
new Float:task_length;
public plugin_init()
{
play_task();
register_clcmd("say tasktimeleft", "show_task_timeleft");
}
play_task()
{
task_length = 60 * 5.0 // 5 minutes
set_task(task_length , "task_end", 500);
task_length += get_gametime();
}
public task_end(taskid) { }
public show_task_timeleft(id)
{
if(task_exists(500))
{
client_print(id, print_chat, "Task time left: %d second", floatround((task_length - get_gametime())))
return 1;
}
client_print(id, print_chat, "Task(500) was ended %d second ago!", floatround((get_gametime() - task_length)))
return 1;
}
__________________