Raised This Month: $ Target: $400
 0% 

Problem with menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
proffs
Senior Member
Join Date: Jul 2013
Old 07-15-2014 , 06:47   Problem with menu
Reply With Quote #1

Quote:
Run time error 4: index out of bounds
PHP Code:
public _mMainMenuHandleridiMenuiItem )
{
    
    if( !
UTIL_CanUseMenuid ) || iItem == MENU_EXIT )
    {
        return 
PLUGIN_HANDLED
    
}
    
    
menu_displayidg_iCategoriesMenuPointersiItem ] )
    
    return 
PLUGIN_HANDLED

I get this error on logs, it works fine anyway but I want to fix it somehow.

Last edited by proffs; 07-15-2014 at 06:47.
proffs is offline
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 07-15-2014 , 07:08   Re: Problem with menu
Reply With Quote #2

Show us the full code with the full error log
__________________
simanovich is offline
proffs
Senior Member
Join Date: Jul 2013
Old 07-15-2014 , 07:12   Re: Problem with menu
Reply With Quote #3

Quote:
Originally Posted by simanovich View Post
Show us the full code with the full error log
L 07/15/2014 - 02:47:43: Info (map "de_dust_igz") (file "addons/amxmodx/logs/error_20140715.log")
L 07/15/2014 - 02:47:43: [AMXX] Displaying debug trace (plugin "hnsshop.amxx", version "1.0")
L 07/15/2014 - 02:47:43: [AMXX] Run time error 4: index out of bounds
L 07/15/2014 - 02:47:43: [AMXX] [0] hnsshop.sma::_mMainMenuHandler (line 879)


PHP Code:
public _mcBlockidiMenuiItem )
{
    new 
szMenuName80 ], iTrash
    menu_item_getinfo
iMenuiItemiTrashszMenuName1szMenuNamecharsmaxszMenuName ), iTrash )
    
    
replace_allszMenuNamecharsmaxszMenmMainMenuHandleruName ), "\w""\d" )
    
    
menu_item_setnameiMenuiItemszMenuName )
    
    return 
ITEM_DISABLED
}

public 
_mMainMenuHandleridiMenuiItem )
{
    
    if( !
UTIL_CanUseMenuid ) || iItem == MENU_EXIT )
    {
        return 
PLUGIN_HANDLED
    
}
    
    
menu_displayidg_iCategoriesMenuPointersiItem ] )
    
    return 
PLUGIN_HANDLED


Last edited by proffs; 07-15-2014 at 07:12.
proffs is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-15-2014 , 07:13   Re: Problem with menu
Reply With Quote #4

My only guess is that the value of iItem exceeds the size of g_iCategoriesMenuPointers. But, that is just a guess since we don't have the complete code
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-15-2014 , 07:21   Re: Problem with menu
Reply With Quote #5

Show us your menu options and g_iCategoriesMenuPointers.

Last edited by HamletEagle; 07-15-2014 at 07:21.
HamletEagle 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 21:11.


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