Vehicle License plate
#4

Quote:
Originally Posted by clavador
Посмотреть сообщение
pawn Код:
if( vehicleid < 10 ) format(string2,sizeof(string2),"00%i", vehicleid );
    else if( vehicleid < 100 ) format(string2,sizeof(string2),"0%i", vehicleid );
    else format(string2,sizeof(string2),"%i", vehicleid );
Can't believe that there are still people doing that. Just doing the following will make sure that the length of the number is always 3 characters long, padding it with zeros if it's not.

pawn Код:
format(string2,sizeof(string2),"%03i", vehicleid );
Reply


Messages In This Thread
Vehicle License plate - by DannySnoopy - 12.03.2012, 10:47
Re: Vehicle License plate - by DannySnoopy - 12.03.2012, 11:14
Re: Vehicle License plate - by clavador - 12.03.2012, 11:22
Re: Vehicle License plate - by Vince - 12.03.2012, 11:37
Re: Vehicle License plate - by DannySnoopy - 12.03.2012, 12:49
Re: Vehicle License plate - by Jonny5 - 12.03.2012, 14:02
Re: Vehicle License plate - by DannySnoopy - 12.03.2012, 14:17
Re: Vehicle License plate - by DannySnoopy - 12.03.2012, 14:58
Re: Vehicle License plate - by clavador - 12.03.2012, 18:05
Re: Vehicle License plate - by Jonny5 - 12.03.2012, 19:24

Forum Jump:


Users browsing this thread: 1 Guest(s)