18.05.2013, 10:32
Well, I was trying to test a script and was registering, it asked me if I was male or female, I answered that..
Then it asked:
"When were you born? ( use dd/mm/yyyy )"
I wrote: "01/01/1990" but it said that it was invalid.. And sometimes it doesnt say anything only my timestamp..
Then it asked:
"When were you born? ( use dd/mm/yyyy )"
I wrote: "01/01/1990" but it said that it was invalid.. And sometimes it doesnt say anything only my timestamp..
Код:
if(RegistrationStep[playerid] > 0) { if(RegistrationStep[playerid] == 1) { if (strcmp("male", text, true) == 0) { SetPlayerPos(playerid,1830.803,-1731.561,5203.459); PlayerInfo[playerid][pSex] = 1; SendClientMessageEx(playerid, COLOR_PURPLE, "** Immigration writes your gender on a paper **"); SendClientMessageEx(playerid, COLOR_WHITE, "[IMMIGRATION] When were you born? (Use dd/mm/yyyy)"); RegistrationStep[playerid] = 2; return 0; } else if (strcmp("female", text, true) == 0) { SetPlayerPos(playerid,1830.803,-1731.561,5203.459); PlayerInfo[playerid][pSex] = 2; SendClientMessageEx(playerid, COLOR_PURPLE, "** Immigration writes your gender on a paper **"); SendClientMessageEx(playerid, COLOR_WHITE, "[IMMIGRATION] When were you born? (Use dd/mm/yyyy)"); RegistrationStep[playerid] = 2; return 0; } else { SendClientMessageEx(playerid, COLOR_LIGHTRED, "____________________________________________________"); SendClientMessageEx(playerid, COLOR_REALRED, "ERROR: You did not type in either 'male' or 'female'"); SendClientMessageEx(playerid, COLOR_WHITE, "[IMMIGRATION] Are you a male or female?"); SendClientMessageEx(playerid, COLOR_LIGHTRED, "____________________________________________________"); } return 0; } else if(RegistrationStep[playerid] == 2) { new year, month,day; getdate(year, month, day); new DateInfo[3][20]; splits(text, DateInfo, '/'); if(year - strval(DateInfo[2]) > 100 || strval(DateInfo[2]) < 1 || strval(DateInfo[2]) >= year) { SendClientMessageEx(playerid, COLOR_LIGHTRED, "____________________________________________________"); SendClientMessageEx(playerid, COLOR_REALRED, "ERROR: Fix Your Date of Birth"); SendClientMessageEx(playerid, COLOR_WHITE, "[IMMIGRATION] When were you born? (Use dd/mm/yyyy)"); SendClientMessageEx(playerid, COLOR_LIGHTRED, "____________________________________________________"); return 0; } new check = year - strval(DateInfo[2]); if(check == year) { SendClientMessageEx(playerid, COLOR_LIGHTRED, "____________________________________________________"); SendClientMessageEx(playerid, COLOR_REALRED, "ERROR: Wrong Date of Birth Format"); SendClientMessageEx(playerid, COLOR_WHITE, "[IMMIGRATION] When were you born? (Use dd/mm/yyyy)"); SendClientMessageEx(playerid, COLOR_LIGHTRED, "____________________________________________________"); return 0; } if(strval(DateInfo[1]) > month) { check -= 1; } else if(strval(DateInfo[1]) == month && strval(DateInfo[0]) > day) { check -= 1; } PlayerInfo[playerid][pAge] = check; PlayerInfo[playerid][pOrigin] = 0; ClearChatbox(playerid);