SA-MP Forums Archive
Dialog Reponse problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog Reponse problem (/showthread.php?tid=163217)



Dialog Reponse problem - mariokumanovac - 26.07.2010

I tried to do not have to choose something from the dialogue but failed here is the code

pawn Код:
if(dialogid == JAZIK_LIST && response)
    {
        if (response == 1)
        {
        IgracInfo[playerid][Jezik] =1;
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вашиот официјален јазик е Македонски.");
        SetTimerEx("login", 0 * 1000, 0, "%i", playerid);
        }
        if (response == 2)
        {
        IgracInfo[playerid][Jezik] =2;
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"Vasi oficijalni jezik je Croatian.");
        SetTimerEx("login", 0 * 1000, 0, "%i", playerid);
        }
        if (response == 3)
        {
        IgracInfo[playerid][Jezik] =3;
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"Your official language is English.");
        SetTimerEx("login", 0 * 1000, 0, "%i", playerid);
        }
        else ShowPlayerDialog(playerid,JAZIK_LIST,DIALOG_STYLE_LIST,"Јазик - Jezik - Language","Македонски\nCroatian\nEnglish","OK","Cancel");
    }
I mean I do not have to choose something from the option you can not click on non

Dialogue is the list


Re: Dialog Reponse problem - iggy1 - 26.07.2010

Inside OnDialogResponse.
pawn Код:
if(dialogid == JAZIK_LIST)
{
    if(response)
    {
        switch(listitem)
        {
            case 0:
            {
                IgracInfo[playerid][Jezik] =1;
                SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вашиот официјален јазик е Македонски.");
                SetTimerEx("login", 0 * 1000, 0, "i", playerid);
            }
            case 1:
            {
                IgracInfo[playerid][Jezik] =2;
                SendClientMessage(playerid,COLOR_LIGHTBLUE,"Vasi oficijalni jezik je Croatian.");
                SetTimerEx("login", 0 * 1000, 0, "i", playerid);
            }
            case 2:
            {
                IgracInfo[playerid][Jezik] =3;
                SendClientMessage(playerid,COLOR_LIGHTBLUE,"Your official language is English.");
                SetTimerEx("login", 0 * 1000, 0, "i", playerid);
            }
        }
    }
    else ShowPlayerDialog(playerid,JAZIK_LIST,DIALOG_STYLE_LIST,"Јазик - Jezik - Language","Македонски\nCroatian\nEnglish","OK","Cancel");
}
try this it should work

Edit: i use 'i' in SetTimerEx not '%i' although it doesn't realy matter.