SA-MP Forums Archive
Dialog Registratoin with list dialogs.. +REP (really needed) - 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 Registratoin with list dialogs.. +REP (really needed) (/showthread.php?tid=324735)



Dialog Registratoin with list dialogs.. +REP (really needed) - Scrillex - 10.03.2012

Код:
	switch( dialogid )
    {
   	    case DIALOG_REGISTER:
	   	{
            if (!response) return Kick(playerid);
            if(response)
            {
                switch(listitem)// Checking which listitem was selected
				{
				    case 0:
				    {
		                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
		                new INI:File = INI_Open(UserPath(playerid));
		                INI_SetTag(File,"data");
		                INI_WriteInt(File,"Password",udb_hash(inputtext));
		                INI_WriteInt(File,"Registred",1);
		                INI_WriteInt(File,"Cash",0);
		                INI_WriteInt(File,"Admin",0);
		                INI_WriteInt(File,"Kills",0);
		                INI_WriteInt(File,"Deaths",0);
		                INI_WriteInt(File,"Respect",0);
		    			INI_WriteInt(File,"House",0);
		    			INI_WriteInt(File,"Car",0);
		    			INI_WriteInt(File,"Gun",0);
					    INI_WriteInt(File,"Gun1",0);
					    INI_WriteInt(File,"Gun2",0);
					    INI_WriteInt(File,"Gun3",0);
					    INI_WriteInt(File,"Materials",0);
					    INI_WriteInt(File,"Bullets",0);
					    INI_WriteInt(File,"Gangid",0);
					    INI_WriteInt(File,"Jailed",0);
					    INI_WriteInt(File,"Race",0);
					    INI_WriteInt(File,"Cashbox",0);
					    INI_WriteInt(File,"Minimission",0);
					    INI_WriteInt(File,"Event",0);
					    INI_WriteInt(File,"Quiz",0);
					    INI_WriteInt(File,"FightingStyle",0);
		                INI_Close(File);
					}
					case 1:
					{
						ShowPlayerDialog(playerid,DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! Your Stats have been saved!","Ok","");
					}
					case 2:
					{
		   				ShowPlayerDialog(playerid,DIALOG_QUIZ,DIALOG_STYLE_LIST,"What does RP stands for?"," Real Pussy \n Role Play \n Real Money","Select","Leave Game");
					}
					case 3:
					{
						ShowPlayerDialog(playerid,DIALOG_Figting,DIALOG_STYLE_LIST,"Choose Your Fighting Style"," Elbow \n Boxing \n Grab kick \n Kung Fu \n Normal","Accept","Cancel");
		     		}
					case 4:
					{
		   				ShowPlayerDialog(playerid,DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! YourStats have been saved!","Ok","");
		   			}
					case 5:
					{
		   				QuizAnswers[playerid] = 0; // We set the player quiz answers to 0 when he connects.
		   				SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
		       			SpawnPlayer(playerid);
		            }
		        }
			}
		}
I have this dialogs I cased them but.. When i register they don't work only registration .... So maybe someone
Can help me out...


Re: Dialog Registratoin with list dialogs.. +REP (really needed) - Faisal_khan - 10.03.2012

Yeah it won't work until you define the buttons that is accept or close blabla under
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
          return 1;
}



Re: Dialog Registratoin with list dialogs.. +REP (really needed) - Scrillex - 10.03.2012

It is under it... The problem is how to load after registration more dialogs.. What is before Login...

You see I have Fighting styles etc. So when player is registering first is quiz then he is doing IC stuff.


Re: Dialog Registratoin with list dialogs.. +REP (really needed) - Faisal_khan - 10.03.2012

Quote:
Originally Posted by Scrillex
Посмотреть сообщение
It is under it... The problem is how to load after registration more dialogs.. What is before Login...
I dont understand wat ur trying to say?


Re: Dialog Registratoin with list dialogs.. +REP (really needed) - Scrillex - 10.03.2012

When player register he firstly enters password, then next dialog shows up he has a choice to change his fighting style, then he needs to answer some RP questions and then only he can login... So that's the problem.
So when player is registering register dialog shows up and he enters pass and that's all.


Re: Dialog Registratoin with list dialogs.. +REP (really needed) - Faisal_khan - 10.03.2012

Ok got it!
I think the problem is not here (i.e. under OnPlayerDialogResponse) it maybe be under
pawn Код:
public OnPlayerConnect(playerid)



Re: Dialog Registratoin with list dialogs.. +REP (really needed) - Scrillex - 10.03.2012

OnPlayerConnect ?
Quote:

public OnPlayerConnect(playerid)
{
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE" Type your password below to login.","Login","Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""C OL_WHITE"Type your password below to register a new account.","Register","Quit");
}
return 1;
}

But you see it will be not included in registration... That's the thing... The same thing will be I know it..


Re: Dialog Registratoin with list dialogs.. +REP (really needed) - Faisal_khan - 10.03.2012

Remove cases and their braces in the OnDialogResponse.


Re: Dialog Registratoin with list dialogs.. +REP (really needed) - Scrillex - 10.03.2012

If I will do that it will be like //Register//Fighting style I need //register//Fighting//Quiz//Login.


Re: Dialog Registratoin with list dialogs.. +REP (really needed) - Faisal_khan - 10.03.2012

Quote:
Originally Posted by Scrillex
Посмотреть сообщение
If I will do that it will be like //Register//Fighting style I need //register//Fighting//Quiz//Login.
LOL hell! A headache!