Completely Random License Plate?
#1

pawn Код:
#define     MAX_PASS        8
            new charset[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
            new newPass[MAX_PASS];
            for(new i = 0; i < MAX_PASS; i++)
            {
              newPass[i] = charset[RandomEx(0, sizeof(charset))]; // 62 = strlen of charset
            }


            format(plate, sizeof(plate), "%s",newPass);
This sometimes doesn't make it 8 characters, sometimes 1, sometimes 2. What's the issue here?
Reply


Messages In This Thread
Completely Random License Plate? - by Dokins - 11.12.2013, 22:44
Re: Completely Random License Plate? - by Jefff - 11.12.2013, 23:05
Re: Completely Random License Plate? - by Dokins - 11.12.2013, 23:12

Forum Jump:


Users browsing this thread: 1 Guest(s)