Using random
#1

Hi
I've currently got this code for phone numbers

{
//generate number
new number;
while(number == 0)
{
number = random(8999)+1000;
if(GetPlayerIDFromPhoneNumber(number) != INVALID_PLAYER_ID) number = 0;
}

is there any way I could change it so that all the numbers will have 444 in front of the random number? So they are like 4445562, 4442262 etc

Thanks
Matt
Reply
#2

pawn Код:
number = 4440000 + random(10000);
Reply
#3

ahh that makes sens

how come you've used random(1000) and not (8999)+1000?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)