SA-MP Forums Archive
Errors in debug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Errors in debug (/showthread.php?tid=533599)



Errors in debug - deimantas1 - 25.08.2014

Hello, when player connecting to server, in console write errors:

Quote:

[15:25:13] [debug] Run time error 4: "Array index out of bounds"
[15:25:13] [debug] Accessing element at index 65535 past array upper bound 1999
[15:25:13] [debug] AMX backtrace:
[15:25:13] [debug] #0 0014d090 in ?? (0x00000000, 0x00000003, 0x00000000) from samp.amx
[15:25:13] [debug] #1 0014cad4 in public AutomobiliuKrovimas (0x00000000) from samp.amx
[15:25:13] [debug] #2 00062a24 in public OnPlayerSpawn (0x00000000) from samp.amx

What's can be problem?


Re : Errors in debug - S4t3K - 25.08.2014

It's explicit enough, isn't it ?

You try to access an element in your array at index 65535 whereas your array's size is 2000 and thus the upper bound is 1999.


Re: Errors in debug - HazardouS - 25.08.2014

If you're doing something like
pawn Код:
vehicle = CreateVehicle(<params>);

VehicleColor[vehicle] = 0;
keep in mind that you should check if "vehicle" is not 65535, i.e. the vehicle has been created successfully. Otherwise you will do something like VehicleColor[65535] = 0; which is out of bounds.