17.06.2010, 16:37
How to get the player ID from the Dialog Response inputtext?
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;
}
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;
}