AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Generation of the old menu (https://forums.alliedmods.net/showthread.php?t=252991)

Nixon133 12-13-2014 05:19

Generation of the old menu
 
Hello.
Immediately apologize for the English language.
The question seems clear and understandable. How to make through the old menu, two pages?

Code of players do not need a menu, then the problem lies elsewhere.
When you create a menu of the players in the loop, only one line formatex (possibly with conditions)

Code:

        for(new i = iStart; i < iEnd; i++)        {
                iPlayer = g_iMenuPlayers[i];
                get_user_name(iPlayer, szName, charsmax(szName));
               
                if(iPlayer == id) iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "");
                else {
                        iKeysMenu |= (1 << iCount);
                        iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "");
                }
        }

Here we see that in the loop body is executed only one formatex (one of the two conditions).
But, in my case in the loop may be more than 9 formatex.

Code:

        for(new i = iStart; i < iEnd; i++)        {
                iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "");
                iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "");
                iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "");
                iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "");
        }

Here cat, it's for example. We see that in the loop 4 formatex.

Now the problem itself, because 4 formatex , then the cycle must be performed 4 times !? However, since in the loop formatex 4 and 4 times a loop is executed, then 4x4 = 16 formatex and the menu will not be 4 points and 16.

This is the whole problem of how to make the cycle more than 9 formatex , you need to like the menu with the players was 9 ago, 0 - forward \ output.

HamletEagle 12-13-2014 06:35

Re: Generation of the old menu
 
Why don't you simple use new menu style ?

Nixon133 12-13-2014 06:47

Re: Generation of the old menu
 
No) I need the old style menu.


All times are GMT -4. The time now is 15:23.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.