Well I have a problem with a menu when making a loop:
The problem is next on the menu are several results that the filter as an option of the same, the problem is to express the results on the first page is shown only option 1 and the other options are not yet not replaced by the following choice but blank:
[IMG]http://img641.**************/img641/9816/errorrhr.jpg[/IMG]
On the other hand when I move to the next option are all:
[IMG]http://img265.**************/img265/1825/errorjy.jpg[/IMG]
Basically what is wrong is that on the first page are not all the options.
PHP Code:
public show_menu_hclass(id)
{
// Player disconnected
if (!g_isconnected[id])
return;
// Bots pick their zombie class randomly
if (g_isbot[id])
{
g_humanclassnext[id] = random_num(0, g_hclass_i - 1)
return;
}
static menu[1042], len, class, buffer[32], buffer2[149], level, tipo[32]
len = 0
len += formatex(menu[len], sizeof menu - 1 - len, "\yClases %s \r[%d-%d]^n^n", g_Clases_Nombres[g_ClasesT[id]], WPN_STARTCLASS+1, min(WPN_STARTCLASS+4, g_hclass_i))
for (class = WPN_STARTCLASS; class < min(WPN_STARTCLASS+4, g_hclass_i); class++)
{
ArrayGetString(g_hclass_tipo, class, tipo, charsmax(tipo))
if ((g_ClasesT[id] == 0 && !(equal(tipo, "ZP_CLASE_MILITAR"))) || (g_ClasesT[id] == 1 && !(equal(tipo, "ZP_CLASE_ESPECIALES"))) || (g_ClasesT[id] == 2 && !(equal(tipo, "ZP_CLASE_VIP"))) || (g_ClasesT[id] == 3 && !(equal(tipo, "ZP_CLASE_STAFF"))))
break;
ArrayGetString(g_hclass_name, class, buffer, charsmax(buffer))
ArrayGetString(g_hclass_info, class, buffer2, charsmax(buffer2))
level = ArrayGetCell(g_hclass_level, class)
if (class == g_humanclassnext[id])
len += formatex(menu[len], sizeof menu - 1 - len, "\d%d. \d%s \y[\dElegida Actualmente\y]^n%s^n^n", class-WPN_STARTCLASS+1, buffer, buffer2)
else
{
if (g_level[id] < level)
len += formatex(menu[len], sizeof menu - 1 - len, "\d%d. \d%s [\rMin Lvl \w%d\d]^n%s^n^n", class-WPN_STARTCLASS+1, buffer, level, buffer2)
else
len += formatex(menu[len], sizeof menu - 1 - len, "\r%d. \w%s \d[\yLvl \w%d\d]^n\y%s^n^n", class-WPN_STARTCLASS+1, buffer, level, buffer2)
}
}
len += formatex(menu[len], sizeof menu - 1 - len, "\r7.\w Ordenar por \y[\r%s\y]^n^n", ( g_ClasesT[id] + 1 > 3 ) ? ( g_Clases_Nombres[0] ) : ( g_Clases_Nombres[( g_ClasesT[id] + 1 )] ))
len += formatex(menu[len], sizeof menu - 1 - len, "^n\r8.\w Anterior^n\r9.\w Siguente^n^n\r0.\w Salir")
show_menu(id, KEYSMENU, menu, -1, "Human Class Menu")
}
From already thank you.