Date of birth in dialog (sscanf)
#1

Hi all.

I'm trying to create a registration process.
I'm encountering a problem when the player has to input the date of birth.
The date format should be DD/MM/YYYY, but when I insert like '30/09/1990' it gives 'NULL' result.
pawn Код:
Dialog:REGA1(playerid, response, listitem, inputtext[])
{
    new giorno, mese, anno, str[256];
    if(!response){Dialog_Show(playerid, REGA1, DIALOG_STYLE_INPUT, "Ufficio immigrazione", "Inserisci la tua data di nascita (GG/MM/YYYY)","Continua","");}
    if(response)
    {
        if(sscanf(inputtext, "p</>ddd", giorno, mese, anno))
        {
            format(Character[playerid][Data], 32, "%d/%d/%d", giorno, mese, anno);
What's wrong in here?
Reply
#2

sscanf returns 0 if the scanning was success so use
PHP код:
if(!sscanf(inputtext"p</>ddd"giornomeseanno)) 
Reply
#3

Quote:
Originally Posted by SyS
Посмотреть сообщение
sscanf returns 0 if the scanning was success so use
PHP код:
if(!sscanf(inputtext"p</>ddd"giornomeseanno)) 
Thank you very much for the fast answer, the problem is resolved.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)