Need Help Adding Multiple Commands to Dialog
#2

its to simple, use DIALIG_STYLE_LIST
example:
pawn Код:
if(!strcmp(cmdtext, "/drinks", true))
{
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Choose one", "Cmds\nG CMDS\nF CMDS", "Ok", "Cancel");
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
    {
    switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
        case 1:// Our dialog!
            {
            switch(listitem)// Checking which listitem was selected
            {
                case 0:// The first item listed
                {
                   ShowPlayerDialog(playerid, 1 , DIALOG_STYLE_MSGBOX, "Cmds here!", "Ok," , "Exit");
                }
                case 1: // The second item listed
                {
                  ShowPlayerDialog(playerid, 1 , DIALOG_STYLE_MSGBOX, "G Cmds here!", "Ok," , "Exit");
                }
                case 2: // The third item listed
                {
                   ShowPlayerDialog(playerid, 1 , DIALOG_STYLE_MSGBOX, "F Cmds here!", "Ok," , "Exit");
                }
            }
            }
    }
    }
    return 1;
} //Edited, main one by SAMP Wiki.
hope it helps..
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)