} 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); // format(string, sizeof(string), "Ok, so you are %d year old.",PlayerInfo[playerid][pAge]); // SendClientMessageEx(playerid, COLOR_YELLOW2, string); SendClientMessageEx(playerid, COLOR_WHITE, "SERVER: Please re-connect to the server to complete the registeration process."); return 0; } return 0; |