Raised This Month: $ Target: $400
 0% 

Menu special id?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Unkolix
Veteran Member
Join Date: Sep 2012
Old 02-24-2013 , 15:52   Menu special id?
Reply With Quote #1

Is it possible to add a special menu id or something, so later I could destroy and hide it with this command?
PHP Code:
show_menu(id0"^n"1); 
Or maybe it's possible to check if menu is displayed?

I have this menu:
PHP Code:
new newmenu[64], choise_1[64], choise_2[64], choise_3[64]
format(newmenu64"%L"id"NEW_MENU");
g_iMenu menu_create(newmenu"Pressedrod");
format(choise_164"%L"id"MENU_CHOISE_1");
menu_additem(g_iMenuchoise_1"1"0);
format(choise_264"%L"id"MENU_CHOISE_2");
menu_additem(g_iMenuchoise_2"2"0); 
And I want to destroy and hide it on player death
PHP Code:
RegisterHam(Ham_Killed"player""PlayerDies"1)
/***/
public PlayerDies(id)
{
    if(
get_user_flags(id) & ADMIN_LEVEL_H)
    {
        
show_menu(id0"^n"1);
    }

The problem is that show_menu(id, 0, "^n", 1); destoys all menus...
Unkolix is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 02-24-2013 , 16:21   Re: Menu special id?
Reply With Quote #2

You can see if a player is viewing a menu with player_menu_info
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 02-24-2013 , 16:42   Re: Menu special id?
Reply With Quote #3

How should I use that? I can't find out...

Last edited by Unkolix; 02-24-2013 at 16:58.
Unkolix is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-24-2013 , 18:54   Re: Menu special id?
Reply With Quote #4

PHP Code:
    new iOldMenuIdiNewMenuId
    player_menu_info
(idiOldMenuIdiNewMenuId)
    if( 
iOldMenuId|| iNewMenuId!= -)
    {
    } 
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 02-24-2013 , 20:20   Re: Menu special id?
Reply With Quote #5

But because you save g_iMenu, just compare iNewMenuId to g_iMenu.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Old 02-25-2013, 00:39
Unkolix
This message has been deleted by Unkolix.
Unkolix
Veteran Member
Join Date: Sep 2012
Old 02-28-2013 , 16:19   Re: Menu special id?
Reply With Quote #6

I am using it like this:
PHP Code:
public PlayerDies(id)
{
    
player_menu_info(idg_iMenuiNewMenuId
    if( 
g_iMenu|| iNewMenuId!= -
    { 
        
show_menu(id0"^n"1);
    }

But it still destroys all the menus...

Last edited by Unkolix; 03-15-2013 at 08:16.
Unkolix is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-28-2013 , 17:46   Re: Menu special id?
Reply With Quote #7

Why The Fuck is g_iMenu a global variable ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 03-01-2013 , 00:49   Re: Menu special id?
Reply With Quote #8

Quote:
Originally Posted by ConnorMcLeod View Post
Why The Fuck is g_iMenu a global variable ?
I don't know Can someone explain me how to do this?

Last edited by Unkolix; 03-02-2013 at 04:38.
Unkolix is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 03-15-2013 , 08:16   Re: Menu special id?
Reply With Quote #9

Could someone explain me how to do it?
Unkolix is offline
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 03-15-2013 , 08:28   Re: Menu special id?
Reply With Quote #10

show the whole code
didoWEE is offline
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 21:37.


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