AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   problem witch a menu(n00b) (https://forums.alliedmods.net/showthread.php?t=90001)

_lol_ 04-12-2009 19:18

problem witch a menu(n00b)
 
well, i want to "hide" and "desactivate" the exit menu option...

here is the code

Code:

public menuletras(id)
{
    new menu = menu_create("\yQuieres que las balas te empujen?", "mostrar_menu")
   
    menu_additem(menu, "\wSi", "1", 0)
    menu_additem(menu, "\wNo  \y(Esta opcion cuesta 10 Ammo Packs)", "2", 0)
   
    //Set a property on the menu
    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
   
    menu_display(id, menu, 0)
}

but it is not hiding the exit option T_T

what is bad?xd

Nextra 04-12-2009 19:31

Re: problem witch a menu(n00b)
 
I'm not good with newmenus but maybe you should set MPROP_EXIT to MEXIT_NEVER

From newmenus.inc:
PHP Code:

#define MEXIT_NEVER        -1        /* Menu will not have an exit option */ 


_lol_ 04-12-2009 19:33

Re: problem witch a menu(n00b)
 
ok lets try it :D

_lol_ 04-12-2009 19:46

Re: problem witch a menu(n00b)
 
haha now there is no menu xD

maybe i didn`t undesrtand very well the use of this...

Code:

#define MEXIT_NEVER        -1        /* Menu will not have an exit option */ 

public menuletras(id)
{
    new menu = menu_create("\yQuieres que las balas te empujen?", "mostrar_menu")
   
    menu_additem(menu, "\wSi", "1", 0)
    menu_additem(menu, "\wNo  \y(Esta opcion cuesta 10 Ammo Packs)", "2", 0)
   
    //Set a property on the menu
    menu_setprop(menu, MEXIT_NEVER)
   
    menu_display(id, menu, 0)
}


IneedHelp 04-12-2009 20:30

Re: problem witch a menu(n00b)
 
You don't have to define MEXIT_NEVER, is already defined on newmenus.inc. Try with menu_setprop(menu, MPROP_EXIT, MEXIT_NEVER)

_lol_ 04-12-2009 20:56

Re: problem witch a menu(n00b)
 
ty man, slways helping

One 04-12-2009 21:15

Re: problem witch a menu(n00b)
 
i think im to late, but maybe this willbe help

PHP Code:

public menuletras(id)
{
    new 
menu menu_create("\rQuieres que las balas te empujen?""mostrar_menu")
    
    
menu_additem(menu"\wSi""1"0)

    
menu_additem(menu"\wNo  \y(Esta opcion cuesta 10 Ammo Packs)""2"0)
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)

    
menu_display(idmenu0)
}

public 
mostrar_menu(idmenuitem)
 {
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    new 
data[6], iName[64];
    new 
accesscallback;

    
menu_item_getinfo(menuitemaccessdata,5iName63callback);

    new 
key str_to_num(data);
   
    switch(
key)
    {
        case 
1:
        {
            
//do
        
}
        case 
2:
        {
            
//do
        
}
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
 } 


alan_el_more 04-12-2009 21:27

Re: problem witch a menu(n00b)
 
@ One
He did not want to appear the item exit

One 04-12-2009 21:31

Re: problem witch a menu(n00b)
 
Quote:

Originally Posted by alan_el_more (Post 804190)
@ One
He did not want to appear the item exit

oh, oki. then he can delete it.this must work or not?


All times are GMT -4. The time now is 02:17.

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