Well, it's very strange for me... I have two menus in mi ZP
Here is the first:
PHP Code:
public show_menu_pj_cuenta(id)
{
static menu[500], len
len = 0
len += formatex(menu[len], charsmax(menu) - len, "\y-------------------------------^n\r[%s] \wVersion: \y%s^n\
\y-------------------------------^n\wCuenta: \r%s^n^n", Game, Version, User[id])
new fecha[33], ip[33]
get_time("%d/%m/%Y", fecha, 32)
get_user_ip(id, ip, 32, 1)
g_query = SQL_PrepareQuery(g_hTuple, "UPDATE `cuentas_zp` SET `UltimaFecha`='%s', `UltimaIP`='%s', `Online`='0' WHERE ( `Usuario`='%s' )", fecha, ip, User[id])
SQL_Execute(g_query)
for(new i; i < 5; i++)
{
if(!equal(g_pj[id][i], ""))
{
if(i == 4)
len += formatex(menu[len], charsmax(menu) - len, "\r%d. \wPersonaje: \y%s^n^n", i+1, g_pj[id][i])
else
len += formatex(menu[len], charsmax(menu) - len, "\r%d. \wPersonaje: \y%s^n", i+1, g_pj[id][i])
}
else
{
if(i == 4)
len += formatex(menu[len], charsmax(menu) - len, "\r%d. \wCrear personaje \r(Slot %d)^n^n", i+1, i+1)
else
len += formatex(menu[len], charsmax(menu) - len, "\r%d. \wCrear personaje \r(Slot %d)^n", i+1, i+1)
}
}
len += formatex(menu[len], charsmax(menu) - len, "\r6. \yCambiar password^n")
escape_sql(g_playername[id], 31)
g_query = SQL_PrepareQuery(g_hTuple, "SELECT `Autologin` FROM `cuentas_zp` WHERE `Usuario`='%s'", User[id])
if (SQL_Execute(g_query))
{
if (SQL_NumResults(g_query))
AutoLogin[id] = SQL_ReadResult(g_query, 0)
}
len += formatex(menu[len], charsmax(menu) - len, "\r7. \w%s autologin", AutoLogin[id] ? "Desactivar" : "Activar")
show_menu(id, KEYSMENU, menu, -1, "Pj cuenta")
}
This menu shows to the client their owns characters in their account... if the character slot is empty you could create a new one.
The thing is when you try to create in slots 3 o 4 the handler is not called, the menu refresh but nothing happens, i try with new style menues and its the same error, not error logs in console.
And here is the second menu:
PHP Code:
public show_menu_crear_pj(id)
{
static menu[500], len
len = 0
len += formatex(menu[len], charsmax(menu) - len, "\y-------------------------------^n\r[%s] \wVersion: \y%s^n\
\y-------------------------------^n^n\w¿Como deseas ponerle nombre a tu personaje?^n^n", Game, Version)
len += formatex(menu[len], charsmax(menu) - len, "\r1. \wNombre actual: \y%s^n", g_playername[id])
len += formatex(menu[len], charsmax(menu) - len, "\r2. \wEscribir manualmente^n^n")
len += formatex(menu[len], charsmax(menu) - len, "\r0. \wMenu anterior")
show_menu(id, KEYSMENU, menu, -1, "Crear pj")
}
public menu_crear_pj(id, key)
{
switch (key)
{
case 0:
{
escape_sql(g_playername[id], 31)
g_query = SQL_PrepareQuery(g_hTuple, "SELECT `Nombre` FROM `pjs_zp` WHERE `Nombre`='%s'", g_playername[id])
if (SQL_Execute(g_query))
{
if (!SQL_NumResults(g_query))
{
g_query = SQL_PrepareQuery(g_hTuple, "INSERT INTO `pjs_zp` (`Nombre`) VALUES ('%s')", g_playername[id])
SQL_Execute(g_query)
g_query = SQL_PrepareQuery(g_hTuple, "UPDATE `cuentas_zp` SET `Pj%d`='%s' WHERE `Usuario`='%s'", (g_pj_num[id] + 1), g_playername[id] ,User[id])
SQL_Execute(g_query)
client_print(id, print_center, "Personaje creado correctamente!")
client_cmd(id, "spk buttons/button9.wav")
copy(g_pj_actual[id], 31, g_playername[id])
MenuPersonaje(id)
}
else
{
client_print(id, print_center, "Nombre en uso. Sali, cambialo y crea tu pj nuevamente")
client_cmd(id, "spk buttons/button10.wav")
show_menu_pj_cuenta(id)
}
}
}
case 1:
{
ChatColor(id, "!g[ZP] !yFuncion deshabilitada")
client_cmd(id, "spk buttons/button10.wav")
show_menu_pj_cuenta(id)
}
case 9: return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
When you create a character by the other menu this menu is called... You have two options to set a character name but thats not important, i have problems with the fisrt option... the handler is not called, i put debug messages in the handler and nothing... y also tried with old style menues... nothing happend.
Thank you for your time.
__________________