17.06.2012, 00:15
Hey,
I'm looking to create something to ensure the license plates are totally unique. I have some code that I have been using here:
Right now ofcourse it tells me that 'randomplate' is not indexed.
error 033: array must be indexed (variable "randomplate")
I don't want to base it off vehicle ID's either. Can someone help me make this work? or propose a better solution?
BTW, It doesn't have the full alphabet because I dident want to see confusion between letters.
Cheers!
- James
I'm looking to create something to ensure the license plates are totally unique. I have some code that I have been using here:
pawn Код:
new LetterList[22][] =
{
"A", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "T", "U", "V", "W", "X", "Y", "Z"
};
for(new i = 0; i < MAX_VEHICLES; ++i)
{
while(vInfo[i][vPlate] == randomplate)
{
format(randomplate, sizeof(randomplate), "%d%d%d %s%s%s", random(9),random(9), random(9),LetterList[random(sizeof(LetterList))], LetterList[random(sizeof(LetterList))], LetterList[random(sizeof(LetterList))]);
}
}
error 033: array must be indexed (variable "randomplate")
I don't want to base it off vehicle ID's either. Can someone help me make this work? or propose a better solution?
BTW, It doesn't have the full alphabet because I dident want to see confusion between letters.
Cheers!
- James