SA-MP Forums Archive
How would I go about using the input dialog - 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: How would I go about using the input dialog (/showthread.php?tid=468676)



How would I go about using the input dialog - ExtendedCarbon - 09.10.2013

I want to make it so the dialogue shows and asks for an audio URL and when you insert one in, an audio stream plays from the link you in putted.

Help please.


Re: How would I go about using the input dialog - EiresJason - 09.10.2013

I think it would look something like this:
pawn Код:
#define DIALOG_MUSIC 545
CMD:music(playerid,params[])
{
    ShowPlayerDialog(playerid,DIALOG_MUSIC,DIALOG_STYLE_INPUT,"Music Player","Please enter the exact URL for the audio file!","Play","Close");
   
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
     switch(dialogid)
    {  
        new Float:x,Float:y,Float:z;
        GetPlayerPos(playerid,x,y,z);
        case DIALOG_MUSIC:
        {
            PlayAudioStreamForPlayer(playerid, inputtext, x, y, z, 50.0, 0);
        }
    }
    return 0;
}