AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Help error: Index out of bounds (https://forums.alliedmods.net/showthread.php?t=313803)

TudorLaLeagane 01-23-2019 08:11

Help error: Index out of bounds
 
1 Attachment(s)
Code:

L 01/23/2019 - 10:10:32: [AMXX] Displaying debug trace (plugin "DRSHOP.amxx", version "3.9.Not-Stable")
L 01/23/2019 - 10:10:32: [AMXX] Run time error 4: index out of bounds
L 01/23/2019 - 10:10:32: [AMXX]    [0] inventar.inl::SkinMenu (line 158)

Here is the error, i have included the file that has the code.

The file has 3 menus, each menu returns the same error when pressed 0 (Exit Menu withouth chosing an option)

deprale 01-23-2019 11:53

Re: Help error: Index out of bounds
 
Line 174 destroys the menu completely, it will not show up anymore, you'll have to reload the plugin to be able to see the menu again.

Instead, use:
PHP Code:

show_menu(id0"^n"1); 

Can't help you with the other issue, can't spot the error tbh.

TudorLaLeagane 01-23-2019 15:16

Re: Help error: Index out of bounds
 
Quote:

Originally Posted by deprale (Post 2636217)
Line 174 destroys the menu completely, it will not show up anymore, you'll have to reload the plugin to be able to see the menu again.

Instead, use:
PHP Code:

show_menu(id0"^n"1); 

Can't help you with the other issue, can't spot the error tbh.

Thanks for the tip, but it still doesn't solve my problem...

hitD 01-23-2019 16:14

Re: Help error: Index out of bounds
 
You could try adding these lines in beggining of menu handlers. As u still go threw all the functions and the array cant have negative index(the exit is negative number).So u need to stop it.
PHP Code:

if(item == MENU_EXIT)
{
menu_destroy(Menu)
return 
PLUGIN_HANDLED;



TudorLaLeagane 01-24-2019 03:06

Re: Help error: Index out of bounds
 
Quote:

Originally Posted by hitD (Post 2636275)
You could try adding these lines in beggining of menu handlers. As u still go threw all the functions and the array cant have negative index(the exit is negative number).So u need to stop it.
PHP Code:

if(item == MENU_EXIT)
{
menu_destroy(Menu)
return 
PLUGIN_HANDLED;



Thanks! It wors


All times are GMT -4. The time now is 07:37.

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