Problem with dialog...it does nothing
#1

Here`s the code:
Код:
	else if(dialogid == 2)
	{
	  if(listitem == 0)
		{
		  ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Account", "Stats\nSettings", "Ok", "Back");
			if(dialogid == 3)
			{
				if(response)
				{
					if(listitem == 0)
			  	{
			    	new string[128], pname[MAX_PLAYER_NAME], file[128], pass[128],kills;
			    		GetPlayerName(playerid, pname, sizeof(pname));
    					format(file, sizeof(file), "\\Users\\%s.ini", pname);
    					dini_Int(file, "kills", kills);
    					dini_Get(file, "password", pass);
    					format(string, sizeof(string), ".:: Name: %s || Password: %s || Money: %i || Kills: %i ::.", pname, pass, GetPlayerMoney(playerid), kills);
    					SendClientMessage(playerid, COLOUR_BLUE, string);
    					return 1;
					}
					if(listitem == 1)
					{
          	ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Settings", "Auto-repair\nAuto-NOS\nChange password", "Ok", "Back");
          	return 1;
					}
        else ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Main Menu", "Account\nVehicles\nTeleports\n", "Ok", "Cancel");
			  return 1;
			  }
			}
			return 1;
		}
		return 1;
	}
 return 1;
}
And here`s the explanation:

When I do /menu and the go to Stats..it does nothing from what I set it to do. The dialog just dissappears and nothing more...
Reply
#2

Quote:
Originally Posted by Mark.W
Here`s the code:
Код:
	else if(dialogid == 2)
	{
	  if(listitem == 0)
		{
		  ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Account", "Stats\nSettings", "Ok", "Back");
			if(dialogid == 3)
			{
				if(response)
				{
					if(listitem == 0)
			  	{
			    	new string[128], pname[MAX_PLAYER_NAME], file[128], pass[128],kills;
			    		GetPlayerName(playerid, pname, sizeof(pname));
    					format(file, sizeof(file), "\\Users\\%s.ini", pname);
    					dini_Int(file, "kills", kills);
    					dini_Get(file, "password", pass);
    					format(string, sizeof(string), ".:: Name: %s || Password: %s || Money: %i || Kills: %i ::.", pname, pass, GetPlayerMoney(playerid), kills);
    					SendClientMessage(playerid, COLOUR_BLUE, string);
    					return 1;
					}
					if(listitem == 1)
					{
          	ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Settings", "Auto-repair\nAuto-NOS\nChange password", "Ok", "Back");
          	return 1;
					}
        else ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Main Menu", "Account\nVehicles\nTeleports\n", "Ok", "Cancel");
			  return 1;
			  }
			}
			return 1;
		}
		return 1;
	}
 return 1;
}
And here`s the explanation:

When I do /menu and the go to Stats..it does nothing from what I set it to do. The dialog just dissappears and nothing more...
I'm not 100% sure but i guess you'd need to close the brackets from dialogid 2 before going over to dialogid 3, like this:

pawn Код:
else if(dialogid == 2)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Account", "Stats\nSettings", "Ok", "Back");
return 1;
}
}

if(dialogid == 3)
{
if(response)
{
if(listitem == 0)
{
new string[128], pname[MAX_PLAYER_NAME], file[128], pass[128],kills;
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\Users\\%s.ini", pname);
dini_Int(file, "kills", kills);
dini_Get(file, "password", pass);
format(string, sizeof(string), ".:: Name: %s || Password: %s || Money: %i || Kills: %i ::.", pname, pass, GetPlayerMoney(playerid), kills);
SendClientMessage(playerid, COLOUR_BLUE, string);
return 1;
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Settings", "Auto-repair\nAuto-NOS\nChange password", "Ok", "Back");
return 1;
}
else ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Main Menu", "Account\nVehicles\nTeleports\n", "Ok", "Cancel");
return 1;
}
return 1;
}
Reply
#3

No. That`s not solving the problem. Anyway, if a set of brackets it`s not closed you`ll get a bunch of errors

Thanks for trying anyway
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)