AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   new style menu problem (https://forums.alliedmods.net/showthread.php?t=207892)

Roccoxx 02-07-2013 22:17

new style menu problem
 
hi, sorry for my english, i have a problem with new style menu, I do not like the old menu(sucks), I would like to put six options per page(with back, next and exit options) in the new menu system, but I fail.

PHP Code:

public show_menu_armasrr(id)
{
    
    if (!
g_isalive[id]) return PLUGIN_HANDLED
    
    
if (g_zombie[id] || g_survivor[id]) return PLUGIN_HANDLED
     
    
new len[999] , temp[52
    new 
menu_armasrr menu_create("\w[\rA\w]rmas Primarias" "handler_primarias"
    
    if(
recordo[id])
    {
    for(new 
i3i++){
        if(
g_recordar_armas[id][i] > 0)
        { 
            
handler_primarias(id menu_armasrr g_recordar_armas[id][0])
            
handler_pistolas(id menu_armasrr g_recordar_armas[id][1])
            
mh_yo(id menu_armasrr g_recordar_armas[id][2])
            
handler_cuchis(id menu_armasrr g_recordar_armas[id][3])
            return 
PLUGIN_HANDLED 
        
}
    }
    } 
    
    for(new 
min(6sizeof g_misarmas) ; i++) 
    { 
        if(
g_level[id] >= g_misarmas[i][item_level] && g_mejoras_armas[id][2] >= g_misarmas[i][item_puntos]) 
            
formatex(len charsmax(len) , "\w%s \r[Disponible]" g_misarmas[i][item_name_v2]) 
        else 
            
formatex(len charsmax(len) , "\d%s \r[Nivel Requerido : %d]\r[Bloqueado]" g_misarmas[i][item_name_v2] , g_misarmas[i][item_level]) 

        
num_to_str(i,temp51
        
menu_additem(menu_armasrr len temp)
    }
    
    if(
recordo[id]) formatex(len charsmax(len) , "Recordar Seleccion: Habilitado")
    else 
formatex(len charsmax(len) , "Recordar Seleccion: Desabilitado")   
    
menu_additem(menu_armasrrlen"7"0)
    
    
menu_setprop(menu_armasrr MPROP_BACKNAME,"Atras")  
    
menu_setprop(menu_armasrr MPROP_NEXTNAME,"Siguiente"
    
menu_setprop(menu_armasrr MPROP_EXITNAME,"Salir"
    
menu_display(idmenu_armasrr
     
    return 
PLUGIN_HANDLED
}

public 
handler_primarias(id menu_armasrs item

    if(
item == MENU_EXIT || !g_isalive[id] || g_zombie[id] || g_survivor[id] || g_nemesis[id])     
    { 
        
menu_destroy(menu_armasrs
        return 
PLUGIN_HANDLED 
    

    
    if(
item == 7){
            if(
recordo[id]) recordo[id] = true
            
else recordo[id] = false
    
}
    
    if(
g_level[id] >= g_misarmas[item][item_level] && g_mejoras_armas[id][2] >= g_misarmas[item][item_puntos])
    { 
        
drop_weapons(id 1)
        
g_arma_prim[id] = item
        g_recordar_armas
[id][0] = item
        fm_give_item
(id g_misarmas[item][item_csname])
        
ExecuteHamB(Ham_GiveAmmoidMAXBPAMMO[g_misarmas[item][item_id]], AMMOTYPE[g_misarmas[item][item_id]], MAXBPAMMO[g_misarmas[item][item_id]]) 
        
g_canbuy[id] = false
    
        show_menu_pistolas
(id)
    } 
    else 
    { 
        
zp_colored_print(id "^x04%s ^x01Necesitas Ser Nivel %d Para Comprar Esta Arma o no la desbloqueaste." g_tipopr g_misarmas[item][item_level]) 
        
show_menu_armasrr(id)
        return 
PLUGIN_HANDLED 
    

    
    return 
PLUGIN_HANDLED 


Thanks for read this

Blizzard_87 02-07-2013 23:05

Re: new style menu problem
 
1. ENGLISH PLZ!!!!
2. where rest of code.... needfull code to know what the other variables do.

fysiks 02-08-2013 00:23

Re: new style menu problem
 
MPROP_PERPAGE, newmenus.inc

Unkolix 02-08-2013 02:50

Re: new style menu problem
 
I have a problem too. I don't know how to check if menu display exist. Something like
PHP Code:

if(menu_display true

or something like that.

fysiks 02-08-2013 12:31

Re: new style menu problem
 
Quote:

Originally Posted by Unkolix (Post 1889895)
I have a problem too. I don't know how to check if menu display exist. Something like
PHP Code:

if(menu_display true

or something like that.

This is not your thread. Read through the tutorial. If it's not there read through the include file.

Roccoxx 02-08-2013 13:02

Re: new style menu problem
 
Quote:

Originally Posted by fysiks (Post 1889821)
MPROP_PERPAGE, newmenus.inc

thx you


All times are GMT -4. The time now is 20:34.

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