Dialogs ... Argh!
#1

So this keeps happening to me...
All dialog ID'S are different I have checked and changed many times.
The code should be working because it is working without the other dialog when thats in game
All dialogs in my GAMEMODE work and 1 filterscript dialog works but one doesnt
It does not lead me to the next thing that it has to lead me to
heres a bit of the code
pawn Код:
ublic OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_MAIN_MENU:
        {
            if(response)
            {
                if(listitem == 0) return ShowPlayerDialog(playerid, DIALOG_CREATE_OBJ, DIALOG_STYLE_INPUT, "Create Object", "Creating an object is easy. Simply type the object model ID below into the box.", "Create", "Back");
                if(listitem == 1) return ShowPlayerDialog(playerid, DIALOG_MODEL_SEARCH, DIALOG_STYLE_INPUT, "Search Object Models", "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "Search", "Back");
                if(listitem == 2) return ShowPlayerDialog(playerid, DIALOG_DELETE_OBJ, DIALOG_STYLE_INPUT, "Delete Object", "Please enter the ID of the object you wish to delete.", "Delete", "Back");
                if(listitem == 3) return ShowPlayerDialog(playerid, DIALOG_EDIT_OBJ, DIALOG_STYLE_INPUT, "Edit Object", "Please enter the ID of the object you wish to edit.", "Edit", "Back");
                if(listitem == 4) return ShowPlayerDialog(playerid, DIALOG_SAVE_OBJ, DIALOG_STYLE_INPUT, "Save Object", "Please enter the ID of the object you wish to save.\n\nIf you're done typing the ID's, type 'Done'.", "Save", "Back");
                if(listitem == 5) return ShowPlayerDialog(playerid, DIALOG_LOAD_OBJ, DIALOG_STYLE_INPUT, "Load Objects", "Please enter the filename of a previously saved project to load their objects.\n\nNOTE: Please exclude .pwn from the name, for example. 'MyAdminHQ' instead of 'MyAdminHQ.pwn'.", "Load", "Back");
            }
        }
Should I change anything?
Reply
#2

\\\\\\\\\\\\\\\\\\\\
Reply
#3

\\\\\\\\\\\\\\\\\\\\\\\\
Reply
#4

Look when displaying the DIALOG_MAIN_MENU if their in order and how you placed them in the code you provided if they're exactly the same.

Another thing to look out for is the DIALOG ID'S make sure they're not conflicting filterscripts, loaded plugins, includes etc.

Also just a tip use switch statement for dialog lists it's much easier and you can organize it much much better (my opinion)

pawn Код:
switch(dialogid)
    {
        case DIALOG_MAIN_MENU:
        {
            if(response)
            {
                switch(listitem)
                {
                    case 0: ShowPlayerDialog(playerid, DIALOG_CREATE_OBJ, DIALOG_STYLE_INPUT, "Create Object", "Creating an object is easy. Simply type the object model ID below into the box.", "Create", "Back");
                    case 1: ShowPlayerDialog(playerid, DIALOG_MODEL_SEARCH, DIALOG_STYLE_INPUT, "Search Object Models", "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "Search", "Back");
                    case 2: ShowPlayerDialog(playerid, DIALOG_DELETE_OBJ, DIALOG_STYLE_INPUT, "Delete Object", "Please enter the ID of the object you wish to delete.", "Delete", "Back");
                    case 3: ShowPlayerDialog(playerid, DIALOG_EDIT_OBJ, DIALOG_STYLE_INPUT, "Edit Object", "Please enter the ID of the object you wish to edit.", "Edit", "Back");
                    case 4: ShowPlayerDialog(playerid, DIALOG_SAVE_OBJ, DIALOG_STYLE_INPUT, "Save Object", "Please enter the ID of the object you wish to save.\n\nIf you're done typing the ID's, type 'Done'.", "Save", "Back");
                    case 5: ShowPlayerDialog(playerid, DIALOG_LOAD_OBJ, DIALOG_STYLE_INPUT, "Load Objects", "Please enter the filename of a previously saved project to load their objects.\n\nNOTE: Please exclude .pwn from the name, for example. 'MyAdminHQ' instead of 'MyAdminHQ.pwn'.", "Load", "Back");
                }
            }
        }
Reply
#5

^ I don't think you can use switch inside another switch


Edit: Oh, you can, i didn't know. Everytime I used it it caused me few errors silly me
Reply
#6

Quote:
Originally Posted by Marricio
Посмотреть сообщение
^ I don't think you can use switch inside another switch :P
You can give it a try. (as long as there is a closing bracket)
Reply
#7

Hmm I still have not solved my problemo I wonder what it is going to examine it tomorrow each script one by one..
I think its ID's..
Thanks anyways guys...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)