18.01.2010, 07:27
It's an input type dialog, which would return into the 'inputtext' variable (which is a string, not an integer).
Use this as it's a hell of a lot neater and your problem is fixed:
Use this as it's a hell of a lot neater and your problem is fixed:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1 && response)
{
new age = strval(inputtext);
if(strlen(inputtext) < 1 && !IsNumeric(inputtext))
{
SendClientMessage(playerid, COLOR_RED, "You must enter a numeric string!");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Please enter your characters age", "Please enter your characters' age!" , "Continue", "Cancel");
}
else
{
if(age < 120 || age >= 1)
{
new string[128];
PlayerInfo[playerid][pAge] = age;
format(string, sizeof(string), "Hooray! Your age has been set to %d!", age);
SendClientMessage(playerid, COLOR_RED, string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You must enter an age, from between 1 to 120!");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Please enter your characters age", "Please enter your characters' age!" , "Continue", "Cancel");
}
}
}
return 1;
}