08.04.2017, 19:16
Hello guys, and maybe girls
I want to check on a dialog if the player wrote something in the dialog, how i can do that ?
And if somebody can modify it to sscanf..
I want to check on a dialog if the player wrote something in the dialog, how i can do that ?
And if somebody can modify it to sscanf..
pawn Код:
if(dialogid == DIALOG_REGAGE)
{
if(response)
{
format(input, sizeof(input), "%d", inputtext);
if(!IsNumeric(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGAGE, 1, "Registration Step 2:", "How old are you ?", "Next", "");
if(strval(inputtext) >= 7 || strval(inputtext) <= 50)
{
new age = strval(inputtext);
PlayerInfo[playerid][pAge] = age;
format(string, sizeof(string), "Ok, so you have %d years.", age);
SendClientMessage(playerid, COLOR_YELLOW2, string);
ShowPlayerDialog(playerid, DIALOG_REGSPAWN, 2, "Where do you want to be spawned ?", "Los Santos\nSan Fierro\nLas Venturas", "Select", "");
}
else
{
SendClientMessage(playerid, COLOR_YELLOW2, "Type numbers betwen 7 and 50.");
ShowPlayerDialog(playerid, DIALOG_REGAGE, 1, "Registration Step 2:", "How old are you ?", "Next", "");
}
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGAGE, 1, "Registration Step 2:", "How old are you ?", "Next", "");
}
return 1;
}