Dialog No Response
#1

This is a command i made!
Code:
COMMAND:settings(playerid, params[])
{
        if(playerData[playerid][playerLoggedIn])
        {
    		ShowPlayerDialog(playerid, DIALOG_SETTINGS, DIALOG_STYLE_LIST, "Account Settings", "Change Password\nMy Stats\nMy Packet Loss\nBank Information\nMy Cookies\nMy Tokens\nInventory\nMy IP", "Go", "Cancel");
        }
        return 1;
}
and here its Dialog Respons
Code:
    if(dialogid == DIALOG_SETTINGS)
    {
        // If the user clicked on a document
		if(response)
        {
  			switch(listitem)
    		{
    			case 0: // Change Password
     			{
                                return cmd_changepass(playerid, " ");
			}

    			case 1: // My Stats
     			{
                                return cmd_stats(playerid, " ");
                        }

			case 2: // My Packet Loss
			{
				return cmd_mypacketloss(playerid, " ");
			}

    		        case 3: // Bank Information
     			{
				new cash[48], bank[68], showstats[500];
				format(bank, sizeof bank, "Bank Balance: $%s", FormatNumber(playerData[playerid][playerBank]));
				format(cash, sizeof cash, "Cash Balance: $%s", FormatNumber(playerData[playerid][playerMoney]));
				format(showstats, sizeof showstats, "%s\n%s", bank, cash);

				// Show dialog containing stats
				ShowPlayerDialog(playerid, 150, DIALOG_STYLE_MSGBOX, "Bank Account Information", showstats, "Okay", "Close");
			}
    			case 4: // My Cookies
     			{
				return cmd_mycookies(playerid, " ");
			}
			case 5: // My Tokens
			{
				return cmd_mytokens(playerid, " ");
			}
			case 6: // Inventory
			{
				return cmd_inventory(playerid, " ");
				}
				case 7: // My IP
				{
					return cmd_getmyip(playerid, " ");
				}
			}
		}
	}
But when we click on any listed item, Just nothing happens :/
+REP if helped!
Reply
#2

return 1 after if(response) ends.

EDIT:

over here:

PHP Code:
case 6// Inventory
            
{
                return 
cmd_inventory(playerid" ");
                }
                case 
7// My IP
                
{
                    return 
cmd_getmyip(playerid" ");
                }
            }
        }
         return 
1;
       } 
Reply
#3

Check all your other filterscripts for OnDialogResponse and find the one that returns 1 always, especially when a dialog that doesn't belong to that filterscript is handled (like yours).
Start with the first filterscript listed in your server.cfg file and proceed until your own script that doesn't handle your dialogs.

To test if this is the problem: list the script as the first filterscript and check if it works then.

If it does, then one of the other scripts must have a return 1, which actually tells the server to stop processing the dialogs and skip all other scripts.


Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 1;
}
Suppose you have 4 filterscripts and of course your gamemode, the filterscripts are processed first, then the gamemode at the end.
If your first filterscript would have the above code, and you're trying to process a dialog in the 3rd filterscript, it won't be processed.
In fact, the server stops processing dialogs in this first script because it has "return 1" there.
The 2nd, 3rd and 4th filterscript and gamemode won't be processed and therefore, nothing happens when you click on anything in that dialog, which is displayed in the 3rd filterscript.

Every filterscript should have "return 0" there if no dialog was processed by that filterscript.
Another filterscript or even the gamemode then still has a chance to process that dialog.
The gamemode comes last and should return 1 there, but I think it doesn't matter what you return there, because it's the last script to be processed anyways.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)