Raised This Month: $ Target: $400
 0% 

[HELP] Exit Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cheezpuff
BANNED
Join Date: Oct 2012
Location: City of the Dead
Old 09-01-2013 , 18:04   [HELP] Exit Menu
Reply With Quote #1

How to add that menu exit.
0: exit
Code:
    format(menu,511,"\r[4Honor`] \wZombies Selection Menu^nSelect your favorite \yZombie \wClass:^n\w%s^n", menu)
    if(curnum==8 && offset<12)
    {
        keys += (1<<8)
        format(menu,511,"%s^n\w9. Next",menu)
    }
    if(offset)
    {
        keys += (1<<9)
        format(menu,511,"%s^n\w0. Back",menu)
    }

    show_menu(id,keys,menu,-1,"ZClassSelect")
}

public zclass_pushed(id,key)
{
    if(key<8)
    {
        if (g_iMenuOptions[id][key] == g_iZombieClass[id])
        {
            client_cmd(id, "spk %s", LOCK_FAIL);
            
            print_color(id, "%s %L", MODNAME, LANG_SERVER, "CLASS_CURRENT")
            show_zclass_menu(id,g_iMenuOffset[id])
            return ;
        }
        
        new iCache3 = ArrayGetCell(g_zclass_admin, g_iMenuOptions[id][key])
        
        if ((iCache3 != ADMIN_ALL || !iCache3) && !access(id, iCache3))
        {
            print_color(id, "%s %L", MODNAME, LANG_SERVER, "CLASS_NO_ACCESS")
            show_zclass_menu(id,g_iMenuOffset[id])
            return ;
        }
        
        g_iNextClass[id] = g_iMenuOptions[id][key]
    
        new szCache1[32]
        ArrayGetString(g_zclass_name, g_iMenuOptions[id][key], szCache1, charsmax(szCache1))
        
        if (!g_isZombie[id] || (g_isZombie[id] && (g_boolCanBuild || g_boolPrepTime)))
            ColorChat(id, RED, "^4%s ^1You have selected^4 %s^1 as your next class", MODNAME, szCache1)
        if (!g_isAlive[id])
            ColorChat(id, RED, "%s %L", MODNAME, LANG_SERVER, "CLASS_RESPAWN")
        g_iMenuOffset[id] = 0
        
        if (g_isZombie[id] && (g_boolCanBuild || g_boolPrepTime))
            ExecuteHamB(Ham_CS_RoundRespawn, id)
            
        ExecuteForward(g_fwClassPicked, g_fwDummyResult, id, g_iZombieClass[id]);
    }
    else
    {
        if(key==8)
            g_iMenuOffset[id] += 8
        if(key==9)
            g_iMenuOffset[id] -= 8
        show_zclass_menu(id,g_iMenuOffset[id])
    }

    return ;
}

Last edited by Cheezpuff; 09-01-2013 at 18:08.
Cheezpuff is offline
Send a message via Skype™ to Cheezpuff
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 09-01-2013 , 19:23   Re: [HELP] Exit Menu
Reply With Quote #2

This will add "Exit" to the first page:
Code:
    if(offset)     {         keys += (1<<9)         format(menu,511,"%s^n\w0. Back",menu)     }
-->
Code:
    keys += (1<<9)     if(offset)         format(menu,511,"%s^n\w0. Back",menu)     else         format(menu,511,"%s^n\w0. Exit",menu)
&
Code:
        if(key==9)             g_iMenuOffset[id] -= 8
-->
Code:
        if(key==9) {             if(!g_iMenuOffset[id])                 return;             else                 g_iMenuOffset[id] -= 8         }

This will replace "Back" with "Exit" on all pages:
Code:
    if(offset)     {         keys += (1<<9)         format(menu,511,"%s^n\w0. Back",menu)     }
-->
Code:
    keys += (1<<9)     format(menu,511,"%s^n\w0. Exit",menu)
&
Code:
        if(key==9)             g_iMenuOffset[id] -= 8
-->
Code:
        if(key==9)             return;
__________________

Last edited by Black Rose; 09-01-2013 at 19:26.
Black Rose is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 09-01-2013 , 20:30   Re: [HELP] Exit Menu
Reply With Quote #3

Or simply use the new menu system.
__________________
Blizzard_87 is offline
Cheezpuff
BANNED
Join Date: Oct 2012
Location: City of the Dead
Old 09-02-2013 , 00:46   Re: [HELP] Exit Menu
Reply With Quote #4

ok, let me try late and i edit my post.
Cheezpuff is offline
Send a message via Skype™ to Cheezpuff
Reply


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


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