SA-MP Forums 4digit random number
 New Account Members List Search Today's Posts Mark Forums Read

 08/07/2012, 11:33 AM #1 dogman Big Clucker     Join Date: May 2010 Posts: 56 Reputation: 3 4digit random number Hi, I have made this script: Code: ```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 __________________
 08/07/2012, 11:40 AM #2 ReneG High-roller   Join Date: Oct 2011 Location: Sublime Text 2 Posts: 1,906 Reputation: 337 Re: 4digit random number 4 slots. The first random number is 3 digits. You get it? Only allow 1 digit numbers. EDIT: pawn Code: `for(new i=0;i<4;i++){      randnumber[i] = random(10);}` Will choose numbers 0-9 randomly.
 08/07/2012, 11:43 AM #3 dogman Big Clucker     Join Date: May 2010 Posts: 56 Reputation: 3 Re: 4digit random number you are right dum dum me :P __________________
 08/07/2012, 11:44 AM #4 clarencecuzz Gangsta   Join Date: Jul 2010 Location: Australia Posts: 928 Reputation: 92 Re: 4digit random number EDIT: Too late
 08/07/2012, 12:05 PM #5 Stylock Huge Clucker     Join Date: Dec 2010 Posts: 315 Reputation: 155 Re: 4digit random number Random four digit number Code: `random(8999) + 1000`

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post henry jiggy Help Archive 3 10/08/2011 10:59 PM CyNiC Includes 10 23/07/2011 01:45 PM THE_KNOWN Help Archive 7 18/01/2011 12:14 PM hipy Help Archive 3 23/07/2009 08:50 PM Robbin237 Help Archive 2 26/02/2009 06:26 PM

All times are GMT. The time now is 12:50 AM.

 -- (EN) English -- (RU) Русски SA-MP - Archive - Top