15.08.2014, 05:10
You could do it like this:
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == YourDialogID)
{
if(response)
{
if(!IsNumeric(inputtext)) return ShowPlayerDialog(playerid, YourDialogID, DIALOG_STYLE_INPUT, "Kick", "The ID entered was not valid", "Kick", "");
new targetid = strval(inputtext);//You can kick targetid if it's connected now.
if(targetid == INVALID_PLAYER_ID) return ShowPlayerDialog(playerid, YourDialogID, DIALOG_STYLE_INPUT, "Kick", "The ID entered was not valid", "Kick", "");
//the other stuff...
}
}
return 0;
}
IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0') return 0;
}
return 1;
}