Run time error 4: index out of bounds
1 Attachment(s)
Hi all,
I get the following amxx error : [AMXX] Displaying debug trace (plugin "adminmodx.amxx", version "0.9h") [AMXX] Run time error 4: index out of bounds [AMXX] [0] textRXNyAz.sma::eDeath (line 2584) Can someone have a quick look at the corresponding code and maybe spot something? I've also attached the complete sma in case that should be needed thx so much! and apologies if that's handled already/posted in wrong section 2578 /////////////////////////////////////////////////////////////////////////////////////// 2579 // 2580 // Will reset the things upon death 2581 // 2582 public eDeath() 2583 { 2584 g_buried[read_data(2)] = 0 2585 2586 if(task_exists((read_data(2)+1000))) 2587 { 2588 remove_task((read_data(2)+1000)) 2589 } 2590 } 2591 2592 /////////////////////////////////////////////////////////////////////////////////////// 2593 // |
Re: Run time error 4: index out of bounds
I'm not sure that's even possible because this message is only for when a player dies (i.e. the victim, read_data(2), should always be in the rang 1 to 32). You'll probably need to add some debugging code to see what value it actually being retrieved from read_data(2).
Replace the eDeath() function with this one: Code:
public eDeath() |
Re: Run time error 4: index out of bounds
You can call remove_task() without first checking task_exists(). task_exists() is really to be used if you need to know if a task exists, here you just want it removed.
PHP Code:
|
Re: Run time error 4: index out of bounds
Thank you Fysiks and Bugsy
I used the code given by bugsy , the following error was picked up (copypasted before and after) Quote:
Anyways, thx for having a look at it, dont worry too much about it! U. |
Re: Run time error 4: index out of bounds
It doesn't make any sense that you are getting an error on g_buried being its sized at 33. Did you modify anything?
And moved to scripting help |
Re: Run time error 4: index out of bounds
Quote:
|
Re: Run time error 4: index out of bounds
Thx Bugsy and Fysics, for taking some time on this
Bugsy, I did not modify anything, except of course for the php code u gave me. I can perhaps give more info about my actions? I downloaded the sma from this post on your forum: https://forums.alliedmods.net/showth...t=5412&page=52 (post #512, the final post) Then ive compiled the sma via your online amxmodx webcompiler Maybe i shudve used the original one from page 1? Fysics, Yes, ive looked at the normal amx log, but there were no errors in that one, just all the mapchanges and admins joining and of course all the deathmsgs debug lines. Ive attached the log in its complete form, shud you happen to be interested Thx you guys! -X- |
Re: Run time error 4: index out of bounds
File didnt seem to be attached, apologies*
It goes on like this : Quote:
|
Re: Run time error 4: index out of bounds
This should fix it:
PHP Code:
PHP Code:
|
Re: Run time error 4: index out of bounds
JusTGo, that seemed to have done the trick! Tysm!
Also a thx to Bugsy and fysics for looking into this and bringing it to the correct section. Ive tossed some $ in, to even the raised counter, pls dont put sponsor under my name thx you guys! -X- Well it seemed paypal took $2 lmao, dumb me, now its not even gg |
All times are GMT -4. The time now is 03:57. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.