Raised This Month: $12 Target: $400
 3% 

[CS:GO] error MenuListHandler !!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 03-17-2018 , 08:45   [CS:GO] error MenuListHandler !!
Reply With Quote #1

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
    
}


Last edited by Dr.Mohammad; 03-17-2018 at 08:46.
Dr.Mohammad is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 03-17-2018 , 08:53   Re: [CS:GO] error MenuListHandler !!
Reply With Quote #2

only delete menu handle on MenuAction_End
don't delete it elsewhere
__________________
8guawong is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 03-17-2018 , 09:58   Re: [CS:GO] error MenuListHandler !!
Reply With Quote #3

Quote:
Originally Posted by 8guawong View Post
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
    
}

Dr.Mohammad is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 03-17-2018 , 10:07   Re: [CS:GO] error MenuListHandler !!
Reply With Quote #4

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);
hmmmmm is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 03-19-2018 , 15:25   Re: [CS:GO] error MenuListHandler !!
Reply With Quote #5

To clarify:

After any MenuAction_* messages the MenuAction_End is then called.
__________________
Neuro Toxin is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 03-20-2018 , 10:16   Re: [CS:GO] error MenuListHandler !!
Reply With Quote #6

solved:

thank you guys :X

PHP Code:

public int MenuListHandler(Menu menuMenuAction actionint param1int param2

if (
action == MenuAction_End
    { 
        
delete menu;
    } 

Dr.Mohammad is offline
Reply


Thread Tools
Display Modes

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 04:01.


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