What are switches ment for? (Dialogs).
#6

So I was experimenting with dialogs, to see what would be the easiest way to make them. Would this be the proper, effective way? I'm just here to clarify if it is or not.

PS: It does work in-game. No bugs.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == MAIN_DIALOG && response)
    {
        switch(listitem)
        {
       
            case 0:
            {
                ShowPlayerDialog(playerid,IN_WEAPONS, DIALOG_STYLE_LIST, "Weapons","Option 1\nOption 2","Select","Return");
            }
            case 1:
            {
                ShowPlayerDialog(playerid,IN_TELEPORTS, DIALOG_STYLE_LIST, "Teleports","Option1\nOption 2","Select","Return");
            }
        }
    }
    if(dialogid == IN_WEAPONS)
    {
        switch(listitem)
        {
            case 0:
            {
                if(!response) return ShowPlayerDialog(playerid, MAIN_DIALOG, DIALOG_STYLE_LIST, "Main Dialog.", "Weapons\nTeleports","Select","Cancel");
                SendClientMessage(playerid, -1, "You selected option 1.");
            }
            case 1:
            {
                if(!response) return ShowPlayerDialog(playerid, MAIN_DIALOG, DIALOG_STYLE_LIST, "Main Dialog.", "Weapons\nTeleports","Select","Cancel");
                SendClientMessage(playerid, -1, "You selected option 2.");
            }
        }
    }
    if(dialogid == IN_TELEPORTS)
    {
        switch(listitem)
        {
            case 0:
            {
                if(!response) return ShowPlayerDialog(playerid, MAIN_DIALOG, DIALOG_STYLE_LIST, "Main Dialog.", "Weapons\nTeleports","Select","Cancel");
                SendClientMessage(playerid, -1, "You selected option 1.");
            }
            case 1:
            {
                if(!response) return ShowPlayerDialog(playerid, MAIN_DIALOG, DIALOG_STYLE_LIST, "Main Dialog.", "Weapons\nTeleports","Select","Cancel");
                SendClientMessage(playerid, -1, "You selected option 2.");
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
What are switches ment for? (Dialogs). - by rangerxxll - 17.03.2013, 08:27
Respuesta: What are switches ment for? (Dialogs). - by Parka - 17.03.2013, 08:29
Re: What are switches ment for? (Dialogs). - by mastermax7777 - 17.03.2013, 08:31
Re: What are switches ment for? (Dialogs). - by JaKe Elite - 17.03.2013, 08:31
Re: What are switches ment for? (Dialogs). - by rangerxxll - 17.03.2013, 16:51
Re: What are switches ment for? (Dialogs). - by rangerxxll - 17.03.2013, 18:02
Re: What are switches ment for? (Dialogs). - by Vince - 17.03.2013, 18:22

Forum Jump:


Users browsing this thread: 1 Guest(s)