AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Get menu close (https://forums.alliedmods.net/showthread.php?t=40690)

WaZZeR++ 07-01-2006 20:05

Get menu close
 
How can i check if a manu was closed?

Should work on all menus like main, bans, kick, slay/slap etc...

Rolnaaba 07-01-2006 22:59

Re: Get menu close
 
what are you trying to do? Make a message pop-up when a menu closes?

TheNewt 07-01-2006 23:24

Re: Get menu close
 
I wouldn't know the direct way of doing it, but heres how I would do it if all else fails. I would create a variable that is set to 1 when a menu is open, and have that variable on all menus, and when the menu shuts, switch that 1 to a 0. If the variable is at 0, then all menus are shut... Meh, =)

Rolnaaba 07-01-2006 23:33

Re: Get menu close
 
That is one way mystic but that would be pointless lol, to do anything upon the close of a menu you would have exec another func, before the menu closes EX:

when i choose to kick player BLAH, you would have to put in the source code for that menu that after kicking him and closing the menu to set_task(0.2, "FUNC_NAME").

that would start doing w/e you want to do when the menu closes, but to set a variable wouldnt do much to exec a function :P

TheNewt 07-01-2006 23:49

Re: Get menu close
 
I didn't say it was the best way, haha. :)

Hawk552 07-02-2006 10:36

Re: Get menu close
 
Quote:

Originally Posted by Rolnaaba
That is one way mystic but that would be pointless lol, to do anything upon the close of a menu you would have exec another func, before the menu closes EX:

when i choose to kick player BLAH, you would have to put in the source code for that menu that after kicking him and closing the menu to set_task(0.2, "FUNC_NAME").

that would start doing w/e you want to do when the menu closes, but to set a variable wouldnt do much to exec a function :P

That's retarded.

You'll have to hook every function that is the handle for each menu.

VEN 07-02-2006 11:30

Re: Get menu close
 
Do you want to catch the menu close moment? Is this for any menu?
If just check for menu needed this can be used
PHP Code:

/* Gets what menu the player is watching and what keys for menu he have.
* When there is no menu the index is 0. If the id is negative then the menu
* is VGUI in other case the id is from register_menuid() function. */
native get_user_menu(index,&id,&keys); 

You can loop this to catch menu close event, not a good way but then you do not have to register every menu.

WaZZeR++ 07-02-2006 15:46

Re: Get menu close
 
Thanks VEN.

Im going to make a menu que system, that will wait untill the curent menu is closed before it displays the new one....


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

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