Raised This Month: $ Target: $400
 0% 

menu_addblank changes location of Exit [Solved]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 07-08-2013 , 09:52   Re: menu_addblank changes location of Exit
Reply With Quote #3

Quote:
Originally Posted by baneado View Post
I think it's impossible if you don't have 9 items on menu, you can use the old style menu
Or just use new menus and in handler add a case to check if is a number of exit button.

EDIT:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

public plugin_init()
{
    
register_plugin("My Menu",AMXX_VERSION_STR,"Leech this");
    
    
register_clcmd("amx_mymenu","cmdMenu");
}

public 
cmdMenu(id)
{
    new 
iMenu menu_create("My Awesome menu","MenuHandler");
    
    
menu_additem(iMenu,"My #01 Option","0");
    
menu_additem(iMenu,"My #02 Option","1");
    
menu_additem(iMenu,"My #03 Option","2");
    
    
menu_addblank(iMenu,3);
    
    
menu_additem(iMenu,"Exit","3");
    
    
menu_display(id,iMenu);
    
    return 
PLUGIN_HANDLED;
}

public 
MenuHandler(id,iMenu,iKey)
{
    if(
iKey == 3)
    {
        
menu_destroy(iMenu);
        
        return 
PLUGIN_HANDLED;
    }
    else
    {
        switch(
iKey)
        {
            case 
0client_print(id,print_chat,"[AMXX] My %d Option",iKey);
            
            case 
1:
            {
                
user_kill(id,0);
                
                
client_print(id,print_chat,"[AMXX] I got a Kill with a %d Option -.-",iKey);
            }
            case 
2:
            {
                
cs_set_user_money(id,16000);
                
                
client_print(id,print_chat,"[AMXX] My %d Option (Ohoo $16000 for me :P",iKey);
            }
        }
    }
    return 
PLUGIN_HANDLED;

__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 07-08-2013 at 10:01.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
 



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 06:30.


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