04.08.2014, 02:48
It would be a little bit different.
Example:
And then to check the inputs:
Example:
pawn Код:
#define DIALOG_QUESTION1 1
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_QUESTION1:
{
if(response) // "Submit"
{
}
else // if "Cancel"
{
}
}
}
return 1;
}
public Somewhere()
{
ShowPlayerDialog(playerid, DIALOG_QUESTION1, DIALOG_STYLE_INPUT, "Questions", "How old are you?", "Submit", "Cancel");
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_QUESTION1:
{
if(response) // "Submit"
{
if(strval(inputtext))
{
new age = strval(inputtext);
if(age < 0 || age > 99) return ShowPlayerDialog(playerid, DIALOG_QUESTION1, DIALOG_TYLE_INPUT, "Questions", "Your age must go above 0 and below 99.");
}
else
{
ShowPlayerDialog(playerid, DIALOG_QUESTION1, DIAOG_STYLE_INPUT, "Questions", "Please enter an age.", "Submit", "Cancel");
}
}
else // if "Cancel"
{
}
}
}
return 1;
}