I have a problem with this, works all right, but in the countdown no,show an static hud,like ( " You Will Respawn in 3 seconds" )but dont show 2 - 1,etc....i dont know which is the problem :s
Here I leave the code ...
PHP Code:
//Global
new respawntimer
new delay
#define TASK_HUD 1437
//Init
respawntimer = CreateHudSyncObj()
delay = register_cvar("amx_respawn_delay","3.0")
//Task
set_task(1.0,"CmdHud",id+TASK_HUD,_,_,"b")
//Function
public CmdHud(id) {
id -= TASK_HUD
new respawnsegs[33]
respawnsegs[id] = get_pcvar_num(delay)
if(respawnsegs[id] <= 0) {
remove_task(id+TASK_HUD)
chat_color(id,"!g%s!y Para deshabilitar tu respawn,tipea!team /respawn!y.",szPrefix)
}
else {
set_hudmessage(255, 255, 255, -1.0, 0.79, 0, 6.0, 1.0, 0.1, 0.2)
ShowSyncHudMsg(id,respawntimer,"Respawnearas en %d segundo%s",respawnsegs[id],get_pcvar_num(delay) < 2 ? "" : "s")
}
respawnsegs[id]--
}
Thanks! and sorry 4 my bad english