Raised This Month: $ Target: $400
 0% 

Handlers not called or called wrong :/


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 08-02-2011 , 17:43   Handlers not called or called wrong :/
Reply With Quote #1

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"
GameVersionUser[id])
    
    new 
fecha[33], ip[33]
    
get_time("%d/%m/%Y"fecha32)
    
get_user_ip(idip321)
    
    
g_query SQL_PrepareQuery(g_hTuple"UPDATE `cuentas_zp` SET `UltimaFecha`='%s', `UltimaIP`='%s', `Online`='0' WHERE ( `Usuario`='%s' )"fechaipUser[id])
    
SQL_Execute(g_query)
    
    for(new 
i5i++)
    {
        if(!
equal(g_pj[id][i], ""))
        {
            if(
== 4)
                
len += formatex(menu[len], charsmax(menu) - len"\r%d. \wPersonaje: \y%s^n^n"i+1g_pj[id][i])
            else
                
len += formatex(menu[len], charsmax(menu) - len"\r%d. \wPersonaje: \y%s^n"i+1g_pj[id][i])
        }
        else
        {
            if(
== 4)
                
len += formatex(menu[len], charsmax(menu) - len"\r%d. \wCrear personaje \r(Slot %d)^n^n"i+1i+1)
            else
                
len += formatex(menu[len], charsmax(menu) - len"\r%d. \wCrear personaje \r(Slot %d)^n"i+1i+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_query0)
    }
            
    
len += formatex(menu[len], charsmax(menu) - len"\r7. \w%s autologin"AutoLogin[id] ? "Desactivar" "Activar")
    
show_menu(idKEYSMENUmenu, -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"
GameVersion)
    
    
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(idKEYSMENUmenu, -1"Crear pj")
}

public 
menu_crear_pj(idkey)
{
    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(idprint_center"Personaje creado correctamente!")
                    
client_cmd(id"spk buttons/button9.wav")
                    
copy(g_pj_actual[id], 31g_playername[id])
                    
MenuPersonaje(id)
                }
                
                else
                {
                    
client_print(idprint_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.
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
 


Thread Tools
Display Modes

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 03:19.


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