error 032: array index out of bounds
#1

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?
Reply
#2

arrays start at 0, work from that.

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

--------------
Reply
#4

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")
Reply
#5

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
Reply
#6

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"); 
Reply
#7

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

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

No errors. But only "text" was shown.
Reply
#10

You cant make them all in one.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)