AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [CS:GO] error MenuListHandler !! (https://forums.alliedmods.net/showthread.php?t=306125)

Dr.Mohammad 03-17-2018 08:45

[CS:GO] error MenuListHandler !!
 
hi guys!!

how to i fix this problem??
error:
HTML Code:

L 03/17/2018 - 16:07:46: [SM] Blaming: admin_list.smx
L 03/17/2018 - 16:07:46: [SM] Call stack trace:
L 03/17/2018 - 16:07:46: [SM]  [0] CloseHandle
L 03/17/2018 - 16:07:46: [SM]  [1] Line 80, admin_list.sp::MenuListHandler

cod:
PHP Code:

public Action ShowAdminsOnlineMenu(clientargs)
{
  
decl String:AdminName[MAX_NAME_LENGTH];
  
AdminListMenu CreateMenu(MenuListHandler);
  
SetMenuTitle(AdminListMenu"Admins Online:");
  for(new 
1<= GetMaxClients(); i++)
    {
      if(
IsClientInGame(i))
        {
          new 
AdminId:AdminID GetUserAdmin(i);
          if(
AdminID != INVALID_ADMIN_ID)
            {
              
GetClientName(iAdminNamesizeof(AdminName));
              
AddMenuItem(AdminListMenuAdminNameAdminName);
            }
        } 
    }
  
SetMenuExitButton(AdminListMenutrue);
  
DisplayMenu(AdminListMenuclient15);
  return 
Plugin_Handled;
}


public 
int MenuListHandler(Menu menuMenuAction actionint param1int param2)
{
    if (
action == MenuAction_Select)
    {
        
delete menu;
    }
    else if (
action == MenuAction_Cancel)
    {
        
delete menu;
    }
    else if (
action == MenuAction_End)
    {
        
delete menu;  //line 80
    
}



8guawong 03-17-2018 08:53

Re: [CS:GO] error MenuListHandler !!
 
only delete menu handle on MenuAction_End
don't delete it elsewhere

Dr.Mohammad 03-17-2018 09:58

Re: [CS:GO] error MenuListHandler !!
 
Quote:

Originally Posted by 8guawong (Post 2583370)
only delete menu handle on MenuAction_End
don't delete it elsewhere

i try again but no fixed error line 80:
PHP Code:

public int MenuListHandler(Menu menuMenuAction actionint param1int param2)
{
    if (
action == MenuAction_Select)
    {
     
CloseHandle(menu);
    }
    else if (
action == MenuAction_Cancel)
    {
    
CloseHandle(menu);
    }
    else if (
action == MenuAction_End)
    {
        
delete menu;  //line 80
    
}



hmmmmm 03-17-2018 10:07

Re: [CS:GO] error MenuListHandler !!
 
CloseHandle(menu); is the same as delete menu; (sort of)
They both dispose of the handle, what Squawong is saying is that you should only do that when the menu is ending, which is in MenuAction_End

So to fix your problem, remove those lines with CloseHandle(menu);

Neuro Toxin 03-19-2018 15:25

Re: [CS:GO] error MenuListHandler !!
 
To clarify:

After any MenuAction_* messages the MenuAction_End is then called.

Dr.Mohammad 03-20-2018 10:16

Re: [CS:GO] error MenuListHandler !!
 
solved:

thank you guys :X

PHP Code:


public int MenuListHandler(Menu menuMenuAction actionint param1int param2

if (
action == MenuAction_End
    { 
        
delete menu;
    } 




All times are GMT -4. The time now is 06:29.

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