/**
Благодароность bizon за remove_task
**/
#include <amxmodx>
#include <reapi>
#define TASK_ID 16528
public plugin_init()
{
register_plugin("HUD Timeleft", "1.0.1", "BiZaJe")
RegisterHookChain(RG_CBasePlayer_Spawn, "HC_CBasePlayer_Spawn", .post = true);
RegisterHookChain(RG_CBasePlayer_Killed, "HC_CBasePlayer_Killed_Post", .post = true)
}
public client_disconnected(iPlayer){
remove_task(iPlayer + TASK_ID);
}
public HC_CBasePlayer_Spawn(const this){
remove_task(this + TASK_ID);
}
public HC_CBasePlayer_Killed_Post(const this, pevAttacker, iGib){
set_task(1.0, "Hud_Timeleft", this + TASK_ID, .flags="b");
}
public Hud_Timeleft(taskID) {
new id = taskID - TASK_ID;
new iTimeLeft = get_timeleft();
set_hudmessage(0, 170, 255, -1.0, 0.8, 0, 6.0, 5.0, 0.08, 5.0);
show_hudmessage(id, "До конца карты: %d:%02d", (iTimeLeft / 60), (iTimeLeft % 60));
}