amx_langmenu import to other menu

Сообщения
270
Реакции
43
Помог
5 раз(а)
hello, could someone help amx_langmenu import to other menu :thank_you:

šėe.png

line 129 - 451
C++:
public Menu(id)
{
    if(!Loged[id]) { RegMenu(id); return; }
    
    new sMenu, szText[256];
    
    switch(MenuMod[id])
    {
        case -2: // Kazkas su dovanom
        {
            formatex(szText, sizeof(szText), "\r[\yCS-GO Public\r]\w -\r %L %L", LANG_PLAYER, "GIFTCH", LANG_PLAYER, "YPOINT", Points[id]);
            sMenu = menu_create(szText, "MenuHandler");
            
            new String[32], All;
            for(new i = 1; i < AllWeapon; i++)
            {
                if(uWeapon[i][id] <= 0)
                    continue;
                
                num_to_str(i, String, 31);
                formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "SKINPIECE", (bUsingGuns[id][Weapons[i]] == i) ? "\w" : "\y", szWeaponNames[Weapons[i]], WeaponNames[i], uWeapon[i][id]);
                menu_additem(sMenu, szText, String);
                All++;
            }
            
            for(new i = 1; i <= CHEST_COUNT; i++)
            {
                if(Chest[id][i] > 0)
                {
                    formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "CHESTPIECE", chest_name(i), Chest[id][i]);
                    
                    new szButton[128]; formatex(szButton, charsmax(szButton), "%d", CHEST_ID+i);
                    menu_additem(sMenu, szText, szButton);
                    All++;
                }
            }
            
            if(pKey[id] > 0)
            {
                formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "KEYPIECE", pKey[id]);
                menu_additem(sMenu, szText, KEY_ID_TEXT);
                All++;
            }
            
            if(All == 0)
            {
                MenuMod[id] = 0;
                Menu(id);
            }
        }
        case -1: // Deti i turgu
        {
            formatex(szText, sizeof(szText), "\r[\yCS-GO Public\r]\w -\r %L %L", LANG_PLAYER, "GIFTCH", LANG_PLAYER, "YPOINT", Points[id]);
            sMenu = menu_create(szText, "MenuHandler");
            
            new String[32], All;
            for(new i = 1; i < AllWeapon; i++)
            {
                if(uWeapon[i][id] <= 0)
                    continue;
                
                num_to_str(i, String, 31);
                formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "SKINPIECE", (bUsingGuns[id][Weapons[i]] == i) ? "\w" : "\y", szWeaponNames[Weapons[i]], WeaponNames[i], uWeapon[i][id]);
                menu_additem(sMenu, szText, String);
                All++;
            }
            
            for(new i = 1; i <= CHEST_COUNT; i++)
            {
                if(Chest[id][i] > 0)
                {
                    formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "CHESTPIECE", chest_name(i), Chest[id][i]);
                    
                    new szButton[128]; formatex(szButton, charsmax(szButton), "%d", CHEST_ID+i-1);
                    menu_additem(sMenu, szText, szButton);
                    
                    All++;
                }
            }
            
            if(pKey[id] > 0)
            {
                formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "KEYPIECE", pKey[id]);
                menu_additem(sMenu, szText, KEY_ID_TEXT);
                All++;
            }
            
            if(All == 0)
            {
                MenuMod[id] = 0;
                Menu(id);
            }
        }
        case 0:
        {
            formatex(szText, sizeof(szText), "\r%L %L", LANG_PLAYER, "MAIN", LANG_PLAYER, "YPOINT", Points[id]);
            sMenu = menu_create(szText, "MenuHandler");
            
            formatex(szText, sizeof(szText), "%L ^n\r------------", LANG_PLAYER, "MENUTOSKINS");
            menu_additem(sMenu, szText, "1");
            
            formatex(szText, sizeof(szText), "%L %L", LANG_PLAYER, "MENUTOCHEST", LANG_PLAYER, (!inMarket[id]) ? "BLANK" : "INMARKET");
            menu_additem(sMenu, szText, (!inMarket[id]) ? "2" : "0");
            
            formatex(szText, sizeof(szText), "%L ^n\r------------", LANG_PLAYER, "MENUCHESTINFO");
            menu_additem(sMenu, szText, "7");
            
            formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "MENUTOMARKET");
            menu_additem(sMenu, szText, "3");
            
            formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "MENUTOSHOP");
            menu_additem(sMenu, szText, "6");
            
            formatex(szText, sizeof(szText), "%L %L", LANG_PLAYER, "MENUTODUSTBIN", LANG_PLAYER, (!inMarket[id]) ? "BLANK" : "INMARKET");
            menu_additem(sMenu, szText, (!inMarket[id]) ? "4" : "0");
            
            formatex(szText, sizeof(szText), "%L %L%L", LANG_PLAYER, "MENUTOGIFT", LANG_PLAYER, (!inMarket[id]) ? "BLANK" : "INMARKET", LANG_PLAYER, "MRANG", Rangs[Rang[id]+1], Patirtis[id], NeedPatirtis[Rang[id]]);
            menu_additem(sMenu, szText, (!inMarket[id]) ? "5" : "0");
            
            formatex(szText, sizeof(szText), "%L %L^n\r------------", LANG_PLAYER, "MENUTOCONTRACTS", LANG_PLAYER, (!inMarket[id]) ? "BLANK" : "INMARKET");
            menu_additem(sMenu, szText, (!inMarket[id]) ? "9" : "0");
            
            formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "MENTUTOPARTS", LANG_PLAYER, "MRANG", Rangs[Rang[id]+1], Patirtis[id], NeedPatirtis[Rang[id]]);
            menu_additem(sMenu, szText, "11");
            
            formatex(szText, sizeof(szText), "%L %L", LANG_PLAYER, "MENUTODUSTBIN2", LANG_PLAYER, (!inMarket[id]) ? "BLANK" : "INMARKET");
            menu_additem(sMenu, szText, (!inMarket[id]) ? "13" : "0");
            
            formatex(szText, sizeof(szText), "%L\R\r%L\w^n", LANG_PLAYER, "PERSO_LANG", LANG_PLAYER, "LANG_NAME);
            menu_additem(sMenu, szText, "14");
        }
        case 1: // Skinai
        {
            formatex(szText, sizeof(szText), "\r[\yCS-GO Public\r]\w -\r %L %L", LANG_PLAYER, "MENUTOSKINS", LANG_PLAYER, "YPOINT", Points[id]);
            sMenu = menu_create(szText, "MenuHandler");
            
            new String[32], All;
            for(new i = 1; i < AllWeapon; i++)
            {
                if(uWeapon[i][id] <= 0)
                    continue;
                
                formatex(String, 31, "%d %d", i, Weapons[i]);
                formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "SKINPIECE", (bUsingGuns[id][Weapons[i]] == i) ? "\w" : "\y", szWeaponNames[Weapons[i]], WeaponNames[i], uWeapon[i][id]);
                menu_additem(sMenu, szText, String);
                
                All++;
            }
            
            if(All == 0)
            {
                MenuMod[id] = 0;
                Menu(id);
            }
        }
        case 2: // Skrynios
        {
            formatex(szText, sizeof(szText), "\r[\yCS-GO Public\r]\w - \r%L %L^n^n%L", LANG_PLAYER, "MENUTOCHESTOPEN", LANG_PLAYER, "YPOINT", Points[id], LANG_PLAYER, "KEYPIECE", pKey[id]);
            sMenu = menu_create(szText, "MenuHandler");

            new call = menu_makecallback("Call_Back");
            
            for(new i = 1; i <= CHEST_COUNT; i++)
            {
                formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "CHESTPIECE", chest_name(i), Chest[id][i]);
                menu_additem(sMenu, szText, _, _, (Chest[id][i] > 0 && pKey[id] > 0) ? -1 : call);
            }
        }
        case 3: // Turgus
        {
            aThing[id] = 0;
            
            formatex(szText, sizeof(szText), "\r[\yCS-GO Public\r]\w -\r %L %L", LANG_PLAYER, "MENUTOMARKET", LANG_PLAYER, "YPOINT", Points[id]);
            sMenu = menu_create(szText, "MenuHandler");
            new call = menu_makecallback("Call_Back");
            
            aThing[32] = 0;
            
            new String[32], All;
            new Name[32]; get_user_name(id, Name, 31);

            if(!inMarket[id])
            {
                for(new i = 1; i < AllWeapon; i++)
                {
                    if(i == WeaponinMarket[id] && uWeapon[i][id] > 0)
                    {
                        formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "MARKETPLACES", szWeaponNames[Weapons[i]], WeaponNames[i], MarketPoints[id], mAmount[id]);
                        All = 50;
                    }
                }
                // log_amx("Turgus. Rodo. %d <= %d <= %d && Chest[id][%d] > 0", CHEST_ID, WeaponinMarket[id], CHEST_ID+CHEST_COUNT, (WeaponinMarket[id]-CHEST_ID)+1);
                if(CHEST_ID <= WeaponinMarket[id] <= CHEST_ID+CHEST_COUNT && Chest[id][(WeaponinMarket[id]-CHEST_ID)+1] > 0)
                {
                    for(new i = 1; i <= CHEST_COUNT; i++)
                    {
                        // log_amx("Chest[id][%d] && %d == %d", i, (CHEST_ID+i-1), WeaponinMarket[id]);
                        if(Chest[id][i] > 0 && ((CHEST_ID+i-1) == WeaponinMarket[id]))
                        {
                            formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "MARKETPLACEC", chest_name(i), MarketPoints[id], mAmount[id]);
                            
                            All++;
                            break;
                        }
                    }
                }
                
                if(KEY_ID == WeaponinMarket[id] && pKey[id] > 0)
                {
                    formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "MARKETPLACEK", MarketPoints[id], mAmount[id]);
                    All++;
                }
                
                if(All == 0)
                    formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "MARKETPLACECH");
                
                menu_additem(sMenu, szText, "-1");
                
                if(KEY_ID == WeaponinMarket[id] && pKey[id] > 0)
                {
                    formatex(szText, sizeof(szText), "Amount: \r%d", mAmount[id]);
                    menu_additem(sMenu, szText, "-99");
                }
                else if(CHEST_ID <= WeaponinMarket[id] <= CHEST_ID+CHEST_COUNT && Chest[id][(WeaponinMarket[id]-CHEST_ID)+1] > 0)
                {
                    formatex(szText, sizeof(szText), "Amount: \r%d", mAmount[id]);
                    menu_additem(sMenu, szText, "-99");
                }
                else
                {
                    formatex(szText, sizeof(szText), "Amount: \r%d", mAmount[id]);
                    menu_additem(sMenu, szText, "-99");
                }
            }
                
            formatex(szText, sizeof(szText), "%L", LANG_PLAYER,    (!inMarket[id]) ? "TOMARKETM" : "BACKMARKET");
            menu_additem(sMenu, szText, "0", _, ((get_systime()-gLastMarketTime[id]) > MARKET_WAIT_ADD) ? -1 : call);
            
            for(new x = 1; x <= get_maxplayers(); x++)
            {
                if(!is_user_connected(x) || is_user_bot(x) || x == id)
                continue;
                
                if(inMarket[x] && MarketPoints[x] > 0)
                {
                num_to_str(x, String, 31);
                                
                if(CHEST_ID <= WeaponinMarket[x] <= CHEST_ID+CHEST_COUNT)
                {
                    // log_amx("Turgus. Rodo. (%d-%d) = %d", WeaponinMarket[x], CHEST_ID, WeaponinMarket[x]-CHEST_ID);
                    
                    new chId = (WeaponinMarket[x]-CHEST_ID)+1;
                
                    formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "SELLERC_TURGUS", chest_name((WeaponinMarket[x]-CHEST_ID)+1), MarketPoints[x], mAmount[x] > Chest[x][chId] ? Chest[x][chId] : mAmount[x], Name);
                    menu_additem(sMenu, szText, String);
                }
                else if(KEY_ID == WeaponinMarket[x])
                {
                    formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "SELLERK_TURGUS", MarketPoints[x], mAmount[x] > pKey[x] ? pKey[x] : mAmount[x], Name);
                    menu_additem(sMenu, szText, String);
                }
                else
                {
                    formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "SELLERS_TURGUS", szWeaponNames[Weapons[WeaponinMarket[x]]], WeaponNames[WeaponinMarket[x]], MarketPoints[x], mAmount[x] > WeaponinMarket[x], Name);
                    menu_additem(sMenu, szText, String);
                    }
                }
            }
        }
        case 4: // Skinų Parduotuvė
        {               
            client_cmd(id, "setSkins"); 
        }       
        case 5: // Dovanos
        {
            formatex(szText, sizeof(szText), "\r[\yCS-GO Public\r]\w -\r %L %L", LANG_PLAYER, "MENUTOGIFT", LANG_PLAYER, "YPOINT", Points[id]);
            sMenu = menu_create(szText, "MenuHandler");
            new call = menu_makecallback("Call_Back");
            
            new All, Name[126], String[32];
            get_user_name(aTarget[id], Name, 31);
            
            if(aTarget[id] > 0)
            {
                formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "GIFTT", Name);
                menu_additem(sMenu, szText, "-1");
                
                for(new i = 1; i < AllWeapon; i++)
                {
                    if(i == aThing[id] && uWeapon[i][id] > 0)
                    {
                        formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "GIFTS", szWeaponNames[Weapons[i]], WeaponNames[i]);
                        menu_additem(sMenu, szText, "-2");
                        All++;
                    }
                }
                
                if(aThing[id] <= MAX && All == 0)
                {
                    formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "GIFTCH");
                    menu_additem(sMenu, szText, "-2");
                }
                else if(aThing[id] > MAX)
                {
                    if(CHEST_ID <= aThing[id] <= CHEST_ID+CHEST_COUNT) { formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "GIFTC", chest_name((aThing[id]-CHEST_ID))); }
                    if(KEY_ID == aThing[id]) { formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "GIFTK"); }
                    
                    menu_additem(sMenu, szText, "-2");
                }
                
                if(aThing[id] > MAX)
                {
                    formatex(szText, sizeof(szText), "Amount: \r%d", aAmount[id]);
                    menu_additem(sMenu, szText, "-75");
                }
                
                formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "GIFTPOINTS", aPoints[id]);
                menu_additem(sMenu, szText, "-4");
                
                formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "SENDGIFT");
                menu_additem(sMenu, szText, "-3");
            }
            else
            {
                for(new i = 1; i <= get_maxplayers(); i++)
                {
                    if(is_user_connected(i) && !is_user_bot(i))
                    {
                        get_user_name(i, Name, 31);
                    
                        if(!Loged[i]) { format(Name, charsmax(Name), "%s \r[n.l]", Name); }
                    
                        num_to_str(i, String, 31);
                        menu_additem(sMenu, Name, String, _, (!Loged[i]) ? call : -1);
                }
            }
        }
    }
    case 6: // Parduotuvė
    {   
        formatex(szText, sizeof(szText), "\r%L %L", LANG_PLAYER, "PMAIN", LANG_PLAYER, "YPOINT", Points[id]);
        sMenu = menu_create(szText, "MenuHandler");
        
        new call = menu_makecallback("Call_Back");
        new accesNum = get_access(id);
        new Float:gPercent = ((accesNum == 3) ? 0.9 : ((accesNum == 2) ? 0.94 : (accesNum == 1) ? 0.97 : 1.0));
        
        new gPrice = floatround(1700*gPercent, floatround_floor);
        formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "SHOPKEY_1", gPrice);
        menu_additem(sMenu, szText, _, _, (Points[id] < gPrice) ? call : -1);
        
        gPrice = floatround(8000*gPercent, floatround_floor);
        formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "SHOPKEY_5", gPrice);
        menu_additem(sMenu, szText, _, _, (Points[id] < gPrice) ? call : -1);
        
        gPrice = floatround(14000*gPercent, floatround_floor);
        formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "SHOPKEY_10", gPrice);
        menu_additem(sMenu, szText, _, _, (Points[id] < gPrice) ? call : -1);
            
        gPrice = floatround(CONTRACT_COST*gPercent, floatround_floor);
        formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "SHOPCONTRACT_1", gPrice);
        menu_additem(sMenu, szText, _, _, (Points[id] < gPrice) ? call : -1);
    
        //for(new i = 1; i <= CHEST_COUNT-1; i++)
        for(new i = 1; i <= CHEST_COUNT; i++)
        {
            gPrice = floatround(CHESTS_COST*gPercent, floatround_floor);
            formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "SHOPCHEST_1", chest_name(i), gPrice);
            menu_additem(sMenu, szText, _, _, (Points[id] < gPrice) ? call : -1);
        }   
    }
    case 7: // Skrynių info
    {
        formatex(szText, sizeof(szText), "%L %L", LANG_PLAYER, "IMAIN", LANG_PLAYER, "YPOINT", Points[id]);
        sMenu = menu_create(szText, "MenuHandler");
        
        for(new i = 1; i <= CHEST_COUNT; i++)
        {
            formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "CHESTINFOPIECE", chest_name(i));
            menu_additem(sMenu, szText);
        }
    }
    case 8: // Keitimas Trade
    {       
        client_cmd(id, "setTrade"); 
    }
    case 9: // Kontraktas
    {               
        formatex(szText, sizeof(szText), "\r%L ^n\r[\yCS-GO Public\r]\w - %L %L", LANG_PLAYER, "SKINS_CONTRACTS", getContracts(id, TYPE_CONTRACT), getContracts(id, TYPE_CONTRACTS), getContracts(id, TYPE_COVERT), LANG_PLAYER, "MENUTOCONTRACTS", LANG_PLAYER, "CONTRACT", Kontraktas[id]);       
        sMenu = menu_create(szText, "MenuHandler");
        
        new All;
        
        if(Kontraktas[id] > 0)
        {
            new String[32];
            
            menu_additem(sMenu, "\rMake contract", "-1");
            menu_additem(sMenu, "\yTake skin^n\r------------", "0");
            
            for(new i = 1; i < AllWeapon; i++)
            {
                if(uWeapon[i][id] == 0)
                    continue;
                    
                num_to_str(i, String, 31);
                formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "SKINPIECE", (bUsingGuns[id][Weapons[i]] == i) ? "\w" : "\y", szWeaponNames[Weapons[i]], WeaponNames[i], uWeapon[i][id]);
                menu_additem(sMenu, szText, String);
                All++;
            }
        }           
        //if(All == 0)
        //{
            //MenuMod[id] = 0;
            //Menu(id);
        //}
    }
    case 11: // Party
    {       
        client_cmd(id, "setParty");   
    }
    case 12: // Atlygis
    {   
        client_cmd(id, "setRewards"); 
    }
    
    case 13: //Siuksliadeze
        {
            formatex(szText, sizeof(szText), "%s\r %L %L", Prefix, LANG_PLAYER, "MENUTODUSTBIN2", LANG_PLAYER, "YPOINT", Points[id]);
            sMenu = menu_create(szText, "MenuHandler");
            
            new String[32], All;
            for(new i = 1; i < AllWeapon; i++)
            {
                if(uWeapon[i][id] == 0)
                    continue;
                    
                num_to_str(i, String, 31);
                formatex(szText, sizeof(szText), "%L", LANG_PLAYER, "SKINPIECE", (bUsingGuns[id][Weapons[i]] == i) ? "\w" : "\y", WeaponNames[i], szWeaponNames[Weapons[i]], uWeapon[i][id]);
                menu_additem(sMenu, szText, String);
                All++;
            }
            
            if(All == 0)
            {
                MenuMod[id] = 0;
                Menu(id);
            }
        }
        
    case 14:
    {
        //test
    
        }
    }
    menu_display(id, sMenu);
}
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу