#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Bomb CountDown"
#define VERSION "1.0"
#define AUTHOR "peku33"
new pc,t;
public plugin_init(){
register_plugin(PLUGIN, VERSION, AUTHOR);
pc = get_cvar_pointer("mp_c4timer");
register_logevent("planted", 3, "2=Planted_The_Bomb");
register_logevent("Koniec_Rundy", 2, "1=Round_End")
}
public planted(){
t = get_pcvar_num(pc);
set_task(1.0, "bomb_tick",4738,_,_,"b");
}
public bomb_tick(){
t--;
set_hudmessage(random(255), random(255), random(255), -1.0, 0.4, 2, 1.0, 1.5, 0.1, 0.1);
show_hudmessage(0, "Do wybuchu bomby pozostalo: %d sekund", t);
if(t == 10){
client_cmd(0, "spk misc/bomba");
}
if(t <= 0){
if(task_exists(4738)) remove_task(4738);
}
}
public Koniec_Rundy(){
if(task_exists(4738)) remove_task(4738);
}
public plugin_precache(){
precache_sound("misc/bomba.wav");
}