15.10.2011, 00:49
HELP!!
I can't even explain it, here is my code:
Then, try it out by:
Spent so much time trying to solve this... just can't.
I can't even explain it, here is my code:
Код:
#define LICENSE_PLATE_LENGTH 7
stock GeneratePlate(vehicleid)
{
new licenseplate[LICENSE_PLATE_LENGTH],
numberstr[5], len;
format(numberstr, 5, "%d", vehicleid);
len = strlen(numberstr);
for(new c; c < LICENSE_PLATE_LENGTH; c++)
{
if(c > 1 && c <= 1 + len)
{
licenseplate[c] = numberstr[c - 2];
}
else switch©
{
case 0, 1: licenseplate[c] = random('Z' - 'A') + 'A';
default: licenseplate[c] = random('9' - '0') + '0';
}
}
print(licenseplate);
return licenseplate;
}
Код:
public OnGameModeInit()
{
for(new i; i < 100; i++) GeneratePlate(i);


