Unique Licence Plates
#1

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:

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))]);
      }
}
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
Reply


Messages In This Thread
Unique Licence Plates - by jamesb93 - 17.06.2012, 00:15
Re: Unique Licence Plates - by Aira - 17.06.2012, 03:57
Re: Unique Licence Plates - by jamesb93 - 17.06.2012, 14:05
Re: Unique Licence Plates - by jamesb93 - 17.06.2012, 16:25
Re: Unique Licence Plates - by Kindred - 17.06.2012, 16:40
Re: Unique Licence Plates - by jamesb93 - 17.06.2012, 16:42
Re: Unique Licence Plates - by jamesb93 - 17.06.2012, 18:16
Re: Unique Licence Plates - by Babul - 17.06.2012, 20:41
Re: Unique Licence Plates - by jamesb93 - 17.06.2012, 20:42
Re: Unique Licence Plates - by SuperViper - 18.06.2012, 02:06

Forum Jump:


Users browsing this thread: 1 Guest(s)