Date of birth in dialog (sscanf) - 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: Date of birth in dialog (sscanf) (
/showthread.php?tid=658104)
Date of birth in dialog (sscanf) -
alanhutch - 23.08.2018
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?
Re: Date of birth in dialog (sscanf) -
SyS - 23.08.2018
sscanf returns 0 if the scanning was success so use
PHP код:
if(!sscanf(inputtext, "p</>ddd", giorno, mese, anno))
Re: Date of birth in dialog (sscanf) -
alanhutch - 23.08.2018
Quote:
Originally Posted by SyS
sscanf returns 0 if the scanning was success so use
PHP код:
if(!sscanf(inputtext, "p</>ddd", giorno, mese, anno))
|
Thank you very much for the fast answer, the problem is resolved.