SA-MP Forums Archive
Dialog inputtext problem - 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: Dialog inputtext problem (/showthread.php?tid=417551)



Dialog inputtext problem - Mystique - 21.02.2013

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);}
	}



Re: Dialog inputtext problem - Mystique - 21.02.2013

Lol I just found the silly problem, I don't need any answers.... :P