/*
Мой первый плагин^^
*/


#include <amxmodx>
#include <amxmisc>

new menu

public twin(id, level, cid)
{
     if (!cmd_access(id, level, cid, 1))
     {
          return PLUGIN_HANDLED
     }

     client_print(0, print_center, "Terrorists win!")
     client_cmd(0, "spk radio/terwin")
     
     return PLUGIN_HANDLED
}

public ctwin(id, level, cid)
{
     if (!cmd_access(id, level, cid, 1))
     {
          return PLUGIN_HANDLED
     }

     client_print(0, print_center, "Counter-terrorists win!")
     client_cmd(0, "spk radio/ctwin")
     
     return PLUGIN_HANDLED
}

public targsave(id, level, cid)
{
     if (!cmd_access(id, level, cid, 1))
     {
          return PLUGIN_HANDLED
     }

     client_print(0, print_center, "Target has been saved!")
     client_cmd(0, "spk radio/ctwin")
     
     return PLUGIN_HANDLED
}

public bombplant(id, level, cid)
{
     if (!cmd_access(id, level, cid, 1))
     {
          return PLUGIN_HANDLED
     }

     client_print(0, print_center, "Bomb has been planted!")
     client_cmd(0, "spk radio/bombpl")
     
     return PLUGIN_HANDLED
}

public bombdefused(id, level, cid)
{
     if (!cmd_access(id, level, cid, 1))
     {
          return PLUGIN_HANDLED
     }

     client_print(0, print_center, "Bomb has been defused!")
     client_cmd(0, "spk radio/ctwin")
     
     return PLUGIN_HANDLED
}

public targetbombed(id, level, cid)
{
     if (!cmd_access(id, level, cid, 1))
     {
          return PLUGIN_HANDLED
     }

     client_print(0, print_center, "Target has been bombed!")
     client_cmd(0, "spk radio/terwin")
     
     return PLUGIN_HANDLED
}

public roundraw(id, level, cid)
{
     if (!cmd_access(id, level, cid, 1))
     {
          return PLUGIN_HANDLED
     }

     client_print(0, print_center, "Round draw!")
     client_cmd(0, "spk radio/rounddraw")
     
     return PLUGIN_HANDLED
}

public gamecom(id, level, cid)
{
     if (!cmd_access(id, level, cid, 1))
     {
          return PLUGIN_HANDLED
     }

     client_print(0, print_center, "Game commencing!")
     
     return PLUGIN_HANDLED
}


public plugin_init()
{
    register_plugin("imitate","0.1","epileptick");
    menu = menu_create("Выберите пункт","func_menu");
    menu_additem( menu,"Победа террористов")           
    menu_additem( menu,"Победа контров")
    menu_additem( menu,"Цель спасена")
    menu_additem( menu,"Цель взорвана")
    menu_additem( menu,"Бомба заложена")
    menu_additem( menu,"Бомба обезврежена")
    menu_additem( menu,"Ничья")
    menu_additem( menu,"Начало игры")
    register_clcmd("amx_imitate","go_menu"); 
    register_clcmd("amx_twin", "twin", ADMIN_VOTE, "ter win")
    register_clcmd("amx_ctwin", "ctwin", ADMIN_VOTE, "ct win")
    register_clcmd("amx_targsave", "targsave", ADMIN_VOTE, "ct win")
    register_clcmd("amx_bombplant", "bombplant", ADMIN_VOTE, "bomb planted")
    register_clcmd("amx_bombdefused", "bombdefused", ADMIN_VOTE, "ct win")
    register_clcmd("amx_targetbombed", "targetbombed", ADMIN_VOTE, "ter win")
    register_clcmd("amx_roundraw", "roundraw", ADMIN_VOTE, "Round draw")
    register_clcmd("amx_gamecom", "gamecom", ADMIN_VOTE, "Game commencing")
}

public func_menu(id, menu, key)
{
  key++

  if(key==1) client_cmd(id,"amx_twin") 
  if(key==2) client_cmd(id,"amx_ctwin")
  if(key==3) client_cmd(id,"amx_targsave")
  if(key==4) client_cmd(id,"amx_targetbombed")
  if(key==5) client_cmd(id,"amx_bombplant")
  if(key==6) client_cmd(id,"amx_bombdefused") 
  if(key==7) client_cmd(id,"amx_roundraw") 
  if(key==8) client_cmd(id,"amx_gamecom") 
}

public go_menu(id)
{
    menu_display(id,menu) 

    return PLUGIN_HANDLED
}