SA-MP Forums Archive
Diaglos [HELP] - 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)
+--- Thread: Diaglos [HELP] (/showthread.php?tid=374565)



Diaglos [HELP] - Jermi - 03.09.2012

First of All, i updated all my includes and Plugins to the Laset version and they works without problem but I got problem before, When i click on something on the Dialog - Nothing Happen and i defined All, "ONdialogResponse" , "The command"...etc, So what is the probleM?


Re: Diaglos [HELP] - doreto - 03.09.2012

Show as ondialogresponce


Re: Diaglos [HELP] - Jermi - 03.09.2012

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == U2BDIAG && response)
    {
        switch(listitem)
        {
            case 0:
            {
                PlayerU2B[playerid] = 1;
                ShowPlayerDialog(playerid,U2BDIAG+1,DIALOG_STYLE_INPUT,WHOMADETHIS,"Paste the ******* link you want to play for yourself:","Play","Cancel");
                return 1;
            }
            case 1:
            {
                PlayerU2B[playerid] = 2;
                ShowPlayerDialog(playerid,U2BDIAG+1,DIALOG_STYLE_INPUT,WHOMADETHIS,"Paste the ******* link you want to play for a player:","Play","Cancel");
                return 1;
            }
            case 2:
            {
                PlayerU2B[playerid] = 3;
                ShowPlayerDialog(playerid,U2BDIAG+1,DIALOG_STYLE_INPUT,WHOMADETHIS,"Paste the ******* link you want to play for your location:","Play","Cancel");
                return 1;
            }
            case 3:
            {
                PlayerU2B[playerid] = 4;
                ShowPlayerDialog(playerid,U2BDIAG+1,DIALOG_STYLE_INPUT,WHOMADETHIS,"Paste the ******* link you want to play for the whole server:","Play","Cancel");
                return 1;
            }
        }
    }
    if(dialogid == U2BDIAG+1 && response)
    {
        if(strlen(inputtext))
        {
            new result[128], videostr[128];
            strmid(result,inputtext,31,44,strlen(inputtext));
            format(videostr,sizeof(videostr),"www.*******-mp3.org/api/itemInfo/?video_id=%s",result);
            strmid(PlayerU2BLink[playerid], result, 0, 32);
            if (PlayerU2B[playerid] == 1)
            {
                PlayerU2B[playerid] = 11;
                HTTP(playerid,HTTP_GET,videostr,"","U2BInfo");
            }
            else if (PlayerU2B[playerid] == 2)
            {
                PlayerU2B[playerid] = 22;
                ShowPlayerDialog(playerid,U2BDIAG+2,DIALOG_STYLE_INPUT,WHOMADETHIS,"Enter the player id you want to play the song for:","Play","Cancel");
                new string[128];
                format(string, sizeof(string), "%s", PlayerU2BLink[playerid]);
            }
            else if (PlayerU2B[playerid] == 3)
            {
                PlayerU2B[playerid] = 33;
                ShowPlayerDialog(playerid,U2BDIAG+3,DIALOG_STYLE_INPUT,WHOMADETHIS,"Enter the radius in which you want the song to be heard:","Play","Cancel");
            }
            else if (PlayerU2B[playerid] == 4)
            {
                PlayerU2B[playerid] = 44;
                HTTP(playerid,HTTP_GET,videostr,"","U2BInfo");
            }
        }
        return 1;

    }
    if(dialogid == U2BDIAG+2 && response)
    {
        new gpid = strval(inputtext);
        new videostr[128];
        format(videostr,sizeof(videostr),"www.*******-mp3.org/api/itemInfo/?video_id=%s",PlayerU2BLink[playerid]);
        HTTP(gpid,HTTP_GET,videostr,"","U2BInfo");
        return 1;

    }
    if(dialogid == U2BDIAG+3 && response)
    {
        strmid(U2BRadius[playerid], inputtext, 0, 32);
        new videostr[128];
        PlayerU2B[playerid] = 333;
        format(videostr,sizeof(videostr),"www.*******-mp3.org/api/itemInfo/?video_id=%s",PlayerU2BLink[playerid]);
        HTTP(playerid,HTTP_GET,videostr,"","U2BInfo");
        return 1;

    }
    return 0;
}



Re: Diaglos [HELP] - HuSs3n - 03.09.2012

if you have filterscripts that use dialogs
Add return 0; at the end of OnDialogResponse in all of your filterscripts


Re: Diaglos [HELP] - Jarnu - 03.09.2012

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == U2BDIAG)
    {
        switch(listitem)
        {
            case 0:
            {
                PlayerU2B[playerid] = 1;
                ShowPlayerDialog(playerid,U2BDIAG+1,DIALOG_STYLE_INPUT,WHOMADETHIS,"Paste the ******* link you want to play for yourself:","Play","Cancel");
                return 1;
            }
            case 1:
            {
                PlayerU2B[playerid] = 2;
                ShowPlayerDialog(playerid,U2BDIAG+1,DIALOG_STYLE_INPUT,WHOMADETHIS,"Paste the ******* link you want to play for a player:","Play","Cancel");
                return 1;
            }
            case 2:
            {
                PlayerU2B[playerid] = 3;
                ShowPlayerDialog(playerid,U2BDIAG+1,DIALOG_STYLE_INPUT,WHOMADETHIS,"Paste the ******* link you want to play for your location:","Play","Cancel");
                return 1;
            }
            case 3:
            {
                PlayerU2B[playerid] = 4;
                ShowPlayerDialog(playerid,U2BDIAG+1,DIALOG_STYLE_INPUT,WHOMADETHIS,"Paste the ******* link you want to play for the whole server:","Play","Cancel");
                return 1;
            }
        }
    }
    if(dialogid == U2BDIAG+1)
    {
        if(strlen(inputtext))
        {
            new result[128], videostr[128];
            strmid(result,inputtext,31,44,strlen(inputtext));
            format(videostr,sizeof(videostr),"www.*******-mp3.org/api/itemInfo/?video_id=%s",result);
            strmid(PlayerU2BLink[playerid], result, 0, 32);
            if (PlayerU2B[playerid] == 1)
            {
                PlayerU2B[playerid] = 11;
                HTTP(playerid,HTTP_GET,videostr,"","U2BInfo");
            }
            else if (PlayerU2B[playerid] == 2)
            {
                PlayerU2B[playerid] = 22;
                ShowPlayerDialog(playerid,U2BDIAG+2,DIALOG_STYLE_INPUT,WHOMADETHIS,"Enter the player id you want to play the song for:","Play","Cancel");
                new string[128];
                format(string, sizeof(string), "%s", PlayerU2BLink[playerid]);
            }
            else if (PlayerU2B[playerid] == 3)
            {
                PlayerU2B[playerid] = 33;
                ShowPlayerDialog(playerid,U2BDIAG+3,DIALOG_STYLE_INPUT,WHOMADETHIS,"Enter the radius in which you want the song to be heard:","Play","Cancel");
            }
            else if (PlayerU2B[playerid] == 4)
            {
                PlayerU2B[playerid] = 44;
                HTTP(playerid,HTTP_GET,videostr,"","U2BInfo");
            }
        }
        return 1;

    }
    if(dialogid == U2BDIAG+2)
    {
        new gpid = strval(inputtext);
        new videostr[128];
        format(videostr,sizeof(videostr),"www.*******-mp3.org/api/itemInfo/?video_id=%s",PlayerU2BLink[playerid]);
        HTTP(gpid,HTTP_GET,videostr,"","U2BInfo");
        return 1;

    }
    if(dialogid == U2BDIAG+3)
    {
        strmid(U2BRadius[playerid], inputtext, 0, 32);
        new videostr[128];
        PlayerU2B[playerid] = 333;
        format(videostr,sizeof(videostr),"www.*******-mp3.org/api/itemInfo/?video_id=%s",PlayerU2BLink[playerid]);
        HTTP(playerid,HTTP_GET,videostr,"","U2BInfo");
        return 1;

    }
    return 0;
}
once i also had a same prob..
i just remove if(response) and it was fixed.. you can try too. copy the above code..


Re: Diaglos [HELP] - Jermi - 03.09.2012

All returns in my dialogs in the end and FS = return 0; and @janru, Not working