4digit random number
#1

Hi,
I have made this script:
Код:
carId = AddStaticVehicleEx(vehicletype,SpawnX,SpawnY,SpawnZ,SpawnRot,Color1,Color2,(30*60)); 
for(new i=0;i<4;i++)
{
      randnumber[i] = random(9999);
}
format(numplate_test,32,"{F81414}TL{000000}%d",randnumber[1]);
SetVehicleNumberPlate(carId, numplate_test);
This will output a number plate like: TL(4 digit number)
but in some cases it will output only 1,2 or 3 digits
I don't no what i am doing wrong help me
Reply
#2

4 slots.

The first random number is 3 digits.

You get it?

Only allow 1 digit numbers.

EDIT:
pawn Код:
for(new i=0;i<4;i++)
{
      randnumber[i] = random(10);
}
Will choose numbers 0-9 randomly.
Reply
#3

you are right dum dum me :P
Reply
#4

EDIT: Too late
Reply
#5

Random four digit number
Код:
random(8999) + 1000
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)