22.01.2014, 13:21
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.
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.
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
....
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.