'dataid' and 'datastring' in ShowPlayerDialog/OnDialogResponse
#1

Hello there, this afternoon while I was scripting I got an idea that might be something for the next RC. As we all know we need to use (global) variables in order to pass data from outside into OnDialogResponse, like this.

pawn Код:
// top of your script
new data;

// code
data = 1; // set data to 1 so that you can use this in ODR for whatever you want.
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Login", "Please log in below", "Log in", "Quit");

// OnDialogResponse
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
      switch(data)
      {
            case 1:
            {
                   // Process all the login stuff
                   
                     ....
Wouldn't it be great if ShowPlayerDialog and OnDialogResponse had one or more extra variables and strings so you could send data along with the dialog? In my opinion, yes. I don't think this is very hard to implement, yet it can be very useful.

EDIT: I given this a further thought, and it would be even more useful if this would handle parameters the same as CallLocalFunction so that you could use as much parameters as you want.
Reply
#2

You can use PVars, it's easyer. But I support this.
Reply
#3

I was actually encountered very similar problem yesterday. I've passed newstate and oldstate values to OnPlayerKeyStateChange, and the values has been received, but they're not able to check by "GetPlayerState" function. Would be nice to that fixed too.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)