OnDialogResponse not working
#5

Why do you guys recommend him to use switch while the if(dialogid == x) is correct aswell? The issue doesn't happen because of that.

This works, has been tested by me:

pawn Код:
#include <a_samp>

#define DIALOG_TELEPORT 1

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/tel", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid,DIALOG_TELEPORT,DIALOG_STYLE_LIST ,"Teleporter","LS Airport\nTall Building","Teleport","Cancel");

        return 1;
    }

    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_TELEPORT)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0: return SetPlayerPos(playerid,1861.1454,-2491.4324,13.5547);
                case 1: return SetPlayerPos(playerid,1545.4745,-1362.4923,329.4586);
            }
        }

        return 1;
    }

    return 0;
}
Reply


Messages In This Thread
OnDialogResponse not working - by alibalicharlton - 03.07.2014, 18:03
Re: OnDialogResponse not working - by EmilLykke - 03.07.2014, 18:05
Re: OnDialogResponse not working - by alibalicharlton - 03.07.2014, 18:12
Re: OnDialogResponse not working - by Timeless - 03.07.2014, 19:03
Re: OnDialogResponse not working - by Dignity - 03.07.2014, 19:11
Re: OnDialogResponse not working - by alibalicharlton - 03.07.2014, 19:11
Re: OnDialogResponse not working - by Konstantinos - 03.07.2014, 19:11
Re: OnDialogResponse not working - by alibalicharlton - 03.07.2014, 19:17
Re: OnDialogResponse not working - by Dignity - 03.07.2014, 19:18
Re: OnDialogResponse not working - by alibalicharlton - 03.07.2014, 19:19

Forum Jump:


Users browsing this thread: 1 Guest(s)