Hab ich schnell aus einem LoH kopiert. Müsste alles Drin stehen.
if(dialogid == DIALOG_ALTER)
{
new year, month,day;
getdate(year, month, day);
new DateInfo[3][20];
split(inputtext, DateInfo, '.');
if(response == 1)
if (strlen(inputtext) > 10) {
ShowPlayerDialog(playerid,DIALOG_ALTER,DIALOG_STYLE_INPUT,"Geburtsdatum","ANGABEFEHLER:Bitte Gib dein Alter ein.\n\nBeispiel: 05.12.1995\n","Weiter","");
return 0;
}
if (!IsValidDate(strval(DateInfo[0]),strval(DateInfo[1]),strval(DateInfo[2]))) {
ShowPlayerDialog(playerid,DIALOG_ALTER,DIALOG_STYLE_INPUT,"Geburtsdatum","ANGABEFEHLER:Bitte Gib dein Alter ein.\n\nBeispiel: 05.12.1995\n","Weiter","");
return 0;
}
if(year - strval(DateInfo[2]) > 100 || strval(DateInfo[2]) < 1 || strval(DateInfo[2]) >= year)
{
ShowPlayerDialog(playerid,DIALOG_ALTER,DIALOG_STYLE_INPUT,"Geburtsdatum","ANGABEFEHLER:Bitte Gib dein Alter ein.\n\nBeispiel: 05.12.1995\n","Weiter","");
}
new check = year - strval(DateInfo[2]);
if(check == year)
{
ShowPlayerDialog(playerid,DIALOG_ALTER,DIALOG_STYLE_INPUT,"Geburtsdatum","ANGABEFEHLER:Bitte Gib dein Alter ein.\n\nBeispiel: 05.12.1995\n","Weiter","");
return 0;
}
if(strval(DateInfo[1]) > month)
{
check -= 1;
}
else if(strval(DateInfo[1]) == month && strval(DateInfo[0]) > day)
{
check -= 1;
}
new string[256];
PlayerInfo[playerid][pAge] = check;
format(string, sizeof(string), "%d Jahre alt.",PlayerInfo[playerid][pAge]);
GameTextForPlayer(playerid,string, 3000, 1);
RegistrationStep[playerid] = 3;
ShowPlayerDialog(playerid,DIALOG_HERKUNFT,DIALOG_STYLE_LIST,"Woher kommst du?","Deutschland\n�sterreich\nSchweiz","Weiter"," ");
if(response == 0){
ShowPlayerDialog(playerid,DIALOG_ALTER,DIALOG_STYLE_INPUT,"Geburtsdatum","ANGABEFEHLER:Wann bist du geboren?\nAngabe bitte in TT.MM.JJJJ","Weiter"," ");
}
return 1;
}
Bei Fragen: PN to me
Gruss: Sonic