Jump to content

Tutorial Dialog


CriatixX

Recommended Posts

Bun, e destul de simplu acest lucru.

1) definesti dialogurile:

enum
{
    DIALOG_HELP,
    DIALOG_HELP2,
    DIALOG_HELP3,
    DIALOG_HELP4,
    DIALOG_TRIMITERE1,
    DIALOG_TRIMITERE2,
    DIALOG_TRIMITERE3
};

2) Facem comanda:

CMD:help(playerid,params[])
{
    new string[500];
    format(string,sizeof(string),"Comenzi Playeri\n");// simbolul "\n" face sa lase un rand in jos.
    format(string,sizeof(string),"Comenzi Lider\n",string);
    format(string,sizeof(string),"Comenzi Helper",string);
    ShowPlayerDialog(playerid, DIALOG_HELP ,DIALOG_STYLE_LIST,"AJUTOR",string,"OK","Exit");
    return 1;
}

3) Facem dialogurile:

  

 if(dialogid == DIALOG_HELP)
    {
        switch(listitem)
        {
            case 0:
            {
                new string[500];
                format(string, sizeof(string),"Comanda 1\n");
                format(string, sizeof(string),"Comanda 2\n",string);
                format(string, sizeof(string),"Comanda 3\n",string);
                format(string, sizeof(string),"Comanda 4\n",string);
                format(string, sizeof(string),"Comanda 5",string);
                ShowPlayerDialog(playerid, DIALOG_TRIMITERE1 ,DIALOG_STYLE_MSGBOX,"AJUTOR",string,"OK","Exit");
            }
            case 1:
            {
                new string[500];
                format(string, sizeof(string),"Comanda 1\n");
                format(string, sizeof(string),"Comanda 2\n",string);
                format(string, sizeof(string),"Comanda 3\n",string);
                format(string, sizeof(string),"Comanda 4\n",string);
                format(string, sizeof(string),"Comanda 5",string);
                ShowPlayerDialog(playerid, DIALOG_TRIMITERE2 ,DIALOG_STYLE_MSGBOX,"AJUTOR",string,"OK","Exit");
            }
            case 2:
            {
                new string[500];
                format(string, sizeof(string),"Comanda 1\n");
                format(string, sizeof(string),"Comanda 2\n",string);
                format(string, sizeof(string),"Comanda 3\n",string);
                format(string, sizeof(string),"Comanda 4\n",string);
                format(string, sizeof(string),"Comanda 5",string);
                ShowPlayerDialog(playerid, DIALOG_TRIMITERE3 ,DIALOG_STYLE_MSGBOX,"AJUTOR",string,"OK","Exit");
            }
        }
    }

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.