Menu Staying On The Same Page After Selection?

I love this Fort spawner plugin for L4D2 (http://forums.alliedmods.net/showthread.php?t=129603). The only problem with it is that everytime you make a selection, it'll return you to the first page of that particular sub-menu. Now, I did some searching and some suggested using this

PHP Code:







DisplayMenuAtItem(menuparam1GetMenuSelectionPosition(), 60); 









But it didn't help at all, now instead returning to the first page of that particular sub-menu, it'll return to the top menu, and there is a error on the server console:

PHP Code:







L 11/13/2011 13:07:07: [SMNative "CloseHandle" reportedHandle 3250266 is invalid (error 3)

L 11/13/2011 13:07:07: [SMDisplaying call stack trace for plugin "fortspawner2.smx":

L 11/13/2011 13:07:07: [SM]   [0]  Line 616, /home/groups/sourcemod/upload_tmp/phpmgDih9.sp::MenuHandler_MostUsedMenu() 









Here is the part of the code that I think I need to somehow modify (you can download the whole plugin sourcecode from that link above):

PHP Code:







DisplayMostUsedMenu(client) {

    new 
Handle:menu CreateMenu(MenuHandler_MostUsedMenu);

    
SetMenuTitle(menu"Most Used");

//removed add menu items to save space on this quote

    
SetMenuExitBackButton(menutrue);

    
DisplayMenu(menuclientMENU_TIME_FOREVER);

}

public 
MenuHandler_MostUsedMenu(Handle:menuMenuAction:actionparam1param2)

{

    if (
action == MenuAction_End){

        
CloseHandle(menu);

    }

    else if (
action == MenuAction_Select){

        
decl String:info[128];

        
GetMenuItem(menuparam2infosizeof(info));

        
FakeClientCommand(param1info);

        
DisplayMenuAtItem(menuparam1GetMenuSelectionPosition(), 60);

    }

    else if (
action == MenuAction_Cancel){

        
DisplayMainBuildMenu(param1);

    }











So pretty much the only thing I changed was

PHP Code:







DisplayMostUsedMenu(param1); 









to

PHP Code:







DisplayMenuAtItem(menuparam1GetMenuSelectionPosition(), 60); 









Now obiously I'm very new to this whole scripting thing so any help would be greatly appreciated :)


Orignal From: Menu Staying On The Same Page After Selection?

No comments

Not a single link is allowed to submit in comment :o