Пользователи, просматривающие тему (Пользователей: 0, Гостей: 0)

  1. Frank

    Регистрация:
    11.03.15
    Сообщения:
    637
    Симпатии:
    135
    Пол:
    Мужской
    Мужики, помогите найти плагин.
    Screenshot_1.png
     
  2. Cloud

    Регистрация:
    27.02.15
    Сообщения:
    298
    Симпатии:
    73
    Пол:
    Мужской
    Код:
    #include <amxmodx>
    #include <fakemeta>
    
    new bool:ChooseTeam_Used[33];
    new bool:DetectVIPMap[33];
    
    public plugin_init()
    {
        register_plugin("Players Count in Team Menu" , "2.0" , "kramesa" );
      
        register_message(get_user_msgid("ShowMenu"), "MenuTeam");
        register_message(get_user_msgid("VGUIMenu"), "VGUITeam");
      
        register_clcmd("chooseteam", "OpenMenu");
      
        register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0");
      
        new entity = -1;
        if((engfunc(EngFunc_FindEntityByString, entity, "classname", "info_vip_start")) > 0)
        {
            DetectVIPMap[0] = true;
        }
        else
        {
            DetectVIPMap[0] = false;
        }
    }
    
    public Event_HLTV_New_Round(id)
    {
        arrayset(ChooseTeam_Used, false, sizeof(ChooseTeam_Used));
    }
    
    public client_authorized(id)
    {
        ChooseTeam_Used[id] = false;
    }
    
    public OpenMenu(id)
    {
        if(DetectVIPMap[0] == false)
        {
            menu_cancel(id);
            TeamMenu(id);
            return PLUGIN_HANDLED;
        }
        return PLUGIN_CONTINUE;
    }
    
    public MenuTeam(msg, des, rec)
    {
        if(DetectVIPMap[0] == false)
        {
            static const TeamSelect[] = "#Team_Select";
          
            static sz_Menu[sizeof(TeamSelect)];
          
            get_msg_arg_string(4, sz_Menu, charsmax(sz_Menu));
          
            if(!equal( sz_Menu, TeamSelect))
            {
                return PLUGIN_CONTINUE;
            }
          
            set_pdata_int(rec, 205, 0);
          
            TeamMenu(rec);
          
            return PLUGIN_HANDLED;
        }
        return PLUGIN_CONTINUE;
    }
    
    public VGUITeam(msg, des, rec)
    {
        if(get_msg_arg_int(1) != 2)
        {
            return PLUGIN_CONTINUE;
        }
      
        TeamMenu(rec);
      
        return PLUGIN_HANDLED;
    }
    
    public TeamMenu(id)
    { 
        if(ChooseTeam_Used[id] == true)
        {
            client_print(id, print_center, "Only 1 team change is allowed.");
            return PLUGIN_HANDLED;
        }
      
        new iPlayers[32], iNumCT , iNumT;
        get_players(iPlayers, iNumCT, "e", "CT" );
        get_players(iPlayers, iNumT, "e", "TERRORIST");
      
        new menu = menu_create("\ySelect a Team", "TeamMenu_Handler");
      
        new szTittle[124];
      
        formatex(szTittle, charsmax(szTittle), "\wTerrorist Force \r[%d]", iNumT);
        menu_additem(menu, szTittle, "1")
      
        formatex(szTittle, charsmax(szTittle), "\wCounter-Terrorist Force \r[%d]^n", iNumCT);
        menu_additem(menu, szTittle, "2")
       
        menu_additem(menu, "\wAuto-Select", "3");
        menu_additem(menu, "\wSpectator", "4");
      
        menu_setprop(menu, MPROP_EXITNAME, "Exit");
      
        menu_display(id, menu, 0);
      
        return PLUGIN_CONTINUE;
    }
    
    public TeamMenu_Handler(id, menu, item)
    {
        if(item == MENU_EXIT)
        {
            return PLUGIN_HANDLED;
        }
      
        new Name[64], Data[6], Access, Callback;
      
        menu_item_getinfo(menu, item, Access, Data, 5, Name, 63, Callback);
      
        static choose[4][2] = {"1","2","5","6"};
        engclient_cmd(id, "jointeam", choose[Data[0] - '1']);
      
        ChooseTeam_Used[id] = true;
      
        menu_destroy(menu);
        return PLUGIN_HANDLED;
    }  
     
    Frank нравится это.