Dialog getplayerinput (+rep)
#4

You can format the 'inputtext' of the dialog and then show it up as a message and set the value of the string variable.
Here's a small code (example) :
pawn Код:
enum eg
{
 Downer[24],
}

new Examples[MAX_PLAYERS][eg];

CMD:changedowner(playerid, params[])
{
 ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "[Change]Delta Owner", "Please type in below your new delta's owner.", "Change", "Cancel");
 return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
 if(dialogid == 1)
 {
  if(!response) return SendClientMessage(playerid, -1, "You have cancelled changing your delta's owner."); //If player clicks the second button, i.e: 'Cancel'.
  else if(response) //If first button, i.e: 'Change'
  {
   new string[128];
   format(string, sizeof(string), "You have changed your Delta's owner to %s", inputtext);
   format(Examples[playerid][Downer], 24, "%s", inputtext); //Sets the var's value to the inputtext.
   SendClientMessage(playerid, -1, string);
  }
 }
 return 1;
}
Reply


Messages In This Thread
Dialog getplayerinput (+rep) - by NicholasA - 28.04.2013, 09:00
Re: Dialog getplayerinput (+rep) - by Avi Raj - 28.04.2013, 09:09
Re : Re: Dialog getplayerinput (+rep) - by DaTa[X] - 28.04.2013, 09:16
Re: Dialog getplayerinput (+rep) - by Lordzy - 28.04.2013, 09:53

Forum Jump:


Users browsing this thread: 2 Guest(s)