numberplate messing with array
#1

Hi there

I have a little concern about the car number plate system.
Code:
Код:
new Letters[26][] =
{
    "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"
};
new string[10];
format( string, sizeof( string ), "%s%s%s %d%d%d", Letters[random(sizeof(Letters))], Letters[random(sizeof(Letters))], Letters[random(sizeof(Letters))], random(10), random(10), random(10) );
		CarInfo[CarID][cRegistration] = string;
Error: error 047: array sizes do not match, or destination array is too small
and error line: CarInfo[CarID][cRegistration] = string;
Reply
#2

Quote:

Letters[26]

remove the extra brackets
Reply
#3

And now errors:
error 018: initialization data exceeds declared size
Код:
new Letters[26] =
{
    "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"
};
error 047: array sizes do not match, or destination array is too small
Код:
CarInfo[CarID][cRegistration] = string;
Reply
#4

Yeah, the other error are gone but...
error 047: array sizes do not match, or destination array is too small
and line are still same.
Код:
CarInfo[CarID][cRegistration] = string;
Reply
#5

Код:
format( string, sizeof( string ), "%s%s%s %d%d%d", Letters[random(sizeof(Letters))], Letters[random(sizeof(Letters))], Letters[random(sizeof(Letters))], random(10), random(10), random(10) );
CarInfo[CarID][cRegistration] = string;
Mean that?
Reply
#6

Yeah, now is alright.
I change the format little bit and done.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)