Raised This Month: $ Target: $400
 0% 

Solved Menu Number


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 17:13.


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