SA-MP Forums Archive
Help with variables prefixes? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with variables prefixes? (/showthread.php?tid=349110)



Help with variables prefixes? - ProjectGANTON - 07.06.2012

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.


Re: Help with variables prefixes? - JhnzRep - 07.06.2012

pawn Код:
format(string, sizeof(string), "392%i", random);
PlayerInfo[playerid][PhoneNumber] = string;
Something like this.


Re: Help with variables prefixes? - admantis - 07.06.2012

why not simply

3920000 + random( 10000 );


Re: Help with variables prefixes? - ProjectGANTON - 07.06.2012

I prefer (if is that the correct verb, lol) the JhzRep method, but thanks admantis ^_^
Now, ill test it. You are Jenius peoples.