Explain me please OnDialogResponse
#3

First, this is your OnPlayerCommandText:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256];
    new idx;
    cmd = strtok(cmdtext, idx);
    if(strcmp(cmd,"/help",true) == 0)
    {
        ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"List Dialog","1. Option1\r\n2. Option2\r\n3. Option3","Choose", "Cancel");
        return 1;
    }
    return 1;
}
Now, here is what happen when you choose Option1 / Option2 / Option3 ...
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(1)
    {
        case 1:
        {
            if(!response)
            {
                SendClientMessage(playerid, 0xFFFFFFAA, "You have cancelled!");
                return 1;
            }
            switch(listitem)
            {
                case 0:
                {
                    SendClientMessage(playerid, 0xFFFFFFAA, "You have chosen Option1!");
                }
                case 1:
                {
                    SendClientMessage(playerid, 0xFFFFFFAA, "You have chosen Option2!");
                }
                case 2:
                {
                    SendClientMessage(playerid, 0xFFFFFFAA, "You have chosen Option3!");
                }
            }

        }
    }
    return 0;
}
You can change Option1 / 2 / 3 ... to whatever option you want, it shows you the list,
then you need to modify it by OnDialogResponse by starting with case 0.

I hope it helps, If you need more help. talk with me...
Reply


Messages In This Thread
Explain me please OnDialogResponse - by universe - 07.12.2010, 14:55
Re: Explain me please OnDialogResponse - by universe - 07.12.2010, 15:49
Re: Explain me please OnDialogResponse - by Toreno - 07.12.2010, 16:37
Re: Explain me please OnDialogResponse - by universe - 07.12.2010, 17:00
Re: Explain me please OnDialogResponse - by universe - 07.12.2010, 17:08
Re: Explain me please OnDialogResponse - by universe - 07.12.2010, 17:19
Re: Explain me please OnDialogResponse - by universe - 07.12.2010, 17:28
Re: Explain me please OnDialogResponse - by universe - 07.12.2010, 18:16
Re: Explain me please OnDialogResponse - by Toreno - 07.12.2010, 19:19
Re: Explain me please OnDialogResponse - by universe - 07.12.2010, 19:50

Forum Jump:


Users browsing this thread: 1 Guest(s)