AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Run time error 4: index out of bounds [ BLOCKMAKER] (https://forums.alliedmods.net/showthread.php?t=206262)

danonix 01-20-2013 11:16

Run time error 4: index out of bounds [ BLOCKMAKER]
 
Hello,

Can you guys help me with this error? I have got no idea how to repair it. Thanks
Code:

L 01/20/2013 - 00:30:34: Start of error session.
L 01/20/2013 - 00:30:34: Info (map "de_inferno") (file "addons/amxmodx/logs/error_20130120.log")
L 01/20/2013 - 00:30:34: [AMXX] Displaying debug trace (plugin "BlockMaker1.amxx")
L 01/20/2013 - 00:30:34: [AMXX] Run time error 4: index out of bounds
L 01/20/2013 - 00:30:34: [AMXX]    [0] BlockMaker1_1062433.sma::plugin_precache (line 1008)

Code:

   
    for(new piosenki = 1 ; piosenki <= ILOSC_PIOSENEK ; piosenki++){
//1008//        precache_generic(gMuzyka[piosenki]);
    }
   
    precache_sound(gszNukeExplosion);
    precache_sound(gszXpSound);
}


fysiks 01-20-2013 13:43

Re: Run time error 4: index out of bounds [ BLOCKMAKER]
 
I'm guessing that you need to change the "<=" to "<". If that doesn't fix it, you need to attach the full plugin to your next post.

danonix 01-20-2013 16:53

Re: Run time error 4: index out of bounds [ BLOCKMAKER]
 
1 Attachment(s)
No, it doesnt work.

Here is .sma

Thanks Fysiks.

fysiks 01-20-2013 18:10

Re: Run time error 4: index out of bounds [ BLOCKMAKER]
 
Quote:

Originally Posted by danonix (Post 1877049)
No, it doesnt work.

FYI, that is the worst sentence that anybody can ever post on a forum to get help. What do you mean?

The fix I posted will absolutely fix the index out of bounds error at that particular spot.

Also, you should start at 0 instead of 1 if you want to precache all of those files. Plus, you should replace "ILOSC_PIOSENEK" with "sizeof(gMuzyka)".

danonix 01-21-2013 09:27

Re: Run time error 4: index out of bounds [ BLOCKMAKER]
 
Ok, I did everything like You said.

By saying "No it doesn't work" I mean that, so the problem still was there for next 30 minutes, later it stopped.

Thank you for help dude. Your awesome.

Cheers


All times are GMT -4. The time now is 13:24.

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