Raised This Month: $ Target: $400
 0% 

Close menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
marquezs
Member
Join Date: Jun 2010
Old 08-17-2010 , 11:18   Close menu
Reply With Quote #1

I think the solution is pretty easy but I'm new to pawn and I have no idea on how to do this.

My problem is the following: I have a menu that is only for terrorist and it shows up automatically when terrorist connect, and when terrorist are AFK the menu remains open and every round the teams change and the guy who was in T team, has the menu open and can use the optins in CT and he shouldnt.

I think I can do this thing closing the menu in an event round end but how do I check for a menu that is open or how do I close it?

Thanks

If you didn't undesrtand my problem say so thatt I will try to explain better
marquezs is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-17-2010 , 11:51   Re: Close menu
Reply With Quote #2

You can show them an empty menu, or try client_cmd(0, "slot 0"); or whatever the 0 key is binded to.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-17-2010 , 18:29   Re: Close menu
Reply With Quote #3

Quote:
Originally Posted by drekes View Post
You can show them an empty menu, or try client_cmd(0, "slot 0"); or whatever the 0 key is binded to.
1. Slots are designated with the word "slot" immediately followed by a number. E.g. slot1, slot2
1a. slot0 does not exist.
2. It must be one of the slot# commands. If your zero (0) key is bound to anything other than "slot10" then that key will not work for any menu.

Therefore you can use the command "slot10" to remove the menu.
__________________
fysiks is offline
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 08-17-2010 , 18:30   Re: Close menu
Reply With Quote #4

If you just did menu_destroy(menu) would that do the trick if you created the menu in a global variable?
RedRobster is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-17-2010 , 18:32   Re: Close menu
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
1. Slots are designated with the word "slot" immediately followed by a number. E.g. slot1, slot2
1a. slot0 does not exist.
2. It must be one of the slot# commands. If your zero (0) key is bound to anything other than "slot10" then that key will not work for any menu.

Therefore you can use the command "slot10" to remove the menu.
Thanks for clearing that up. As i said, i wasn't sure what the command was.

Quote:
Originally Posted by RedRobster View Post
If you just did menu_destroy(menu) would that do the trick if you created the menu in a global variable?
Yeah, that should work too.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-17-2010 , 18:33   Re: Close menu
Reply With Quote #6

Quote:
Originally Posted by RedRobster View Post
If you just did menu_destroy(menu) would that do the trick if you created the menu in a global variable?
I don't believe so. I'm sure it's been tried before because this "removing the menu from the screen" issue has come up numerous times. You could always test it though!
__________________
fysiks is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-17-2010 , 19:13   Re: Close menu
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
I don't believe so. I'm sure it's been tried before because this "removing the menu from the screen" issue has come up numerous times. You could always test it though!
Gonna do that, will reply in abou 10-15 minutes

menu_destroy doesn't work like you said. client_cmd(id, "slot10"); works well.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.

Last edited by drekes; 08-17-2010 at 19:22.
drekes is offline
Send a message via MSN to drekes
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-17-2010 , 19:15   Re: Close menu
Reply With Quote #8

Also, adding a team check in the actual menu handler itself might not be a bad idea in case the menu manages to stay open somehow!
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX 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 22:01.


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