Raised This Month: $ Target: $400
 0% 

[Zp] Ayuda Con Un Menu :(


  
 
 
Thread Tools Display Modes
Author Message
Tidius
Senior Member
Join Date: Apr 2008
Location: Argentina, Buenos Aires
Old 12-29-2009 , 16:59   [Zp] Ayuda Con Un Menu :(
#1

Bueno estaba haciendo esto[

http://forums.alliedmods.net/showpost.php?p=872788

Para poder agregarle el modo synapsis, armagedon, sniper etc.. al menu de los admines y me salto todo esto

[IMG]http://img85.**************/img85/60/aaaaaaaaaaaaaaaaaaaaaaag.png[/IMG]

Yo hice asi:

Abajo de:

PHP Code:
    // 7. Plague mode command
    
if (allowed_plague())
        
len += formatex(menu[len], sizeof menu len"\r7.\w %L^n"id"MENU_ADMIN7")
    else
        
len += formatex(menu[len], sizeof menu len"\d7. %L^n"id"MENU_ADMIN7")[/code]Puse esto antes del 0 
// 9. Next
len += formatex(menu[len], sizeof menu - 1 - len, "^n\r9.\y %L", id, "MENU_NEXT") [/code]Despues esta parte me quedo asi:

PHP Code:
        case 6// Plague Mode command
        
{
            if (
allowed_plague())
                
command_plague(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
            
            
show_menu_admin(id)
        }
        
        case 
MENU_KEY_NEXT:
        {
            
show_menu_admin2(id)
            return 
PLUGIN_HANDLED;
        }      
        
    }
    
    return 
PLUGIN_HANDLED;

Esta parte me quedo asi:

PHP Code:
// Admin Menu
show_menu_admin(id)
{
    static 
menu[250], len
    len 
0
    
    
// Title
    
len += formatex(menu[len], sizeof menu len"\y%L^n^n"id"MENU_ADMIN_TITLE")
    
    
// 1. Zombiefy/Humanize command
    
if (!g_endround && !g_swarmround && !g_nemround && !g_survround && !g_plagueround && !task_exists(TASK_WELCOMEMSG))
        
len += formatex(menu[len], sizeof menu len"\r1.\w %L^n"id"MENU_ADMIN1")
    else
        
len += formatex(menu[len], sizeof menu len"\d1. %L^n"id"MENU_ADMIN1")
    
    
// 2. Nemesis command
    
if (g_newround && !g_endround && get_pcvar_num(cvar_nem) && !task_exists(TASK_WELCOMEMSG))
        
len += formatex(menu[len], sizeof menu len"\r2.\w %L^n"id"MENU_ADMIN2")
    else
        
len += formatex(menu[len], sizeof menu len"\d2. %L^n"id"MENU_ADMIN2")
    
    
// 3. Survivor command
    
if (g_newround && !g_endround && get_pcvar_num(cvar_surv) && !task_exists(TASK_WELCOMEMSG))
        
len += formatex(menu[len], sizeof menu len"\r3.\w %L^n"id"MENU_ADMIN3")
    else
        
len += formatex(menu[len], sizeof menu len"\d3. %L^n"id"MENU_ADMIN3")
    
    
// 4. Respawn command
    
if (!g_endround && !g_survround && !g_swarmround && !g_nemround && !g_plagueround)
        
len += formatex(menu[len], sizeof menu len"\r4.\w %L^n"id"MENU_ADMIN4")
    else
        
len += formatex(menu[len], sizeof menu len"\d4. %L^n"id"MENU_ADMIN4")
    
    
// 5. Swarm mode command
    
if (allowed_swarm())
        
len += formatex(menu[len], sizeof menu len"\r5.\w %L^n"id"MENU_ADMIN5")
    else
        
len += formatex(menu[len], sizeof menu len"\d5. %L^n"id"MENU_ADMIN5")
    
    
// 6. Multi infection command
    
if (allowed_multi())
        
len += formatex(menu[len], sizeof menu len"\r6.\w %L^n"id"MENU_ADMIN6")
    else
        
len += formatex(menu[len], sizeof menu len"\d6. %L^n"id"MENU_ADMIN6")
    
    
// 7. Plague mode command
    
if (allowed_plague())
        
len += formatex(menu[len], sizeof menu len"\r7.\w %L^n"id"MENU_ADMIN7")
    else
        
len += formatex(menu[len], sizeof menu len"\d7. %L^n"id"MENU_ADMIN7")
    
    
// 9. Next
    
len += formatex(menu[len], sizeof menu len"^n\r9.\y %L"id"MENU_NEXT")  
    
    
// 0. Exit
    
len += formatex(menu[len], sizeof menu len"^n\r0.\w %L"id"MENU_EXIT")
    
    
show_menu(idKEYSMENUmenu, -1"Admin Menu")
}

public 
show_menu_admin2(id// Creamos el name del public
{
     
// Creamos el titulo y el handle del menu
    
new amenu menu_create("Mas opciones de adm""mostrar_menu")
    
    
// Creamos las opciones que necesitemos (yo voy a poner solo 3)
    
menu_additem(amenu"Empesar modo Assassin, "1" )
    menu_additem(amenu, "
Empesar modo Armagedon", "2")
    menu_additem(amenu, "
Empesar modo Nemesis", "3")
    menu_additem(amenu, "
Empesar modo Survivor", "4")
    menu_additem(amenu, "
Empesar modo Synapsis", "5")
    menu_additem(amenu, "
Empesar modo Sniper", "6")
    
    menu_display(id, amenu, 0)
    return PLUGIN_HANDLED

Y el menu asi:

PHP Code:
public show_menu_admin2(id// Creamos el name del public
{
     
// Creamos el titulo y el handle del menu
    
new amenu menu_create("Mas opciones de adm""mostrar_menu")
    
    
// Creamos las opciones que necesitemos (yo voy a poner solo 3)
    
menu_additem(amenu"Empesar modo Assassin, "1" )
    menu_additem(amenu, "
Empesar modo Armagedon", "2")
    menu_additem(amenu, "
Empesar modo Nemesis", "3")
    menu_additem(amenu, "
Empesar modo Survivor", "4")
    menu_additem(amenu, "
Empesar modo Synapsis", "5")
    menu_additem(amenu, "
Empesar modo Sniper", "6")
    
    menu_display(id, amenu, 0)
    return PLUGIN_HANDLED

Despues la otra parte del menu, me quedo asi:

PHP Code:
public mostrar_menu(idmenuitem// Public 
{
    
// El if para hacer la opcion de salir
    
if(item == MENU_EXIT) return PLUGIN_HANDLED 
    
// Las variables que siempre usamos
    
new data[6], iName[64], accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
    
// Switch para los case
    
switch(str_to_num(data))
    {
        
// Agregamos nuestras opciones
        
case 1// Assassin
        
{
            if (
allowed_swarm())
                
command_assassin(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
            
            
show_menu_admin(id)
        }
        case 
2// Armagedon
        
{
            if (
allowed_swarm())
                
command_lnj(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
            
            
show_menu_admin(id)
            
        }
        case 
3// Nemesis
        
{
            if (
allowed_swarm())
                
command_nemmenu(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
            
            
show_menu_admin(id)
        }
        case 
4// Survivor
        
{
            if (
allowed_swarm())
                
command_survmenu(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
            
            
show_menu_admin(id)
        }
        case 
5// Synapsis
        
{
            if (
allowed_swarm())
                
command_synapsis(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
            
            
show_menu_admin(id)
        }
        case 
6// Sniper
        
{
            if (
allowed_multi())
                
command_sniper(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
            
            
show_menu_admin(id)
        }
        
// Si se dan cuenta el code de adentro de los case no cambio
        // en nada de lo que seria el code del menu original , porque es lo mismo
    
}

No se que hice mal u.u alguno me da una mano ?

Last edited by Tidius; 12-29-2009 at 17:04.
Tidius is offline
ecurbelo
BANNED
Join Date: Dec 2009
Location: Matando Trolls (Haslers)
Old 12-29-2009 , 17:11   Re: [Zp] Ayuda Con Un Menu :(
#2

Podes dejar el SMA? Porque no entiendo ni el 1% de lo que pusiste.
ecurbelo is offline
Tidius
Senior Member
Join Date: Apr 2008
Location: Argentina, Buenos Aires
Old 12-29-2009 , 17:22   Re: [Zp] Ayuda Con Un Menu :(
#3

Ahi esta, gracias
Attached Files
File Type: sma Get Plugin or Get Source (zombie_plague40.sma - 561 views - 274.5 KB)
Tidius is offline
apuu
BANNED
Join Date: Oct 2009
Location: Argentina
Old 12-29-2009 , 17:32   Re: [Zp] Ayuda Con Un Menu :(
#4

Quote:
menu_additem(amenu, "Empesar modo Assassin, "1" )


te falto cerrar la constancia seria
Quote:
menu_additem(amenu, "Empesar modo Assassin", "1" )

LISTO ESO SERIA TODO LO QUE YO VEO

Last edited by apuu; 12-29-2009 at 17:32. Reason: LISTO ESO SERIA TODO LO QUE YO VEO :D
apuu is offline
rubee
Senior Member
Join Date: Oct 2009
Location: party rocking
Old 12-29-2009 , 19:19   Re: [Zp] Ayuda Con Un Menu :(
#5

lo que yo encontre:

1- lo que te dijo apuu
2- falto una llave y separaste parte del code del spec
PHP Code:
        case 5// Join Spectator
        
{
            
// If alive
            
if (is_user_alive(id))
            {
                
// Check that we still have both humans and zombies to keep the round going
                
check_round(id)
                
                
// Kill him before he switches team
                
dllfunc(DLLFunc_ClientKillid)
            }
            
        case 
7// Mute Menu
        
{
            
console_cmdid"say /mute"
        }    
            
            
// Temporarily save player stats?
            
if (get_pcvar_num(cvar_statssave)) save_stats(id)
            
            
// Remove previous tasks
            
remove_task(id+TASK_TEAM)
            
remove_task(id+TASK_MODEL)
            
remove_task(id+TASK_FLASH)
            
remove_task(id+TASK_CHARGE)
            
remove_task(id+TASK_SPAWN)
            
remove_task(id+TASK_BLOOD)
            
            
// Then move him to the spectator team
            
fm_set_user_team(idCS_TEAM_SPECTATOR)
            
fm_set_user_team_msg(id+TASK_TEAM)
        } 
-->

PHP Code:
        case 5// Join Spectator
        
{
            
// If alive
            
if (is_user_alive(id))
            {
                
// Check that we still have both humans and zombies to keep the round going
                
check_round(id)
                
                
// Kill him before he switches team
                
dllfunc(DLLFunc_ClientKillid)
            }
            
// Temporarily save player stats?
            
if (get_pcvar_num(cvar_statssave)) save_stats(id)
            
            
// Remove previous tasks
            
remove_task(id+TASK_TEAM)
            
remove_task(id+TASK_MODEL)
            
remove_task(id+TASK_FLASH)
            
remove_task(id+TASK_CHARGE)
            
remove_task(id+TASK_SPAWN)
            
remove_task(id+TASK_BLOOD)
            
            
// Then move him to the spectator team
            
fm_set_user_team(idCS_TEAM_SPECTATOR)
            
fm_set_user_team_msg(id+TASK_TEAM)
        }
        case 
7// Mute Menu
        
{
            
console_cmdid"say /mute"
        }  
        case 
8// Admin Menu 
3- Agregale un return debajo de la linea 3777

PHP Code:
    }

-->
PHP Code:
    }
    return 
PLUGIN_HANDLED

es lo que encontre xD
__________________


rubee is offline
vazmar
Veteran Member
Join Date: Apr 2009
Old 12-29-2009 , 19:27   Re: [Zp] Ayuda Con Un Menu :(
#6

Tratá de mirar bien cuando abre una llave, cuando cierra.. y mira si termino el case, porq habias agregado un case dentro de otro.. al final de la funcion un plugin_handled.. emm.. trata de que este acomodado, asi no te tira loose identification.. y no crees variables q nunca uses, en este caso, g_sniperround.. no tiene sentido que le des true y false, y eso nada mas, no estas haciendo nada..
ahi te deje sma
Attached Files
File Type: sma Get Plugin or Get Source (zombie_plague40.sma - 613 views - 274.3 KB)
vazmar is offline
Ciio
Veteran Member
Join Date: Oct 2009
Location: Arica, Chile
Old 12-29-2009 , 20:26   Re: [Zp] Ayuda Con Un Menu :(
#7

Mira esto
http://forums.alliedmods.net/showpos...37&postcount=4
Con respecto a la imagen
__________________
Ciio is offline
Send a message via MSN to Ciio
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 12-30-2009 , 01:38   Re: [Zp] Ayuda Con Un Menu :(
#8

http://forums.alliedmods.net/showthread.php?t=107123
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
Kiske
Veteran Member
Join Date: May 2009
Old 12-30-2009 , 01:54   Re: [Zp] Ayuda Con Un Menu :(
#9

Lo que yo vi es que tenes muy mala ortografia

Empesar
-->
Empezar
__________________

Kiske is offline
Send a message via Skype™ to Kiske
Old 12-30-2009, 06:36
Hasler3
This message has been deleted by Alucard^. Reason: maduranding...
 



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 09:18.


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