How to check what a player wrote in a dialog
#4

You could do it like this:
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == YourDialogID)
    {
        if(
response)
        {
            if(!
IsNumeric(inputtext)) return  ShowPlayerDialog(playeridYourDialogIDDIALOG_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(playeridYourDialogIDDIALOG_STYLE_INPUT"Kick""The ID entered was not valid""Kick""");
            
//the other stuff...
        
}
    }
    return 
0;
}
IsNumeric(const string[])
{
        for (new 
0strlen(string); ji++)
        {
                if (
string[i] > '9' || string[i] < '0') return 0;
        }
        return 
1;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)