SA-MP Forums Archive
Geting the player's ID from inputtext - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Geting the player's ID from inputtext (/showthread.php?tid=155250)



Geting the player's ID from inputtext - ||123|| - 17.06.2010

How to get the player ID from the Dialog Response inputtext?


Re: Geting the player's ID from inputtext - Virtual1ty - 17.06.2010

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?




Re: Geting the player's ID from inputtext - ||123|| - 17.06.2010

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


Re: Geting the player's ID from inputtext - PotH3Ad - 17.06.2010

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;
}