Audiostream
#3

pawn Код:
#define AUDIO_DIALOG 2065 //Surely this will not conflict with other dialogs in your gamemode/filterscripts. If it does, change it.

CMD:audiourl(playerid, params[])
{
    //if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "Only an RCON Administrator can use this command."); //Recommended that you add a line similar to this
    ShowPlayerDialog(playerid, AUDIO_DIALOG, DIALOG_STYLE_INPUT, "Audio Source", "Enter the URL of the Audio Source here:", "Play", "Cancel");
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == AUDIO_DIALOG)
    {
        if(response)
        {
            //Additionally, you can add checks here to ensure that the url that has been entered is a valid source of audio.
            //Example: Ending in .mp3, .mp4, etc.
            SendClientMessageToAll(0xFFFF00FF, "An Administrator has started playing audio for all players.");
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    StopAudioStreamForPlayer(i);
                    PlayAudioStreamForPlayer(i, inputtext);
                }
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Audiostream - by lider1241 - 04.09.2013, 10:03
Re: Audiostream - by Lynet - 04.09.2013, 10:17
Re: Audiostream - by Threshold - 04.09.2013, 10:20
Re: Audiostream - by lider1241 - 04.09.2013, 10:44
Re: Audiostream - by Lynet - 04.09.2013, 10:53
Re: Audiostream - by lider1241 - 04.09.2013, 10:57
Re: Audiostream - by Lynet - 04.09.2013, 11:41
Re: Audiostream - by Threshold - 04.09.2013, 12:23
Re: Audiostream - by lider1241 - 04.09.2013, 14:08

Forum Jump:


Users browsing this thread: 1 Guest(s)