Geting the player's ID from inputtext
#1

How to get the player ID from the Dialog Response inputtext?
Reply
#2

pawn Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Login", "Enter your password below:", "Login", "Cancel");

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
    {
      if(dialogid == 1)
      {
        // do something
        printf("PlayerID %d clicked on dialog 1", playerid);
        }
    }
    return 1;
}
Is this what you mean?

Reply
#3

No like, whatever ID I enter in the inputtext, it sends him a certain message.
Reply
#4

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
    {
      if(dialogid == 1)
      {
        new targetid = strval(inputtext);
        if(IsPlayerConnected(targetid))
        {
            SendClientMessage(targetid, 0xFFFFFFF, "Your message");
        }
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)