SA-MP Forums Archive
Dm Server - 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: Dm Server (/showthread.php?tid=576867)



Dm Server - Ugaustin - 07.06.2015

I made a new phonenumber thingy.. and I wanted the first 3 numbers to be 003 and then the player to decide 7 numbers .. and then if phone number is taken to appear "phone number taken" .. so we writes 7 numbers.. and first 3 official numbers for all..


PHP код:
if(dialogid == DIALOG_PNUM)
                    {
                        if(
response)
                        {
                            new 
lengh strval(inputtext);
                            if(
lengh && lengh 8)
                            {
                                
format(string,256,"Ok, Your Number is [%d].",lengh);
                                
SendClientMessage(playerid,COLOR_ORANGE,string);
                                
PlayerInfo[playerid][pPnumber] = lengh;
                                
ShowPlayerDialog(playerid,DIALOG_PNUM,DIALOG_STYLE_INPUT,"PhoneNumber","Write your phonenumber!","Ok","");
                            }
                            else return 
ShowPlayerDialog(playerid,DIALOG_PNUM,DIALOG_STYLE_INPUT,"PhoneNumber","Write your phonenumber!","Ok","");
                        }
                    } 



Re: Dm Server - Konstantinos - 07.06.2015

Have your variable (integer) to store only the 7 digits and you can add "003" in the format.

PHP код:
new num strval(inputtext);
if(
num && strlen(inputtext) == 7)
{
    
format(string40"Ok, Your Number is [003%07d]."num);
    
SendClientMessage(playerid,COLOR_ORANGE,string);
    
PlayerInfo[playerid][pPnumber] = num;

and also have "%07d" so if the player enters 0 as a first digit, it will add the 0 to the message but not in the variable.


Re: Dm Server - Ugaustin - 07.06.2015

at playerstats I see only 1000000 and I don't see 003..


Re: Dm Server - Ugaustin - 07.06.2015

bump


Re: Dm Server - Ugaustin - 07.06.2015

but what can I do people will type same number.. I need to make so people cant put same number.. but I don't know how.. anyone please?


Re: Dm Server - JaydenJason - 07.06.2015

Did you format it in the stats like the [003%07d] as well?


Re: Dm Server - Ugaustin - 07.06.2015

yes that was solved.. but people can have same phone number.. and really buggy..