AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem with menu (https://forums.alliedmods.net/showthread.php?t=244212)

proffs 07-15-2014 06:47

Problem with menu
 
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.

simanovich 07-15-2014 07:08

Re: Problem with menu
 
Show us the full code with the full error log

proffs 07-15-2014 07:12

Re: Problem with menu
 
Quote:

Originally Posted by simanovich (Post 2167945)
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



YamiKaitou 07-15-2014 07:13

Re: Problem with menu
 
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

HamletEagle 07-15-2014 07:21

Re: Problem with menu
 
Show us your menu options and g_iCategoriesMenuPointers.


All times are GMT -4. The time now is 21:11.

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