random number help (phone system)
#1

PHP код:
HelloHelp please!
how I can make it how let the phone number begin with 0630?
pl
I buy the telephone and random number..
plnot 43222only 063043222
ie
0630 before phone numbers
    
else if(dialogid == DIALOG_TELEFONVETEL)
    {
        if(
response)
        {
            
GiveMoney(playerid, -30000true);
            
BizPenz(BIZ_24730000);
            new 
tipus;
            switch(
listitem)
            {
                case 
0tipus 20;
                case 
1tipus 30;
                case 
2tipus 70;
            }
              new 
randphone[64];
            
strmid(randphone,UjTeloSzam(tipus), 0strlen(UjTeloSzam(tipus)), 128);
            
strmid(PlayerInfo[playerid][pPnumber], randphone0,strlen(randphone), 128);
            
format(stringsizeof(string), "Megvetted a telefont, a szбmod: %s\n"randphone);
            
ShowPlayerDialog(playeridDIALOG_VESZDIALOG_STYLE_MSGBOX"24/7"string"Ok""Mйgse");
            
Cselekves(playerid"vett egy telefont / bought a phone"1);
            
BizzInfo[BIZ_247][bProducts]--;
        }
        
TogglePlayerControllable(playeridtrue);
    }
    else if(
dialogid == DIALOG_VESZ)
    {
        if(
response)
        {
            
listitem++;
            switch(
listitem)
            {
                case 
1:
                {
                    if(
GetMoney(playeridtrue) < 30000)
                    {
                        
format(stringsizeof(string), "Ezt nem tudom kifizetni\n---------------------\nI can't pay this\n");
                        
//format(gondolat, sizeof(gondolat), "%s gondolja...", PlayerName(playerid));
                        
ShowPlayerDialog(playeridDIALOG_VESZDIALOG_STYLE_MSGBOX,"Hiba"string"Ok""Mйgse");
                        
TogglePlayerControllable(playeridtrue);
                        return 
1;
                    }
                    
GiveMoney(playerid, -30000true);
                    
BizPenz(BIZ_24730000);
                    new 
randphone 10000 random(89999);
                    
PlayerInfo[playerid][pPnumber] = randphone;
                    
format(stringsizeof(string), "Megvetted a telefont, a szбmod: %d\n"randphone);
                    
ShowPlayerDialog(playeridDIALOG_VESZDIALOG_STYLE_MSGBOX"24/7"string"Ok""Mйgse");
                    
Cselekves(playerid"vett egy telefont / bought a phone"1);
                    
BizzInfo[BIZ_247][bProducts]--; 
Reply
#2

Can you put the script in pawn tags? It's hard to read it like this.
Reply
#3

ready
Reply
#4

pawn Код:
new
    phonenumber[10]

format(phonenumber, sizeof (phonenumber), "0630%i", RandomEx(10000, 99999));
pawn Код:
stock RandomEx(min, max)
{
    return random(max - min) + min;
}
Reply
#5

to write this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)