SA-MP Forums Archive
Array index out of bounds - 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: Array index out of bounds (/showthread.php?tid=638735)



Array index out of bounds - raizo - 05.08.2017

FIXED. Close please.


Re: Array index out of bounds - ISmokezU - 05.08.2017

Attempted to read/write array element at index 818 in array of size 800

Maybe if you have this

PHP код:
#define MAX_HOUSES (800) 
Change it to:

PHP код:
#define MAX_HOUSES (1000) 



Re: Array index out of bounds - Vince - 05.08.2017

Do not use the primary key as the array index. Auto generated ids do not get re-used and as houses get added and removed those ids will eventually all exceed the array size.


Re: Array index out of bounds - raizo - 05.08.2017

Thank you both, it has been fixed. +REP