Raised This Month: $32 Target: $400
 8% 

Solved Menu Number


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 07-09-2020 , 18:42   Menu Number
Reply With Quote #1

Hello guys,
I was editing zombie classess of basebuilder mod and i was want to change admin access to level access and i did it but i have something wrong, When i checked it the menu didn't show all classes and i said the problem in number of the menu and i changed it from menu[512] to menu[2048] but i still have the same problem so can someone tell me how to fix that or where is the problem Oo

The problem


Orginal menu with admin access
PHP Code:
public show_zclass_menu(id,offset)
{
    if(
offset<0offset 0

    
new keyscurnummenu[512], szCache1[32], szCache2[32], iCache3
    
for(new i=offset;i<g_iZClasses;i++)
    {
        
ArrayGetString(g_zclass_nameiszCache1charsmax(szCache1))
        
ArrayGetString(g_zclass_infoiszCache2charsmax(szCache2))
        
iCache3 ArrayGetCell(g_zclass_admini)
        
        
// Add to menu
        
if (== g_iZombieClass[id])
            
format(menu,511,"%s^n\r[\d%d\r].\d %s \r[ \y%s\r ] \r-=\wSELECTED\r=-"menucurnum+1szCache1szCache2iCache3 == ADMIN_ALL  "" :"" )
        else
            
format(menu,511,"%s^n\r[\w%d\r].\w %s \r[ \y%s\r ]"menucurnum+1szCache1szCache2iCache3 == ADMIN_ALL "" "" )
        
        
g_iMenuOptions[id][curnum] = i
        keys 
+= (1<<curnum)
    
        
curnum++
        
        if(
curnum==8)
            break;
    }

    
format(menu,511,"\ySelect Your Class:^n\r%s^n"menu)
    if(
curnum==&& offset<12)
    {
        
keys += (1<<8)
        
format(menu,511,"%s^n\r[\w9\r].\w Next",menu)
    }
    if(
offset)
    {
        
keys += (1<<9)
        
format(menu,511,"%s^n\r[\w0\r].\w Back",menu)
    }

    
show_menu(id,keys,menu,-1,"ZClassSelect")

What i did with level access
PHP Code:
public show_zclass_menu(id,offset)
{
    if(
offset<0offset 0

    
new keyscurnummenu[512], szCache1[32], szCache2[32], iCache3
    
for(new i=offset;i<g_iZClasses;i++)
    {
        
ArrayGetString(g_zclass_nameiszCache1charsmax(szCache1))
        
ArrayGetString(g_zclass_infoiszCache2charsmax(szCache2))
        
iCache3 ArrayGetCell(g_zclass_lvli)
        
        if(
get_user_level(id) >= ArrayGetCell(g_zclass_lvli))
        {
            if (
== g_iZombieClass[id])
            {
                if(
ArrayGetCell(g_zclass_lvli) > 0)
                {
                    
format(menu511,"%s^n\r[\d%d\r].\d %s \r[ \y%s\r ] \d(Level :: %d) \r-=\wSELECTED\r=-"menucurnum+1szCache1szCache2iCache3)
                }
                else
                {
                    
format(menu511"%s^n\r[\d%d\r].\d %s \r[ \y%s\r ] \r-=\wSELECTED\r=-"menucurnum+1szCache1szCache2)
                }
            }
            else
            {
                if(
ArrayGetCell(g_zclass_lvli) > 0)
                {
                    
format(menu511,"%s^n\r[\w%d\r].\w %s \r[ \y%s\r ] \r(\wLevel\r ::\w %d\r)"menucurnum+1szCache1szCache2iCache3)
                }
                else
                {
                    
format(menu511"%s^n\r[\w%d\r].\w %s \r[ \y%s\r ]"menucurnum+1szCache1szCache2)
                }
            }
        }
        else
        {
            
format(menu511"%s^n\r[\w%d\r].\w %s \r[ \y%s\r ] \r(\wLevel\r ::\w %d\r)"menucurnum+1szCache1szCache2iCache3)
        }
        
// Add to menu
        //if (i == g_iZombieClass[id])
        //    format(menu,511,"%s^n\r[\d%d\r].\d %s \r[ \y%s\r ] \r-=\wSELECTED\r=-", menu, curnum+1, szCache1, szCache2, iCache3 == ADMIN_ALL  ? "" :"" )
        //else
        //    format(menu,511,"%s^n\r[\w%d\r].\w %s \r[ \y%s\r ]", menu, curnum+1, szCache1, szCache2, iCache3 == ADMIN_ALL ? "" : "" )
        
        
g_iMenuOptions[id][curnum] = i
        keys 
+= (1<<curnum)
    
        
curnum++
        
        if(
curnum==8)
            break;
    }

    
format(menu,511,"\ySelect Your Class:^n\r%s^n"menu)
    if(
curnum==&& offset<12)
    {
        
keys += (1<<8)
        
format(menu,511,"%s^n\r[\w9\r].\w Next",menu)
    }
    if(
offset)
    {
        
keys += (1<<9)
        
format(menu,511,"%s^n\r[\w0\r].\w Back",menu)
    }

    
show_menu(id,keys,menu,-1,"ZClassSelect")


Last edited by Supremache; 07-11-2020 at 17:07.
Supremache is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-09-2020 , 18:58   Re: Menu Number
Reply With Quote #2

The maximum amount of character that a menu can display is 512. You cannot go above this limit. Color symbols are counted too and you have a lot of them.

From amxconst.inc:

Code:
#define MAX_MENU_LENGTH 512

And no, changing this value in amxconst.inc won't allow you to exceed it. This is hardcoded in the game itself.
__________________

Last edited by OciXCrom; 07-09-2020 at 19:00.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 07-09-2020 , 20:00   Re: Menu Number
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
The maximum amount of character that a menu can display is 512. You cannot go above this limit. Color symbols are counted too and you have a lot of them.

From amxconst.inc:

Code:
#define MAX_MENU_LENGTH 512

And no, changing this value in amxconst.inc won't allow you to exceed it. This is hardcoded in the game itself.
So i can't fix it ? or i need to change the full menu?
Supremache is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-09-2020 , 20:22   Re: Menu Number
Reply With Quote #4

Reduce the number of characters you have in the menu. You can start by removing the ' in the square brackets because that's not how English works.
__________________

Last edited by OciXCrom; 07-10-2020 at 06:20.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-10-2020 , 05:01   Re: Menu Number
Reply With Quote #5

Remove keyword zombie and free from The menu
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 07-10-2020 , 07:54   Re: Menu Number
Reply With Quote #6

@OciXcrom - I did it before in zombie plague mod and worked perfectly without anyproblem , i think the problem in something in that menu

@Natsheh - Can you give me example

Last edited by Supremache; 07-10-2020 at 10:42.
Supremache is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 07-10-2020 , 10:39   Re: Menu Number
Reply With Quote #7

I changed it from 512 to 2048 and keys from 511 to 2047 and i still have the same thing
PHP Code:
public show_zclass_menu(id,offset)
{
    if(
offset<0offset 0

    
new keyscurnummenu[2048], szCache1[32], szCache2[32], iCache3
    
for(new i=offset;i<g_iZClasses;i++)
    {
        
ArrayGetString(g_zclass_nameiszCache1charsmax(szCache1))
        
ArrayGetString(g_zclass_infoiszCache2charsmax(szCache2))
        
iCache3 ArrayGetCell(g_zclass_lvli)
        
        
// Add to menu
        
if (== g_iZombieClass[id])
            
format(menu,2047,"%s^n\r[\d%d\r].\d %s \r[ \y%s\r ] \d(Level :: %d) \r-=\wSELECTED\r=-"menucurnum+1szCache1szCache2iCache3)
        else
            
format(menu,2047,"%s^n\r[\w%d\r].\w %s \r[ \y%s\r ] \r(\wLevel\r ::\w %d\r)"menucurnum+1szCache1szCache2iCache3)
        
        
g_iMenuOptions[id][curnum] = i
        keys 
+= (1<<curnum)
    
        
curnum++
        
        if(
curnum==8)
            break;
    }

    
format(menu,2047,"\ySelect Your Class:^n\r%s^n"menu)
    if(
curnum==&& offset<12)
    {
        
keys += (1<<8)
        
format(menu,2047,"%s^n\r[\w9\r].\w Next",menu)
    }
    if(
offset)
    {
        
keys += (1<<9)
        
format(menu,2047,"%s^n\r[\w0\r].\w Back",menu)
    }

    
show_menu(id,keys,menu,-1,"ZClassSelect")

Supremache is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 07-10-2020 , 10:49   Re: Menu Number
Reply With Quote #8

Quote:
Originally Posted by Supremache View Post
@OciXcrom - I don't understand, do you mean I should change the number of words menu, If you mean that so I did it before and I changed the number from 512 to 2048 and i have got the same thing

@Natsheh - Can you give me example
As in reduce the amount of letters you have. The engine has a limit to the amount of characters you can use.
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 07-10-2020 , 11:06   Re: Menu Number
Reply With Quote #9

Quote:
Originally Posted by DruGzOG View Post
As in reduce the amount of letters you have. The engine has a limit to the amount of characters you can use.
When i was using admin access it was working without showing this problem and after i added level access i got this problem, i think the problem not in the amount of letters


Last edited by Supremache; 07-10-2020 at 11:10.
Supremache is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 07-10-2020 , 15:02   Re: Menu Number
Reply With Quote #10

There's no one know how to fix it !!!! ?

Last edited by Supremache; 07-10-2020 at 15:03.
Supremache is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:00.


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