Raised This Month: $ Target: $400
 0% 

Solved Help error: Index out of bounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TudorLaLeagane
Junior Member
Join Date: Mar 2018
Old 01-23-2019 , 08:11   Help error: Index out of bounds
Reply With Quote #1

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)
Attached Files
File Type: zip Inventar.zip (2.1 KB, 35 views)

Last edited by TudorLaLeagane; 01-24-2019 at 03:06.
TudorLaLeagane is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 01-23-2019 , 11:53   Re: Help error: Index out of bounds
Reply With Quote #2

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.
__________________

Last edited by deprale; 01-23-2019 at 11:58.
deprale is offline
TudorLaLeagane
Junior Member
Join Date: Mar 2018
Old 01-23-2019 , 15:16   Re: Help error: Index out of bounds
Reply With Quote #3

Quote:
Originally Posted by deprale View Post
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...
TudorLaLeagane is offline
hitD
Junior Member
Join Date: May 2017
Location: Lithuania
Old 01-23-2019 , 16:14   Re: Help error: Index out of bounds
Reply With Quote #4

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;


Last edited by hitD; 01-23-2019 at 16:21. Reason: Whats the problems.
hitD is offline
TudorLaLeagane
Junior Member
Join Date: Mar 2018
Old 01-24-2019 , 03:06   Re: Help error: Index out of bounds
Reply With Quote #5

Quote:
Originally Posted by hitD View Post
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
TudorLaLeagane 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 07:37.


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