Raised This Month: $ Target: $400
 0% 

Menu special id?


Post New Thread Reply   
 
Thread Tools Display Modes
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 03-15-2013 , 08:34   Re: Menu special id?
Reply With Quote #11

Which part don't you understand? Did you read Connor's post?
Code:
new iOldMenuId, iNewMenuId player_menu_info(id, iOldMenuId, iNewMenuId) if( iOldMenuId> 0 || iNewMenuId!= -1 ) {     //user IS viewing menu }

Have a read:
Code:
/**  * Returns information about a menu (if any) the client is currently viewing.  *  * If newmenu is valid, then the menu will refer to the menuid associated with  * the title.  If newmenu is not valid, and the menu is valid, then the player  * is viewing a menu displayed with show_menu().  *  * Both may be invalid if the player is not viewing a menu.  *  * @param id            Client index.  * @param menu          Variable to store old menu id.  If none, then <1 will be  *                      stored.  * @param newmenu       Variable to store new menu id.  If none, then -1 will be  *                      stored.  * @param menupage      Variable to store current page of the new menu, if any.  * @return              1 if the player is viewing a menu, 0 otherwise.  * @error               Invalid client.  */ native player_menu_info(id, &menu, &newmenu, &menupage=0);
hornet is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 03-15-2013 , 08:59   Re: Menu special id?
Reply With Quote #12

I read it all... Should I create a bool or something? Where should I put that "player_menu_info" part? If I should use a bool, how do I check if player has another menu viewing?

Last edited by Unkolix; 03-27-2013 at 09:08.
Unkolix is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 03-30-2013 , 11:46   Re: Menu special id?
Reply With Quote #13

BUMP.

So can someone tell me how exactly I should use it, or show me an example of checking when a player is viewing a menu, and how to check if he doesn't see it anymore?

Last edited by Unkolix; 03-30-2013 at 11:47.
Unkolix is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-30-2013 , 21:21   Re: Menu special id?
Reply With Quote #14

Read the documentation for the command in newmenus.inc. You use it when you need the information about what menu a player is viewing.
__________________
fysiks is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 03-31-2013 , 02:55   Re: Menu special id?
Reply With Quote #15

Id did like this and it didn't work...
Quote:
Originally Posted by Unkolix View Post
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...
Unkolix is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-31-2013 , 04:45   Re: Menu special id?
Reply With Quote #16

Quote:
Originally Posted by ConnorMcLeod View Post
PHP Code:
    new iOldMenuIdiNewMenuId
    player_menu_info
(idiOldMenuIdiNewMenuId)
    if( 
iOldMenuId|| iNewMenuId!= -)
    {
    } 
->

Quote:
Originally Posted by ConnorMcLeod View Post
PHP Code:
    new iOldMenuIdiNewMenuId
    player_menu_info
(idiOldMenuIdiNewMenuId)
    if( 
iOldMenuId|| iNewMenuId!= -)
    {
        if( 
iNewMenuId == g_iMenu )
        {
            
menu_cancel(id)
            
show_menu(id0"^n"1);
        }
    } 
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 04-02-2013 , 00:41   Re: Menu special id?
Reply With Quote #17

Hmmm... Should I check it on player death (I want to close it on round end, game commencing too) as I want to close after VIP is dead? And I am not quite sure, how it will check if my VIP menu will be showing (g_iMenu)...
Unkolix is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-02-2013 , 00:46   Re: Menu special id?
Reply With Quote #18

Damn, that's questions you should post us, but quiestions should post to yourself and chose the better solution for what plugin you want to make.
I'm starting to think you should give up and only request full plugins.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 04-02-2013 , 01:09   Re: Menu special id?
Reply With Quote #19

You see, I want to block the menu on VIP death because it is still showing... That's not a really big problem you know, I can just block the message that is given after player chooses something from menu if he is death.

But, I would like to block it when round ends because if player hasn't used the menu yet can use it before round start (on new round) and then after round start he can use it again....


OOOOOOOOOOOOH, nevermind!! I will block it by making a bool, on round end it is set to true and on round start I will set it to false. On true I will block the choice of VIP... Hehe, it always happens to me (I find a solution) when asking for help.
Unkolix 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