AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   menu_destroy/display (https://forums.alliedmods.net/showthread.php?t=207578)

GhostMan 02-04-2013 09:46

menu_destroy/display
 
PHP Code:

public JBShopHandlerCT(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
    new 
alive    is_user_alive(id)
    new 
key str_to_num(data);

    switch(
key)
    {
        case 
1:
        {
            if(
g_packs[id] >= && alive)
            {
                
g_packs[id] -= 5
                give_item
(id"weapon_deagle")
            }
            else
            {
                
client_print(idprint_chat"[SHOP] You don't have enought points.")
            }
        
            
menu_display(idmenu0)
        }
    }
    
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED


After player takes something from menu i would like that menu would pop-up again untill player press EXIT button.

So the question is do i need to add
PHP Code:

menu_destroy(menu

at the end of function?

Kard1nal 02-04-2013 10:02

Re: menu_destroy/display
 
You should call the main function of menu after
menu_destroy(menu)

GhostMan 02-04-2013 12:44

Re: menu_destroy/display
 
It's not a full code. I'm just giving some example to ilustrate my question.

Napoleon_be 02-04-2013 14:36

Re: menu_destroy/display
 
and what Kard1nal replied is the answer on your question.

Cheezpuff 02-04-2013 18:45

Re: menu_destroy/display
 
PHP Code:

    }
    return 
PLUGIN_CONTINUE;


or

PHP Code:

     }
     
menu_destroymenu );
     return 
PLUGIN_HANDLED;



Blizzard_87 02-04-2013 20:59

Re: menu_destroy/display
 
Quote:

Originally Posted by Cheezpuff (Post 1887169)
PHP Code:

    }
    return 
PLUGIN_CONTINUE;


or

PHP Code:

     }
     
menu_destroymenu );
     return 
PLUGIN_HANDLED;



wrong.

dejan 02-04-2013 22:12

Re: menu_destroy/display
 
buttom of the code
PHP Code:

menu_destroy(menu

replace with
PHP Code:

WhereTheMenuIsCreated(id



All times are GMT -4. The time now is 20:29.

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