Multiple dialogs, do not save to mysql before registration is completly done?
#1

SOLVED
Reply
#2

Uh what? Each dialog calls OnPlayerDialogReponse separately with different inputtext. Obviously it can't store two values at once. If you want to save the password you must do so when it is first entered otherwise it will be lost.
Reply
#3

----
Reply
#4

First Thing:

In
Код:
ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_MSGBOX, "Registration", "Please choose the gender of your character", "Male", "Female");
		}

		case DIALOG_GENDER:
		{
			if(!response) Kick(playerid);
			if(response)
			{
				pData[playerid][Gender] = 0;
				ShowPlayerDialog(playerid, DIALOG_ORIGIN, DIALOG_STYLE_INPUT, "Registration", "What is your character's origin? (IC)\n\tPlease type it below:", "Continue", "Leave");
			}
			else
			{
				pData[playerid][Gender] = 1;
				ShowPlayerDialog(playerid, DIALOG_ORIGIN, DIALOG_STYLE_INPUT, "Registration", "What is your character's origin? (IC)\n\tPlease type it below:", "Continue", "Leave");
			}
		}
This will create two buttons " Male " n " Female ".

So if you a user choose " Female " one, then according to your script, the server will kick him (which it shouldn't). So replace the else statement with (!response) statement in DIALOG_GENDER first.

Second thing:
Quote:

I don't want to store useless information as if someone quit in the middle of the tutorial, I want them to completely re-do it. In other words; they won't be registered.

To do this, you have to remove the MYSQL Query from the (DIALOG_REGISTER)
and run the query as a whole in DIALOG_ORIGIN only.

And also, when a player connects; set the values to null, this can be done by:

Put this under OnPlayerConnect(playerid):

pData[playerid][Password] = 0;
pData[playerid][Gender] = 0;
pData[playerid][Origin] = 0;
// also set other variables like these here

" OnDialogResponse " Thing:

Fixed script: http://pastebin.com/C7frntKu
-------------------------------------------------------------------------------------------------------------------
New Fixed script: http://pastebin.com/1EeMffkz (Found a bug on line no.70, and debugged it)
Reply
#5

Thanks dude, appreciate it.
Reply
#6

Np, don't forget to rep ++ - Regards Noob Programmer Akbaig
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)