SA-MP Forums Archive
Dialog boxes - 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)
+--- Thread: Dialog boxes (/showthread.php?tid=430737)



Dialog boxes - xXitsgodzillaXx - 15.04.2013

How would I make a Dialog box go back to the previous box that I was just on so that way I wouldnt have to re type the command to get back to the original menu?


Re : Dialog boxes - DaTa[X] - 15.04.2013

pawn Код:
if(dialogid == xXitsgodzillaXx)
 {
    if(!response)
      {
         // show the previous box here
      }



Re: Dialog boxes - T101 - 15.04.2013

As a quick extension for the previous post only, use DaTa[X]'s code under the OnDialogResponse callback, like this:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == xXitsgodzillaXx) // Comparing passed dialogid and variable used, when creating your dialog (storing it's ID)
    {
        if(response)
        {
            // Insert previous box's code here, if you wanna show it, when they selected any items and/or clicked 'Yes'
        }
        else
        {
            // In case, they pressed ESC, or selected cancel
        }
        return 1;
    }
    return 0;
}