SA-MP Forums Archive
Showplayerdialog? - 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: Showplayerdialog? (/showthread.php?tid=436102)



Showplayerdialog? - MassDivide - 10.05.2013

Basically.
CMD:blah(playerid,params[]){
PHP код:
if (ShowPlayerDialog(playeridDIALOG_CHECKPINDIALOG_STYLE_INPUT,"Cipher","Please Enter your pin:","Confirm","") == 1){
//wait for DIALOG_CHECKPIN to return 1 or 0;
// do money stuff
}
else if ^
0{
//return an error
}
}
return 
1;

I really don't want to put this into an ondialog response. Since I want to reuse the pincheck callback.
And the ondialogresponse just confirms the pin, returning 1 or 0 depending on the result.


Re: Showplayerdialog? - horsemeat - 10.05.2013

pawn Код:
CMD:command(playerid,params[])
{
      ShowPlayerDialog(playerid, DIALOG_CHECKPIN, DIALOG_STYLE_INPUT,"Cipher","Please Enter your pin:","Confirm","");
}
Then use the call back

https://sampwiki.blast.hk/wiki/OnDialogResponse

example
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
      if(dialogid = DIALOG_CHECKPIN)
      {
            if(response)
            {
                  //code goes here
             }
             else
             {
     
             }
       }
       return 0;
}



Re: Showplayerdialog? - MassDivide - 10.05.2013

As stated here:
Код:
I really don't want to put this into an ondialog response. Since I want to reuse the pincheck callback.
And the ondialogresponse just confirms the pin, returning 1 or 0 depending on the result.



Re: Showplayerdialog? - horsemeat - 10.05.2013

Quote:
Originally Posted by MassDivide
Посмотреть сообщение
As stated here:
Код:
I really don't want to put this into an ondialog response. Since I want to reuse the pincheck callback.
And the ondialogresponse just confirms the pin, returning 1 or 0 depending on the result.
sorry I did not read carefuly, Not sure (not sure if this even works with response)


Re: Showplayerdialog? - MassDivide - 10.05.2013

Yeah i guess on dialog response it is.


Re: Showplayerdialog? - horsemeat - 10.05.2013

Quote:
Originally Posted by MassDivide
Посмотреть сообщение
Yeah i guess on dialog response it is.
well mabey you could make a global variable like
pawn Код:
new variable[MAX_PLAYERS];

variable[playerid] = pin;