dialog questions
#1

How to create a dialog like , lets say Someone did /guide he chosen an option from one dialog and after he chooses that option another dialog shows?
Reply
#2

Its something like this.
pawn Код:
// Add this one just below the #include <a_samp> and other .inc files.
#define   NEWDIALOG    150

//Add this dialog line in your command /guide.
ShowPlayerDialog(playerid,NEWDIALOG,DIALOG_STYLE_LIST,"Guide","1. Line\r\n2. Line\r\n3. Line","Okay", "Close");

//Use this under OnDialogResponse callback
    switch( dialogid )
    {
        case NEWDIALOG:
        {
             if(!response) return  ShowPlayerDialog(playerid,SECONDDIALOG,DIALOG_STYLE_LIST,"Second Guide Line","1. Line\r\n2. Line\r\n3. Line","Okay", "Close");
             if(listitem == 0)
             {
                 // Your Code here.
             }
             if(listitem == 1)
             {
                 // Your Code here.
             }
             if(listitem == 2)
             {
                 // Your Code here.
             }
        }
        case SECONDDIALOG:
        {
          // Then add your codes here like the above dialog or the way you want.
        }
    }
Reply
#3

pawn Код:
#define GUIDES 5006
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
CMD:guides(playerid, params[])
{
    ShowPlayerDialog(playerid, GUIDES, DIALOG_STYLE_LIST, "Server Guides", "Guides1 \nGuides2\nGuides3", "Select", "Cancel");
    return 1;
}
and
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
 if(dialogid == GUIDES)// /changes
{
    if(response)
    {
        if(listitem == 0)
        {
            ShowPlayerDialog(playerid, GUIDES, DIALOG_STYLE_MSGBOX/List, "Title","Text", "Ok", "Cancel");//Change the "Title" and "Text" if you want
        }
        if(listitem == 1)
        {
            ShowPlayerDialog(playerid, GUIDES, DIALOG_STYLE_MSGBOX/List, "title","Text", "Ok", "Cancel");
        }
        if(listitem == 2)
        {
            ShowPlayerDialog(playerid, GUIDES, DIALOG_STYLE_MSGBOX/List, "title","Text", "Ok", "Cancel");
        }
    }
    return 1;
}
Here you go
Reply
#4

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
Its something like this.
pawn Код:
// Add this one just below the #include <a_samp> and other .inc files.
#define   NEWDIALOG    150

//Add this dialog line in your command /guide.
ShowPlayerDialog(playerid,NEWDIALOG,DIALOG_STYLE_LIST,"Guide","1. Line\r\n2. Line\r\n3. Line","Okay", "Close");

//Use this under OnDialogResponse callback
    switch( dialogid )
    {
        case NEWDIALOG:
        {
             if(!response) return  ShowPlayerDialog(playerid,SECONDDIALOG,DIALOG_STYLE_LIST,"Second Guide Line","1. Line\r\n2. Line\r\n3. Line","Okay", "Close");
             if(listitem == 0)
             {
                 // Your Code here.
             }
             if(listitem == 1)
             {
                 // Your Code here.
             }
             if(listitem == 2)
             {
                 // Your Code here.
             }
        }
        case SECONDDIALOG:
        {
          // Then add your codes here like the above dialog or the way you want.
        }
    }
Thank you , Repped
Reply
#5

All good mate.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)