Dialog Reponse Problems
#1

So basically, I've been working on Releasing aftermath roleplay, the project is ready to launch but I've had some problems.

All the dialogs show, most of it works, the problem i'm having is that during the RP test no matter how questions are answered correctly I get.

Код:
SendClientMessage(playerid, COLOR_RED, "You failed the test, you have to try again");
Any help would be gratefully appreciated.

Код:
new TutorialPart[MAX_PLAYERS] = 0;
new TutorialResponse[MAX_PLAYERS] = 0;
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(strfind(inputtext, "%") != -1) return SendClientMessage(playerid, -1, "*"COL_RED" Go crash another server douche!"),KickEx(playerid);
    switch(dialogid)
    {
		case 5897:
		{
		    if(response)
		    {
				if(strval(inputtext) > 0 && strval(inputtext) < 85)
				{
				    pInfo[playerid][pAge] = strval(inputtext);
					ShowPlayerDialog(playerid, 5898, DIALOG_STYLE_INPUT, "What is your Nationality?", "Please insert your Nationality", "Go", "");
				}
				else
				{
					// Removed Invalid age.
				    ShowPlayerDialog(playerid, 5897, DIALOG_STYLE_INPUT, "What is your age?", "Please insert your age", "Go", "");
				}
		    }
		}
		case 5898:
		{
		    if(response)
		    {
				new str[50];
				pInfo[playerid][pNationality] = format(str, sizeof(str), "%s", inputtext);
				ShowPlayerDialog(playerid, 5899, DIALOG_STYLE_INPUT, "What is your Ethnicity?", "Please insert your Ethnicity", "Go", "");
		    }
		}
		case 5899:
		{
		    if(response)
		    {
				new str[50];
				pInfo[playerid][pEthnicity] = format(str, sizeof(str), "%s", inputtext);
				TutorialPart[playerid] = 1;
				ShowPlayerDialog(playerid, 5900, DIALOG_STYLE_LIST, "What is power gaming?", "Using OOC information ICLY\nKilling a player who has killed you\nDoing or performing unrealistic actions", "Go", "");
		    }
		}

		case 5900:
		{
		    if(response)
		    {
		        if(listitem == 2)
		        {
		            TutorialResponse[playerid] += 1;
		            ShowPlayerDialog(playerid, 5901, DIALOG_STYLE_LIST, "What is meta gaming?", "Roleplaying as a cat\nUsing IC information OOCLY\nUsing OOC information ICLY", "Go", "");
		        }
  				else
  				{
                	ShowPlayerDialog(playerid, 5900, DIALOG_STYLE_LIST, "What is power gaming?", "Using OOC information ICLY\nKilling a player who has killed you\nDoing or performing unrealistic actions", "Go", "");
				}
		    }
		}

		case 5901:
		{
		    if(response)
		    {
	           	if(listitem == 2)
		        {
		            TutorialResponse[playerid] += 1;
		            ShowPlayerDialog(playerid, 5902, DIALOG_STYLE_LIST, "What is deathmatching?", "Killing someone without a valid reason\nUsing CLEO mods\nKilling yourself", "Go", "");
		        }
				else
				{
	            	ShowPlayerDialog(playerid, 5901, DIALOG_STYLE_LIST, "What is meta gaming?", "Roleplaying as a cat\nUsing IC information OOCLY\nUsing OOC information ICLY", "Go", "");
				}
		    }
		}

		case 5902:
		{
		    if(response)
		    {
				if(listitem == 0)
		        {
		            TutorialResponse[playerid] += 1;
		            ShowPlayerDialog(playerid, 5903, DIALOG_STYLE_LIST, "What does IC mean?", "In Character\nIn Cock\nIn Chicago", "Go", "");
		        }
				else
				{
	            	ShowPlayerDialog(playerid, 5902, DIALOG_STYLE_LIST, "What is deathmatching?", "Killing someone without a valid reason\nUsing CLEO mods\nKilling yourself", "Go", "");
				}
		    }
		}
		case 5903:
		{
  			if(response)
		    {
				if(listitem == 0)
		        {
		            TutorialResponse[playerid] += 1;
		            ShowPlayerDialog(playerid, 5904, DIALOG_STYLE_LIST, "What does OOC mean?", "In Character\nOut Of Character\nDominic Fapply", "Go", "");
		        }
				else
				{
	            	ShowPlayerDialog(playerid, 5903, DIALOG_STYLE_LIST, "What does IC mean?", "In Character\nIn Cock\nIn Chicago", "Go", "");
				}
		    }
		}
		case 5904:
		{
		    if(response)
		    {
		        if(listitem == 1)
		        {
					TutorialResponse[playerid]+1;
					if(TutorialResponse[playerid] == 5)
		            {
		                SendClientMessage(playerid, -1, "Congratulations, you've passed the test succesfuly!");
		                TutorialResponse[playerid] = 0;
		                TutorialPart[playerid] = 2;
		                ShowPlayerDialog(playerid, DIALOG_LOGIN ,DIALOG_STYLE_PASSWORD, "Aftermath Login", "Please enter your password below to login to your account.", "Login", "Exit");
		            }
		            else
		            {
		                TutorialResponse[playerid] = 0;
		                ShowPlayerDialog(playerid, 5900, DIALOG_STYLE_LIST, "What is power gaming?", "Using OOC information ICLY\nKilling a player who has killed you\nDoing or performing unrealistic actions", "Go", "");
		                SendClientMessage(playerid, COLOR_RED, "You failed the test, you have to try again");
		            }

		        }
		        else
		        {
		            TutorialResponse[playerid] = 0;
		            ShowPlayerDialog(playerid, 5900, DIALOG_STYLE_LIST, "What is power gaming?", "Using OOC information ICLY\nKilling a player who has killed you\nDoing or performing unrealistic actions", "Go", "");
		            SendClientMessage(playerid, COLOR_RED, "You failed the test, you have to try again");
		        }
		    }
		}
		case DIALOG_LOGIN:
		{
			if(!response)
			{
				KickEx(playerid);
    			return 1;
       		}
         	if(strlen(inputtext) >= 3 && strlen(inputtext) <= 20)
     		{
 		    	if(strfind(inputtext, "'", true) != -1)
  		    	{
					ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Aftermath Login", "Type your account's password below:", "Login", "Exit");
				}
    			new tmppass[64];
    			mysql_real_escape_string(inputtext, tmppass);
    			if(strlen(tmppass) < 3)
 		    	{
					ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Aftermath Login", "Type your account's password below:", "Login", "Exit");
				}

				OnPlayerAccountLogin(playerid, tmppass);
			}
 			else
  			{
				ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Aftermath Login", "Type your account's password below:", "Login", "Exit");
  			}
		}
Reply
#2

Can open a server for anyone wanting to see it first hand.
Reply
#3

Debug your code and see which parts get and which parts don't get executed.
Reply
#4

Fixed this now. Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)