Raised This Month: $51 Target: $400
 12% 

[Ayuda] Quitar opcion al menu de el zp y agregar nueva opcion


  
 
 
Thread Tools Display Modes
Author Message
lanproject
Member
Join Date: Mar 2012
Old 04-20-2013 , 18:33   [Ayuda] Quitar opcion al menu de el zp y agregar nueva opcion
#1

Hola buenas tardes.. ando necesitando saber como puedo sacar la opcion de ayuda y en su lugar agregar una opcion que diga comprar admin, y cuando se seleccione esta opcion se abra un motd que este se pueda modificar desde un archivo de texto (txt)

[IMG]http://img707.**************/img707/9889/sinttulowxl.png[/IMG]


si alguien me puede ayudar o darme una mano de como hacerlo mas o menos se lo agradeceria muchisimo.. yo se que no se puede pedir todo en bandeja, pero con algo concreto que me ayuden ya es bastante, porfavor algo concreto quiero decir si me explican algo que sea para que lo entienda o que me digan lee tal cosa para saber como hacer esto, tengan en cuenta que no se mucho, si me puedo dar cuenta de varias cosas pero no soy un experto.. eso es todo.

[link]http://**************/photo/my-images/707/sinttulowxl.png/[/link]

saludos
lanproject is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 04-20-2013 , 19:06   Re: [Ayuda] Quitar opcion al menu de el zp y agregar nueva opcion
#2

Postea tu zombie plague para hacer lo que pedis.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
3MCy Daimont
Senior Member
Join Date: Oct 2012
Old 04-20-2013 , 19:30   Re: [Ayuda] Quitar opcion al menu de el zp y agregar nueva opcion
#3

Supongamos que esta es la estructura de tu menu y handler (zp advance), compara los 2 y veras que no es nada complicado.

PHP Code:
// Game Menu
show_menu_game(id)
{
    static 
menu[250], lenuserflags
    len 
0
    userflags 
get_user_flags(id)
    
    
// Title
    
len += formatex(menu[len], charsmax(menu) - len"\y%s^n^n"g_modname)
    
    
// 1. Buy weapons
    
if (get_pcvar_num(cvar_buycustom))
        
len += formatex(menu[len], charsmax(menu) - len"\r1.\w %L^n"id"MENU_BUY")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d1. %L^n"id"MENU_BUY")
    
    
// 2. Extra items
    
if (get_pcvar_num(cvar_extraitems) && g_isalive[id])
        
len += formatex(menu[len], charsmax(menu) - len"\r2.\w %L^n"id"MENU_EXTRABUY")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d2. %L^n"id"MENU_EXTRABUY")
    
    
// 3. Zombie class
    
if (get_pcvar_num(cvar_zclasses))
        
len += formatex(menu[len], charsmax(menu) - len"\r3.\w %L^n"id,"MENU_ZCLASS")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d3. %L^n"id,"MENU_ZCLASS")
    
    
// 4. Unstuck
    
if (g_isalive[id])
        
len += formatex(menu[len], charsmax(menu) - len"\r4.\w %L^n"id"MENU_UNSTUCK")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d4. %L^n"id"MENU_UNSTUCK")
    
    
// 5. Help
    
len += formatex(menu[len], charsmax(menu) - len"\r5.\w %L^n^n"id"MENU_INFO")
    
    
// 6. Join spec
    
if (!g_isalive[id] || !get_pcvar_num(cvar_blocksuicide) || (userflags g_access_flag[ACCESS_ADMIN_MENU]))
        
len += formatex(menu[len], charsmax(menu) - len"\r6.\w %L^n^n"id"MENU_SPECTATOR")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d6. %L^n^n"id"MENU_SPECTATOR")
    
    
// 9. Admin menu
    
if (userflags g_access_flag[ACCESS_ADMIN_MENU3])
        
len += formatex(menu[len], charsmax(menu) - len"\r9.\w %L"id"MENU3_ADMIN")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d9. %L"id"MENU3_ADMIN")
    
    
// 0. Exit
    
len += formatex(menu[len], charsmax(menu) - len"^n^n\r0.\w %L"id"MENU_EXIT")
    
    
show_menu(idKEYSMENUmenu, -1"Game Menu")
}

// Game Menu
public menu_game(idkey)
{
    switch (
key)
    {
        case 
0// Buy Weapons
        
{
            
// Custom buy menus enabled?
            
if (get_pcvar_num(cvar_buycustom))
            {
                
// Disable the remember selection setting
                
WPN_AUTO_ON 0
                zp_colored_print
(id"^x04[ZP]^x01 %L"id"BUY_ENABLED")
                
                
// Show menu if player hasn't yet bought anything
                
if (g_canbuy[id]) show_menu_buy1(id)
            }
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
        }
        case 
1// Extra Items
        
{
            
// Extra items enabled?
            
if (get_pcvar_num(cvar_extraitems))
            {
                
// Check whether the player is able to buy anything
                
if (g_isalive[id])
                    
show_menu_extras(id)
                else
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
            }
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_EXTRAS")
        }
        case 
2// Zombie Classes
        
{
            
// Zombie classes enabled?
            
if (get_pcvar_num(cvar_zclasses))
                
show_menu_zclass(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_ZCLASSES")
        }
        case 
3// Unstuck
        
{
            
// Check if player is stuck
            
if (g_isalive[id])
            {
                if (
is_player_stuck(id))
                {
                    
// Move to an initial spawn
                    
if (get_pcvar_num(cvar_randspawn))
                        
do_random_spawn(id// random spawn (including CSDM)
                    
else
                        
do_random_spawn(id1// regular spawn
                
}
                else
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_STUCK")
            }
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
        }
        case 
4// Help Menu
        
{
            
show_menu_info(id)
        }
        case 
5// Join Spectator
        
{
            
// Player alive?
            
if (g_isalive[id])
            {
                
// Prevent abuse by non-admins if block suicide setting is enabled
                
if (get_pcvar_num(cvar_blocksuicide) && !(get_user_flags(id) & g_access_flag[ACCESS_ADMIN_MENU]))
                {
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
                    return 
PLUGIN_HANDLED;
                }
                
                
// 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)
            
remove_task(id+TASK_AURA)
            
remove_task(id+TASK_BURN)
            
            
// Then move him to the spectator team
            
fm_cs_set_user_team(idFM_CS_TEAM_SPECTATOR)
            
fm_user_team_update(id)
        }
        case 
8// Admin Menu
        
{
            
// Check if player has the required access
            
if (get_user_flags(id) & g_access_flag[ACCESS_ADMIN_MENU3])
                
show_menu3_admin(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_ACCESS")
        }
    }
    
    return 
PLUGIN_HANDLED;

Lo Modificas y quedaria asi como tu lo pediste

PHP Code:

// Game Menu
show_menu_game(id)
{
    static 
menu[250], lenuserflags
    len 
0
    userflags 
get_user_flags(id)
    
    
// Title
    
len += formatex(menu[len], charsmax(menu) - len"\y%s^n^n"g_modname)
    
    
// 1. Buy weapons
    
if (get_pcvar_num(cvar_buycustom))
        
len += formatex(menu[len], charsmax(menu) - len"\r1.\w %L^n"id"MENU_BUY")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d1. %L^n"id"MENU_BUY")
    
    
// 2. Extra items
    
if (get_pcvar_num(cvar_extraitems) && g_isalive[id])
        
len += formatex(menu[len], charsmax(menu) - len"\r2.\w %L^n"id"MENU_EXTRABUY")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d2. %L^n"id"MENU_EXTRABUY")
    
    
// 3. Zombie class
    
if (get_pcvar_num(cvar_zclasses))
        
len += formatex(menu[len], charsmax(menu) - len"\r3.\w %L^n"id,"MENU_ZCLASS")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d3. %L^n"id,"MENU_ZCLASS")
    
    
// 4. Unstuck
    
if (g_isalive[id])
        
len += formatex(menu[len], charsmax(menu) - len"\r4.\w %L^n"id"MENU_UNSTUCK")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d4. %L^n"id"MENU_UNSTUCK")
    
    
// 5. Help
    
len += formatex(menu[len], charsmax(menu) - len"\r5.\w Comprar \r Admin^n^n")
    
    
// 6. Join spec
    
if (!g_isalive[id] || !get_pcvar_num(cvar_blocksuicide) || (userflags g_access_flag[ACCESS_ADMIN_MENU]))
        
len += formatex(menu[len], charsmax(menu) - len"\r6.\w %L^n^n"id"MENU_SPECTATOR")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d6. %L^n^n"id"MENU_SPECTATOR")
    
    
// 9. Admin menu
    
if (userflags g_access_flag[ACCESS_ADMIN_MENU3])
        
len += formatex(menu[len], charsmax(menu) - len"\r9.\w %L"id"MENU3_ADMIN")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d9. %L"id"MENU3_ADMIN")
    
    
// 0. Exit
    
len += formatex(menu[len], charsmax(menu) - len"^n^n\r0.\w %L"id"MENU_EXIT")
    
    
show_menu(idKEYSMENUmenu, -1"Game Menu")
}

// Game Menu
public menu_game(idkey)
{
    switch (
key)
    {
        case 
0// Buy Weapons
        
{
            
// Custom buy menus enabled?
            
if (get_pcvar_num(cvar_buycustom))
            {
                
// Disable the remember selection setting
                
WPN_AUTO_ON 0
                zp_colored_print
(id"^x04[ZP]^x01 %L"id"BUY_ENABLED")
                
                
// Show menu if player hasn't yet bought anything
                
if (g_canbuy[id]) show_menu_buy1(id)
            }
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
        }
        case 
1// Extra Items
        
{
            
// Extra items enabled?
            
if (get_pcvar_num(cvar_extraitems))
            {
                
// Check whether the player is able to buy anything
                
if (g_isalive[id])
                    
show_menu_extras(id)
                else
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
            }
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_EXTRAS")
        }
        case 
2// Zombie Classes
        
{
            
// Zombie classes enabled?
            
if (get_pcvar_num(cvar_zclasses))
                
show_menu_zclass(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_ZCLASSES")
        }
        case 
3// Unstuck
        
{
            
// Check if player is stuck
            
if (g_isalive[id])
            {
                if (
is_player_stuck(id))
                {
                    
// Move to an initial spawn
                    
if (get_pcvar_num(cvar_randspawn))
                        
do_random_spawn(id// random spawn (including CSDM)
                    
else
                        
do_random_spawn(id1// regular spawn
                
}
                else
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_STUCK")
            }
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
        }
        case 
4// Help Menu
        
{
            
comprar_admin(id)
        }
        case 
5// Join Spectator
        
{
            
// Player alive?
            
if (g_isalive[id])
            {
                
// Prevent abuse by non-admins if block suicide setting is enabled
                
if (get_pcvar_num(cvar_blocksuicide) && !(get_user_flags(id) & g_access_flag[ACCESS_ADMIN_MENU]))
                {
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
                    return 
PLUGIN_HANDLED;
                }
                
                
// 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)
            
remove_task(id+TASK_AURA)
            
remove_task(id+TASK_BURN)
            
            
// Then move him to the spectator team
            
fm_cs_set_user_team(idFM_CS_TEAM_SPECTATOR)
            
fm_user_team_update(id)
        }
        case 
8// Admin Menu
        
{
            
// Check if player has the required access
            
if (get_user_flags(id) & g_access_flag[ACCESS_ADMIN_MENU3])
                
show_menu3_admin(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_ACCESS")
        }
    }
    
    return 
PLUGIN_HANDLED;
}

public 
comprar_admin(id)
{
    
show_motd(id"comprar_admin.txt""comprar_admin")
    return 
PLUGIN_HANDLED

-Luego tienes que crear un archivo con extension .txt en este caso comprar_admin.txt y ponerlo en la carpeta cstrike, ovbiamente debes saber un poco de html para poder hacer espacios y no aparesca todo junto.
__________________
Clases Humanas v2.0 Con/Sin Restriccion de Niveles
El premio de una buena accion, es haberla hecho...
Te Amo GokuX <3
I Love those believed.

Last edited by 3MCy Daimont; 04-21-2013 at 15:53.
3MCy Daimont is offline
lanproject
Member
Join Date: Mar 2012
Old 04-20-2013 , 20:24   Re: [Ayuda] Quitar opcion al menu de el zp y agregar nueva opcion
#4

Quote:
Originally Posted by 3MCy Daimont View Post
Supongamos que esta es la estructura de tu menu y handler (zp advance), compara los 2 y veras que no es nada complicado.

PHP Code:
// Game Menu
show_menu_game(id)
{
    static 
menu[250], lenuserflags
    len 
0
    userflags 
get_user_flags(id)
    
    
// Title
    
len += formatex(menu[len], charsmax(menu) - len"\y%s^n^n"g_modname)
    
    
// 1. Buy weapons
    
if (get_pcvar_num(cvar_buycustom))
        
len += formatex(menu[len], charsmax(menu) - len"\r1.\w %L^n"id"MENU_BUY")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d1. %L^n"id"MENU_BUY")
    
    
// 2. Extra items
    
if (get_pcvar_num(cvar_extraitems) && g_isalive[id])
        
len += formatex(menu[len], charsmax(menu) - len"\r2.\w %L^n"id"MENU_EXTRABUY")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d2. %L^n"id"MENU_EXTRABUY")
    
    
// 3. Zombie class
    
if (get_pcvar_num(cvar_zclasses))
        
len += formatex(menu[len], charsmax(menu) - len"\r3.\w %L^n"id,"MENU_ZCLASS")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d3. %L^n"id,"MENU_ZCLASS")
    
    
// 4. Unstuck
    
if (g_isalive[id])
        
len += formatex(menu[len], charsmax(menu) - len"\r4.\w %L^n"id"MENU_UNSTUCK")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d4. %L^n"id"MENU_UNSTUCK")
    
    
// 5. Help
    
len += formatex(menu[len], charsmax(menu) - len"\r5.\w %L^n^n"id"MENU_INFO")
    
    
// 6. Join spec
    
if (!g_isalive[id] || !get_pcvar_num(cvar_blocksuicide) || (userflags g_access_flag[ACCESS_ADMIN_MENU]))
        
len += formatex(menu[len], charsmax(menu) - len"\r6.\w %L^n^n"id"MENU_SPECTATOR")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d6. %L^n^n"id"MENU_SPECTATOR")
    
    
// 9. Admin menu
    
if (userflags g_access_flag[ACCESS_ADMIN_MENU3])
        
len += formatex(menu[len], charsmax(menu) - len"\r9.\w %L"id"MENU3_ADMIN")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d9. %L"id"MENU3_ADMIN")
    
    
// 0. Exit
    
len += formatex(menu[len], charsmax(menu) - len"^n^n\r0.\w %L"id"MENU_EXIT")
    
    
show_menu(idKEYSMENUmenu, -1"Game Menu")
}

// Game Menu
public menu_game(idkey)
{
    switch (
key)
    {
        case 
0// Buy Weapons
        
{
            
// Custom buy menus enabled?
            
if (get_pcvar_num(cvar_buycustom))
            {
                
// Disable the remember selection setting
                
WPN_AUTO_ON 0
                zp_colored_print
(id"^x04[ZP]^x01 %L"id"BUY_ENABLED")
                
                
// Show menu if player hasn't yet bought anything
                
if (g_canbuy[id]) show_menu_buy1(id)
            }
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
        }
        case 
1// Extra Items
        
{
            
// Extra items enabled?
            
if (get_pcvar_num(cvar_extraitems))
            {
                
// Check whether the player is able to buy anything
                
if (g_isalive[id])
                    
show_menu_extras(id)
                else
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
            }
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_EXTRAS")
        }
        case 
2// Zombie Classes
        
{
            
// Zombie classes enabled?
            
if (get_pcvar_num(cvar_zclasses))
                
show_menu_zclass(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_ZCLASSES")
        }
        case 
3// Unstuck
        
{
            
// Check if player is stuck
            
if (g_isalive[id])
            {
                if (
is_player_stuck(id))
                {
                    
// Move to an initial spawn
                    
if (get_pcvar_num(cvar_randspawn))
                        
do_random_spawn(id// random spawn (including CSDM)
                    
else
                        
do_random_spawn(id1// regular spawn
                
}
                else
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_STUCK")
            }
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
        }
        case 
4// Help Menu
        
{
            
show_menu_info(id)
        }
        case 
5// Join Spectator
        
{
            
// Player alive?
            
if (g_isalive[id])
            {
                
// Prevent abuse by non-admins if block suicide setting is enabled
                
if (get_pcvar_num(cvar_blocksuicide) && !(get_user_flags(id) & g_access_flag[ACCESS_ADMIN_MENU]))
                {
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
                    return 
PLUGIN_HANDLED;
                }
                
                
// 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)
            
remove_task(id+TASK_AURA)
            
remove_task(id+TASK_BURN)
            
            
// Then move him to the spectator team
            
fm_cs_set_user_team(idFM_CS_TEAM_SPECTATOR)
            
fm_user_team_update(id)
        }
        case 
8// Admin Menu
        
{
            
// Check if player has the required access
            
if (get_user_flags(id) & g_access_flag[ACCESS_ADMIN_MENU3])
                
show_menu3_admin(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_ACCESS")
        }
    }
    
    return 
PLUGIN_HANDLED;

Lo Modificas y quedaria asi como tu lo pediste

PHP Code:

// Game Menu
show_menu_game(id)
{
    static 
menu[250], lenuserflags
    len 
0
    userflags 
get_user_flags(id)
    
    
// Title
    
len += formatex(menu[len], charsmax(menu) - len"\y%s^n^n"g_modname)
    
    
// 1. Buy weapons
    
if (get_pcvar_num(cvar_buycustom))
        
len += formatex(menu[len], charsmax(menu) - len"\r1.\w %L^n"id"MENU_BUY")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d1. %L^n"id"MENU_BUY")
    
    
// 2. Extra items
    
if (get_pcvar_num(cvar_extraitems) && g_isalive[id])
        
len += formatex(menu[len], charsmax(menu) - len"\r2.\w %L^n"id"MENU_EXTRABUY")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d2. %L^n"id"MENU_EXTRABUY")
    
    
// 3. Zombie class
    
if (get_pcvar_num(cvar_zclasses))
        
len += formatex(menu[len], charsmax(menu) - len"\r3.\w %L^n"id,"MENU_ZCLASS")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d3. %L^n"id,"MENU_ZCLASS")
    
    
// 4. Unstuck
    
if (g_isalive[id])
        
len += formatex(menu[len], charsmax(menu) - len"\r4.\w %L^n"id"MENU_UNSTUCK")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d4. %L^n"id"MENU_UNSTUCK")
    
    
// 5. Help
    
len += formatex(menu[len], charsmax(menu) - len"\r5.\w Comprar \r Admin")
    
    
// 6. Join spec
    
if (!g_isalive[id] || !get_pcvar_num(cvar_blocksuicide) || (userflags g_access_flag[ACCESS_ADMIN_MENU]))
        
len += formatex(menu[len], charsmax(menu) - len"\r6.\w %L^n^n"id"MENU_SPECTATOR")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d6. %L^n^n"id"MENU_SPECTATOR")
    
    
// 9. Admin menu
    
if (userflags g_access_flag[ACCESS_ADMIN_MENU3])
        
len += formatex(menu[len], charsmax(menu) - len"\r9.\w %L"id"MENU3_ADMIN")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d9. %L"id"MENU3_ADMIN")
    
    
// 0. Exit
    
len += formatex(menu[len], charsmax(menu) - len"^n^n\r0.\w %L"id"MENU_EXIT")
    
    
show_menu(idKEYSMENUmenu, -1"Game Menu")
}

// Game Menu
public menu_game(idkey)
{
    switch (
key)
    {
        case 
0// Buy Weapons
        
{
            
// Custom buy menus enabled?
            
if (get_pcvar_num(cvar_buycustom))
            {
                
// Disable the remember selection setting
                
WPN_AUTO_ON 0
                zp_colored_print
(id"^x04[ZP]^x01 %L"id"BUY_ENABLED")
                
                
// Show menu if player hasn't yet bought anything
                
if (g_canbuy[id]) show_menu_buy1(id)
            }
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
        }
        case 
1// Extra Items
        
{
            
// Extra items enabled?
            
if (get_pcvar_num(cvar_extraitems))
            {
                
// Check whether the player is able to buy anything
                
if (g_isalive[id])
                    
show_menu_extras(id)
                else
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
            }
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_EXTRAS")
        }
        case 
2// Zombie Classes
        
{
            
// Zombie classes enabled?
            
if (get_pcvar_num(cvar_zclasses))
                
show_menu_zclass(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_ZCLASSES")
        }
        case 
3// Unstuck
        
{
            
// Check if player is stuck
            
if (g_isalive[id])
            {
                if (
is_player_stuck(id))
                {
                    
// Move to an initial spawn
                    
if (get_pcvar_num(cvar_randspawn))
                        
do_random_spawn(id// random spawn (including CSDM)
                    
else
                        
do_random_spawn(id1// regular spawn
                
}
                else
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_STUCK")
            }
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
        }
        case 
4// Help Menu
        
{
            
comprar_admin(id)
        }
        case 
5// Join Spectator
        
{
            
// Player alive?
            
if (g_isalive[id])
            {
                
// Prevent abuse by non-admins if block suicide setting is enabled
                
if (get_pcvar_num(cvar_blocksuicide) && !(get_user_flags(id) & g_access_flag[ACCESS_ADMIN_MENU]))
                {
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
                    return 
PLUGIN_HANDLED;
                }
                
                
// 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)
            
remove_task(id+TASK_AURA)
            
remove_task(id+TASK_BURN)
            
            
// Then move him to the spectator team
            
fm_cs_set_user_team(idFM_CS_TEAM_SPECTATOR)
            
fm_user_team_update(id)
        }
        case 
8// Admin Menu
        
{
            
// Check if player has the required access
            
if (get_user_flags(id) & g_access_flag[ACCESS_ADMIN_MENU3])
                
show_menu3_admin(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_ACCESS")
        }
    }
    
    return 
PLUGIN_HANDLED;
}

public 
comprar_admin(id)
{
    
show_motd(id"comprar_admin.txt""comprar_admin")
    return 
PLUGIN_HANDLED

-Luego tienes que crear un archivo con extension .txt en este caso comprar_admin.txt y ponerlo en la carpeta cstrike, ovbiamente debes saber un poco de html para poder hacer espacios y no aparesca todo junto.
cuando compilo me dice esto:

<3533> : warning 217: loose identation
<3536> : warning 217: loose identation

lo compila pero cuando entro el menu 5 esta pegado arriba del 6, creo que le falta como una separacion.. pero nose como se hace?..

edit: ya aregle para que se vea bien, pero los errores al compilar siguen estando.. que puedo hacer?

Last edited by lanproject; 04-20-2013 at 22:49. Reason: aregle uno de los errores.
lanproject is offline
3MCy Daimont
Senior Member
Join Date: Oct 2012
Old 04-21-2013 , 11:21   Re: [Ayuda] Quitar opcion al menu de el zp y agregar nueva opcion
#5

Esos warnings aparecen por que esta mal tabulado intenta retabular desde show_menu_game hasta el final, pero de todas formas esos warnings son irrelevantes no te afectaran.
__________________
Clases Humanas v2.0 Con/Sin Restriccion de Niveles
El premio de una buena accion, es haberla hecho...
Te Amo GokuX <3
I Love those believed.

Last edited by 3MCy Daimont; 04-21-2013 at 15:51.
3MCy Daimont is offline
Movie City
Senior Member
Join Date: Sep 2012
Location: hns_floppytown
Old 04-21-2013 , 15:44   Re: [Ayuda] Quitar opcion al menu de el zp y agregar nueva opcion
#6

q version de zp usas?
Movie City is offline
MexPower
Veteran Member
Join Date: Nov 2012
Old 04-21-2013 , 15:47   Re: [Ayuda] Quitar opcion al menu de el zp y agregar nueva opcion
#7

No son errorre muchos confunden errores con warings si tubieras errores no te dejara compilar...
__________________
Allied Modders En Español
MexPower is offline
lanproject
Member
Join Date: Mar 2012
Old 04-21-2013 , 17:21   Re: [Ayuda] Quitar opcion al menu de el zp y agregar nueva opcion
#8

Quote:
Originally Posted by Movie City View Post
q version de zp usas?
uso la 4.3
pregunta, cual es mejor la 4.3 o la 4.2 (pregunto esto porque muchos dicen que la 4.2 es mejor.) aunqe por logica creo que es mejor la 4.3 porque es la que le sigue.

Quote:
No son errorre muchos confunden errores con warings si tubieras errores no te dejara compilar...
si, perdon es una forma de decir, ya se que es asi.. pero de todas formas me gustaria que no los tirara..
lanproject is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 04-22-2013 , 10:15   Re: [Ayuda] Quitar opcion al menu de el zp y agregar nueva opcion
#9

Quote:
Originally Posted by Movie City View Post
q version de zp usas?
a qué viene eso?

Quote:
Originally Posted by lanproject View Post
uso la 4.3
pregunta, cual es mejor la 4.3 o la 4.2 (pregunto esto porque muchos dicen que la 4.2 es mejor.) aunqe por logica creo que es mejor la 4.3 porque es la que le sigue.
para mí, prefiero la 4.3 porque puedes cambiar bastantes cosas del plugin sin tener que compilar el plugin, en la 4.2 como no hy archivos .ini cada vez que modifiques la configuración del zp vas a tener que compilar.

hay algunos que no les gusta eso del archivo .ini y lo ven una tontería, pero cada uno sus gustos

Quote:
Originally Posted by lanproject View Post
si, perdon es una forma de decir, ya se que es asi.. pero de todas formas me gustaria que no los tirara..
tabula bien el código
baneado is offline
 



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 20:21.


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