Raised This Month: $ Target: $400
 0% 

menu_destroy/display


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GhostMan
Senior Member
Join Date: Jun 2012
Old 02-04-2013 , 09:46   menu_destroy/display
Reply With Quote #1

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?
GhostMan is offline
Kard1nal
Senior Member
Join Date: Dec 2012
Location: Russia
Old 02-04-2013 , 10:02   Re: menu_destroy/display
Reply With Quote #2

You should call the main function of menu after
menu_destroy(menu)
Kard1nal is offline
Send a message via Skype™ to Kard1nal
GhostMan
Senior Member
Join Date: Jun 2012
Old 02-04-2013 , 12:44   Re: menu_destroy/display
Reply With Quote #3

It's not a full code. I'm just giving some example to ilustrate my question.

Last edited by GhostMan; 02-04-2013 at 12:45.
GhostMan is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 02-04-2013 , 14:36   Re: menu_destroy/display
Reply With Quote #4

and what Kard1nal replied is the answer on your question.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Cheezpuff
BANNED
Join Date: Oct 2012
Location: City of the Dead
Old 02-04-2013 , 18:45   Re: menu_destroy/display
Reply With Quote #5

PHP Code:
    }
    return 
PLUGIN_CONTINUE;

or

PHP Code:
     }
     
menu_destroymenu );
     return 
PLUGIN_HANDLED;

Cheezpuff is offline
Send a message via Skype™ to Cheezpuff
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 02-04-2013 , 20:59   Re: menu_destroy/display
Reply With Quote #6

Quote:
Originally Posted by Cheezpuff View Post
PHP Code:
    }
    return 
PLUGIN_CONTINUE;

or

PHP Code:
     }
     
menu_destroymenu );
     return 
PLUGIN_HANDLED;

wrong.
Blizzard_87 is offline
dejan
Senior Member
Join Date: Mar 2009
Location: Sweden
Old 02-04-2013 , 22:12   Re: menu_destroy/display
Reply With Quote #7

buttom of the code
PHP Code:
menu_destroy(menu
replace with
PHP Code:
WhereTheMenuIsCreated(id
__________________

Last edited by dejan; 02-04-2013 at 22:13.
dejan is offline
Send a message via Skype™ to dejan
Reply



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:29.


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