Cellphone
#1

how can i make so if i get a phonebook all numbers start with 750XXXXXXX?all numbers?so at start i dont want a phonebook but if i buy a phone book i get a number 750XXXXXXX..this is the buy..


PHP код:
    if (item == && GetPlayerCash(playerid) > 500)
                {
                    if(
PlayerInfo[playerid][pTraderPerk] > 0)
                    {
                        new 
skill 500 100;
                        new 
price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
                        new 
payout 500 price;
                        
format(stringsizeof(string), "~r~-$%d"payout);
                        
GameTextForPlayer(playeridstring50001);
                        
GivePlayerCash(playerid,- payout);
                        
SBizzInfo[9][sbTill] += payout;
                        
ExtortionSBiz(9payout);
                    }
                    else
                    {
                        
format(stringsizeof(string), "~r~-$%d"500);
                        
GameTextForPlayer(playeridstring50001);
                        
GivePlayerCash(playerid,-500);
                        
SBizzInfo[9][sbTill] += 500;
                        
ExtortionSBiz(9500);
                    }
                    
PlayerPlaySound(playerid10520.00.00.0);
                    new 
randphone 1000000 random(8999999);//minimum 1000  max 9999
                    
PlayerInfo[playerid][pPnumber] = randphone;
                    
format(stringsizeof(string), "   Mobile Phone Purchased your new Number is %d"randphone);
                    
SendClientMessage(playeridCOLOR_GRAD4string);
                    
SendClientMessage(playeridCOLOR_GRAD5"You can check this anytime by Typing /stats");
                    
SendClientMessage(playeridCOLOR_WHITE"HINT: You can now type /help to see your cell phone commands.");
                    return 
1;
                } 
Reply
#2

Math.

Код:
750000+random(999)
Reply
#3

just that?:O
Reply
#4

Just that.
Reply
#5

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
Math.

Код:
750000+random(999)
but it gave me a number of 750XXXX?i want the total of 10 numbers..
Reply
#6

A little bit biger but..
7500000000+random(9999999)
Maxim number will be 7509999999
Reply
#7

Quote:
Originally Posted by TzAkS.
Посмотреть сообщение
A little bit biger but..
7500000000 + random(9999999)
Maxim number will be 7509999999
like this?
new randphone = 7500000000 + random(9999999);//minimum 1000 max 9999
Reply
#8

Yes,will make a random for 0000000 and 750 will be intact.
Reply
#9

the phone number gives me an -323423423 a phone number :O
Reply
#10

no work..i get 10000000 big numbers..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)