21.02.2013, 17:49
Honestly I can't believe I'm stuck on this but can anyone answer what's wrong here? When I wrote 1 in my gamemode it just told me my age is 1 and that I can start roleplaying, I need it to tell me if the age is not valid.
Code:
if(dialogid == DIALOG_AGE){ new file[256], string[128]; new age = strval(inputtext); if(response){ if(age < 100){ format(string, sizeof(string), "[Age] You have chosen your age to be %d.", age); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); dini_IntSet(file,"Age",age); PlayerInfo[playerid][Age] = age; ShowPlayerDialog(playerid, DIALOG_READY,0, "You are ready", "You are now ready to go roleplaying \n on this server, remember to follow the \n server rules.", "Confirm", "Decline"); } else if(age > 17){ format(string, sizeof(string), "[Age] You have chosen your age to be %d.", age); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); dini_IntSet(file,"Age",age); PlayerInfo[playerid][Age] = age; ShowPlayerDialog(playerid, DIALOG_READY,0, "You are ready", "You are now ready to go roleplaying \n on this server, remember to follow the \n server rules.", "Confirm", "Decline"); } else{ ShowPlayerDialog(playerid, DIALOG_AGE,1, "Age", "Invalid age, please choose your age \n between 18 and 99!", "Confirm", "Quit"); } } else{Kick(playerid);} }