Raised This Month: $ Target: $400
 0% 

Close Menu On Death


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
IcannotScript
Junior Member
Join Date: Nov 2016
Old 11-12-2017 , 03:11   Close Menu On Death
Reply With Quote #1

How would I close a menu on clients death? Cant seem to fix this without checking IsPlayerAlive everytime a menu option is selected? Is there any easier way? Cheers
IcannotScript is offline
Dr.Doctor
AlliedModders Donor
Join Date: Feb 2017
Location: Hong Kong
Old 11-12-2017 , 03:36   Re: Close Menu On Death
Reply With Quote #2

Create another menu that is
PHP Code:
menu.Display(client0); 
Then trigger it when player death?
__________________
Dr.Doctor is offline
Vaggelis
Senior Member
Join Date: May 2017
Old 11-12-2017 , 04:50   Re: Close Menu On Death
Reply With Quote #3

https://sm.alliedmods.net/new-api/me...ncelClientMenu
Vaggelis is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 11-12-2017 , 05:03   Re: Close Menu On Death
Reply With Quote #4

Quote:
Originally Posted by Dr.Doctor View Post
Create another menu that is
PHP Code:
menu.Display(client0); 
Then trigger it when player death?
...this won't do what you expect. If you want a hint as to why, I'm going to leave this bit from menus.inc:

Code:
#define MENU_TIME_FOREVER		0		/**< Menu should be displayed as long as possible */
It'd probably be better to pair what Vaggelis said while tracking whether the client has already closed the menu or not (A client manually closing a menu shows up as a MenuAction_Cancel in the menu handler with the reason as MenuCancel_Exit ).
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 11-12-2017 at 05:06.
Powerlord is offline
IcannotScript
Junior Member
Join Date: Nov 2016
Old 11-14-2017 , 04:22   Re: Close Menu On Death
Reply With Quote #5

Quote:
Originally Posted by Powerlord View Post
...this won't do what you expect. If you want a hint as to why, I'm going to leave this bit from menus.inc:

Code:
#define MENU_TIME_FOREVER		0		/**< Menu should be displayed as long as possible */
It'd probably be better to pair what Vaggelis said while tracking whether the client has already closed the menu or not (A client manually closing a menu shows up as a MenuAction_Cancel in the menu handler with the reason as MenuCancel_Exit ).
Cheers Figured it out
IcannotScript 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 12:43.


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