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



error 032: array index out of bounds - newbienoob - 14.02.2013

I can't solve this problem...

pawn Код:
//at top
new gInvalidVehicles[18] = {
    407,425,432,435,447,450,464,476,520,584,590,591,601,606,607,608,610,611
};

//blablabla
if(vid == gInvalidVehicles[18]) return 0; //error 032: array index out of bounds (variable "gInvalidVehicles")
How to fix it?


Re: error 032: array index out of bounds - adsy - 14.02.2013

arrays start at 0, work from that.

gInvalidVehicles[18] will never exist as you have assigned the array between 0 and 17 (18 slots).


Re: error 032: array index out of bounds - InfiniTy. - 14.02.2013

--------------


Re: error 032: array index out of bounds - DaRk_RaiN - 14.02.2013

ez
pawn Код:
//at top
new gInvalidVehicles[19] = {
    407,425,432,435,447,450,464,476,520,584,590,591,601,606,607,608,610,611
};

//blablabla
if(vid == gInvalidVehicles[18]) return 0; //error 032: array index out of bounds (variable "gInvalidVehicles")



Re: error 032: array index out of bounds - newbienoob - 14.02.2013

I've fixed that. But I got another problem.

pawn Код:
new testtestestestest[] = {
    "text",
        "text1",
        "text2",
        "text3"
};

TextDrawCreate(106.399963, 194.133316, testtestestestest[]); //error 029: invalid expression, assumed zero



Re: error 032: array index out of bounds - M3mPHi$_S3 - 14.02.2013

Quote:
Originally Posted by newbienoob
Посмотреть сообщение
I've fixed that. But I got another problem.

pawn Код:
new testtestestestest[] = {
    "text",
        "text1",
        "text2",
        "text3"
};

TextDrawCreate(106.399963, 194.133316, testtestestestest[]); //error 029: invalid expression, assumed zero
Use it like and remove []
PHP код:
new Text:Textdraw1;
Textdraw1 TextDrawCreate(106.399963194.133316,, "testtsettser"); 



Re: error 032: array index out of bounds - newbienoob - 14.02.2013

I want all the "text, text1, text2, text3" in 1 textdraw.


Re: error 032: array index out of bounds - YoYo123 - 14.02.2013

Change the error line to:
pawn Код:
TextDrawCreate(106.399963, 194.133316, testtestestestest);



Re: error 032: array index out of bounds - newbienoob - 14.02.2013

No errors. But only "text" was shown.


Re: error 032: array index out of bounds - M3mPHi$_S3 - 14.02.2013

You cant make them all in one.