Maybe the menu has an error? Can you post your menu here?
Maybe the menu has an error? Can you post your menu here?
I tested it but its still the same problem.
It plays the sound but it doesnt open the menu..
wm_quickmessage.menu:
http://pastebin.com/1LUxk242
admin.menu:
http://pastebin.com/t4HhbRjM
As i said.. There cant be any errors in the menu's because if i just open them its working.
Its just not working with openMenu()
and show ur _menus with the parts we need
Code:onMenuResponse() { for(;;) { self waittill("menuresponse", menu, response); if(response == "admin") { if(self getGuid() == 0) { self closeMenu(); self closeInGameMenu(); self openMenu(game["menu_admin"]); self playLocalSound("granted"); } else { self closeMenu(); self closeInGameMenu(); self iprintlnbold("^1Access Denied!"); self playLocalSound("denied"); } }
Another thing you want to try is to play around with wait statements, add one between closing and opening the menu again and make sure the menu is really closed.
In the past I had the same problem and as I remmember I added a wait somewhere, sorry but I've lost my laptop yesterday and can't look up the actual code -.-
You could try to change the order in your execKey parameter:
instead of closing your menu first and then sending a response, send the menuresponse first.
execKey "8" { scriptMenuResponse "admin"; play "mouse_over"; close quickmessage; }
if a menuresponse occurs with a menu of "-1", as far as i can say from my expirience, in most cases an indicator of a not precached menu.
I also added a debug-sound in the response to see if it is properly triggered. You should also do something like this:
self waittill( "menuresponse" , menu , response );
iPrintLn( "Menu: " + menu + " Response: " + response );
as additional debug.
Last edited by serthy; 11th November 2013 at 19:13.
Ok, to stop this thread becoming too long, I jumped in and did some testing:
1. Using the admin menu you provided, and changing wm_quickmessage.menu's third button to an "admin" button, and using your menu waiter script in maps\mp\gametypes\_menus.gsc:
PHP Code:
onMenuResponse()
{
for( ;; )
{
self waittill( "menuresponse", menu, response );
if( response == "admin" )
{
if( self getGuid() == 0 )
{
self closeMenu();
self closeInGameMenu();
self openMenu( "admin" );
}
else
self iprintlnbold( "invalid menu" );
continue;
}
----------- snip --------------
This is what the result I got:
http://www.xfire.com/videos/61626c
2. As you can see, no problem opening the admin menu at all.
3. Conclusion:
You must be doing something wrong somewhere, or something else is preventing the menu opening.
Ok, the problem is solved..
The reason for the problem is simple..
Its not about quickmessage or quickcommands...
But i'm using menu files to check the FPS of a player.
To get it working i open it again and again..^^
If i remove this FPS check its working fine! :P
But now i have to get a new way to check the FPS for my custom hud... :'(
Thank you all <3