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;
}