Results 1 to 10 of 20

Thread: openMenu not working

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Why not just use the quickmessage menu to open the admin menu?

    Code:
    execKey "8" { close quickmessage; open admin }
    Then, monitor if the admin menu is open:

    Code:
    if( menu == "admin")
    {
    	if(self getGuid() == 0)
    	{
    		self playLocalSound("granted");
    		self openMenu(game["menu_admin"]);
    	}
    	else
    	{
    		self iprintlnbold("^1Access Denied!");
    		self playLocalSound("denied");
    	}
    			
    	continue;
    }
    Seems a lot easier than all this messing around trying to get openMenu() to work.

    NB - make sure your admin.menu has the menu item name of "admin". The item script name is what the engine looks for. Not the name of the menu file.
    Last edited by Tally; 11th November 2013 at 00:56.

  2. #2
    Private
    Join Date
    Oct 2013
    Posts
    48
    Thanks
    10
    Thanked 4 Times in 2 Posts
    Quote Originally Posted by IzNoGoD View Post
    Are you sure the menu you're calling this from is the quickmessage menu?

    Also, are you sure the menu is precached? have you checked the client's console for any errors concerning .menu files?
    Yes, its preached and its called from wm_quickmessage.menu
    Its working if i use:
    execKey "8" { close quickmessage; open admin }
    But its not working if i use
    execKey "8" { close quickmessage; scriptMenuResponse "admin" }
    There are no errors in the console and yes i'm using developer 1

    Quote Originally Posted by Tally View Post
    Why not just use the quickmessage menu to open the admin menu?

    Code:
    execKey "8" { close quickmessage; open admin }
    Then, monitor if the admin menu is open:

    Code:
    if( menu == "admin")
    {
    	if(self getGuid() == 0)
    	{
    		self playLocalSound("granted");
    		self openMenu(game["menu_admin"]);
    	}
    	else
    	{
    		self iprintlnbold("^1Access Denied!");
    		self playLocalSound("denied");
    	}
    			
    	continue;
    }
    Seems a lot easier than all this messing around trying to get openMenu() to work.

    NB - make sure your admin.menu has the menu item name of "admin". The item script name is what the engine looks for. Not the name of the menu file.
    Of course i could use it like this but i want that it cant be opened if you dont have the right guid.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •