|
Veteran Member
Join Date: Sep 2019
Location: Egypt
|

07-09-2020
, 18:42
Menu Number
|
#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<0) offset = 0
new keys, curnum, menu[512], szCache1[32], szCache2[32], iCache3
for(new i=offset;i<g_iZClasses;i++)
{
ArrayGetString(g_zclass_name, i, szCache1, charsmax(szCache1))
ArrayGetString(g_zclass_info, i, szCache2, charsmax(szCache2))
iCache3 = ArrayGetCell(g_zclass_admin, i)
// 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==8 && 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<0) offset = 0
new keys, curnum, menu[512], szCache1[32], szCache2[32], iCache3
for(new i=offset;i<g_iZClasses;i++)
{
ArrayGetString(g_zclass_name, i, szCache1, charsmax(szCache1))
ArrayGetString(g_zclass_info, i, szCache2, charsmax(szCache2))
iCache3 = ArrayGetCell(g_zclass_lvl, i)
if(get_user_level(id) >= ArrayGetCell(g_zclass_lvl, i))
{
if (i == g_iZombieClass[id])
{
if(ArrayGetCell(g_zclass_lvl, i) > 0)
{
format(menu, 511,"%s^n\r[\d%d\r].\d %s \r[ \y%s\r ] \d(Level :: %d) \r-=\wSELECTED\r=-", menu, curnum+1, szCache1, szCache2, iCache3)
}
else
{
format(menu, 511, "%s^n\r[\d%d\r].\d %s \r[ \y%s\r ] \r-=\wSELECTED\r=-", menu, curnum+1, szCache1, szCache2)
}
}
else
{
if(ArrayGetCell(g_zclass_lvl, i) > 0)
{
format(menu, 511,"%s^n\r[\w%d\r].\w %s \r[ \y%s\r ] \r(\wLevel\r ::\w %d\r)", menu, curnum+1, szCache1, szCache2, iCache3)
}
else
{
format(menu, 511, "%s^n\r[\w%d\r].\w %s \r[ \y%s\r ]", menu, curnum+1, szCache1, szCache2)
}
}
}
else
{
format(menu, 511, "%s^n\r[\w%d\r].\w %s \r[ \y%s\r ] \r(\wLevel\r ::\w %d\r)", menu, curnum+1, szCache1, szCache2, iCache3)
}
// 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==8 && 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.
|
|