#include <amxmodx>

#define VERSION "0.1"

public plugin_init() {
    register_plugin("vip_odliczanie", VERSION, "BaZyLiszEk");
    
    register_clcmd("say /odlicz","MenuOdliczania");
    register_clcmd("say_team /odlicz","MenuOdliczania");
}

public MenuOdliczania(id){
    new msg0[128], msg1[128], msg2[128], msg3[128], msg4[128], msg5[128], msg6[128], msg7[128], msg8[128];
    
    format(msg0,127,"\rMenu Odliczania \y[VIP/SVIP/UVIP]");
    
    new MenuOdliczania = menu_create(msg0, "wybierz");
    
    format(msg1,127,"\w3 Sekundy");
    format(msg2,127,"\w5 Sekund");
    format(msg3,127,"\w10 Sekund");
    format(msg4,127,"\w15 Sekund");
    format(msg5,127,"\w20 Sekund");
    format(msg6,127,"\w25 Sekund");
    format(msg7,127,"\yWylacz Odliczanie");
    format(msg8,127,"\rWyjscie");
    
    menu_additem(MenuOdliczania , msg1, "1", 0);
    menu_additem(MenuOdliczania , msg2, "2", 0);
    menu_additem(MenuOdliczania , msg3, "3", 0);
    menu_additem(MenuOdliczania , msg4, "4", 0);
    menu_additem(MenuOdliczania , msg5, "5", 0);
    menu_additem(MenuOdliczania , msg6, "6", 0);    
    menu_additem(MenuOdliczania , msg7, "7", 0);
    menu_additem(MenuOdliczania, msg8, "0", 0);
    
    menu_setprop(MenuOdliczania,MPROP_EXIT,MEXIT_NEVER);
    menu_setprop(MenuOdliczania,MPROP_PERPAGE,0);   
    
    menu_display(id, MenuOdliczania, 0);
}
	
public wybierz(id, MenuOdliczania, item){
    new data[6], iName[64];
    new acces, callback;
    
    menu_item_getinfo(MenuOdliczania, item, acces, data,5, iName, 63, callback);
    
    new klawisz = str_to_num(data);
    
    switch(klawisz){
   	 case 1:{
   		 client_cmd(id, "say /time 3");
   	 }
   	 case 2:{
   		 client_cmd(id, "say /time 5");
   	 }
   	 case 3:{
   		 client_cmd(id, "say /time 10");
   	 }
   	 case 4:{
   		 client_cmd(id, "say /time 15");
   	 }
   	 case 5:{
   		 client_cmd(id, "say /time 20");
   	 }
   	 case 6:{
   		 client_cmd(id, "say /time 25");
   	 }
   	 case 7..9:{
   		 client_cmd(id, "say /stop");
   	 }
    }
    return 0;
}