PDA

View Full Version : Help with variables prefixes?


ProjectGANTON
07/06/2012, 09:37 PM
Hello all, today i scripted my Telephone system.
But, now there's a problem!

When you buy a Phone, it makes you a number using randoms. (es: random(999999))
But, how do i make a prefix like 392?
So, when you buy a Phone, your cellnumber is 39299999 (for ex)

Example:
You have bought a Phone, now your cellnumber is 392581235

THANKS, and sorry for bad english but i am for Italy.

JhnzRep
07/06/2012, 09:42 PM
format(string, sizeof(string), "392%i", random);
PlayerInfo[playerid][PhoneNumber] = string;

Something like this.

admantis
07/06/2012, 10:01 PM
why not simply

3920000 + random( 10000 );

ProjectGANTON
07/06/2012, 10:27 PM
I prefer (if is that the correct verb, lol) the JhzRep method, but thanks admantis ^_^
Now, ill test it. You are Jenius peoples.