Noticias:

Debes de estar registrado para poder ver el contenido indicado. Registrate o Conectate

Menú Principal

Reproducir musica desde web (By adri1)

Iniciado por Swarlog, Ene 30, 2023, 04:38 PM

Tema anterior - Siguiente tema

Swarlog

Información Adicional:

Para aquellos que quieren poner radios online en vuestro servidor os dejo este fantastico script. Solo teneis que cambiar el nombre de la cadena y su link de reproducción.

Código:

//Creado por adri1
#include <a_samp> // Include, solo de la versión 0.3d
#define MUSICAID 2050 //Música, por diálogo.
//Aquí puedes ir añadiendo más música, luego deberás de hacer el código, para que se reproduzca
new Musica[] ="\
The Time - Black Eyed Peas\
\nWhere Them Girls At - David Guetta\
\nVive la vida loca - DJ\
\nWaka Waka - Shakira\
\nRight Round - Florida\
\nHollywood undead - Eberywhere i go\
\nLinkin Park - In the end\
\nBlack Eyed Peas - I gotta feeling\
\nHollywood undead - Comin`in hot\
\nRocky - Eyed of the tiguer\
\nK`nan - Shi Sha Mi\
\nElectrónica\
\nDavid Guetta - DJ\
\nDavid Guetta - Sexy Chick\
\nSmash mouth - All Start\
\nParar musica";
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
return 1;
}

public OnFilterScriptExit()
{
StopAudioStreamForPlayer(playerid);
return 1;
}
#else
main()
{
}
#endif



public OnPlayerConnect(playerid)
{
CallRemoteFunction("OnPlayerCommandText", "is", playerid, "/audiomsg"); // [Opcional] esto sirve para que no de el mensaje de Audio Stream: url
  // Quitar las dos primeras // para activar
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/musicas", cmdtext, true, 10) == 0)
{
new string[449]; // Cambia el 449 dependiendo de si agregas o eliminas canciones.
    format(string, sizeof(string),"%s %s",Musica);
ShowPlayerDialog(playerid, MUSICAID , DIALOG_STYLE_LIST, "Selecciona la música",string,"Escuchar", "Cancelar");
        PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response) {
switch(dialogid == MUSICAID)
        {
case 1: {
            switch(listitem)
        {
            case 0:
{
            StopAudioStreamForPlayer(playerid);
            PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
                        PlayAudioStreamForPlayer(playerid, "http://dc316.4shared.com/img/481604719/c0280a37/dlink__2Fdownload_2FM676MCJc_3Ftsid_3D20110116-111575-8b7a5e20/preview.mp3");
            }
            case 1:
{
            StopAudioStreamForPlayer(playerid);
            PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
                        PlayAudioStreamForPlayer(playerid, "http://7e.media.v4.skyrock.net/music/7e5/f71/7e5f710f522d30f15893e24498547317.mp3");
            }
    case 2:
{
            StopAudioStreamForPlayer(playerid);
            PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
                        PlayAudioStreamForPlayer(playerid, "http://88.media.v4.skyrock.net/music/88e/81e/88e81e34f58873c2b9c4f0c253c64685.mp3");
            }
    case 3:
{
            StopAudioStreamForPlayer(playerid);
            PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
                        PlayAudioStreamForPlayer(playerid, "http://4a.media.v4.skyrock.net/music/4a5/787/4a5787155c0bdf5cda57a83f20dad3d3.mp3");
            }
    case 4:
{
            StopAudioStreamForPlayer(playerid);
            PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
                        PlayAudioStreamForPlayer(playerid, "http://www.degjo.com/upload/go/dldsegment1/(degjo.com)FloRida-Right%20Round.mp3");
              }
    case 5:
{
            StopAudioStreamForPlayer(playerid);
            PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
                        PlayAudioStreamForPlayer(playerid, "http://56.media.v4.skyrock.net/music/56f/f85/56ff85ace1742b1b3efb80853c7cdc0e.mp3");
            }
    case 6:
{
            StopAudioStreamForPlayer(playerid);
            PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
                        PlayAudioStreamForPlayer(playerid, "http://5d.media.v4.skyrock.net/music/5d4/b6c/5d4b6c2834de1a5bad05c04a0c226847.mp3");
            }
case 7:
{
            StopAudioStreamForPlayer(playerid);
            PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
                        PlayAudioStreamForPlayer(playerid, "http://39.media.v4.skyrock.net/music/39f/f98/39ff98ea1de8e9770e0e49105b31ddd2.mp3");
            }
case 8:
{
            StopAudioStreamForPlayer(playerid);
            PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
                        PlayAudioStreamForPlayer(playerid, "http://dl4.zaycev.net/mini/8864/886492.mp3");
            }
case 9:
{
            StopAudioStreamForPlayer(playerid);
            PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
                        PlayAudioStreamForPlayer(playerid, "http://www.saladospokes.com/Survivor_-_Eye_Of_A_Tiger_Rocky_.mp3");
            }
case 10:
{
            StopAudioStreamForPlayer(playerid);
            PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
                        PlayAudioStreamForPlayer(playerid, "http://dc238.4shared.com/img/410865852/8c04b2ac/dlink__2Fdownload_2FOjqkkZQS_3Ftsid_3D00000000-000000-00000000/preview.mp3");
            }
            case 11:
{
StopAudioStreamForPlayer(playerid);
            PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
                        PlayAudioStreamForPlayer(playerid, "http://player.streamtheworld.com/_players/unionradio/?callsign=LOS40");
}
case 12:
{
StopAudioStreamForPlayer(playerid);
            PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, "ftp://irinel:irinel@46.105.235.54/ServerMusic/adri1.mp3");
}
case 13:
{
StopAudioStreamForPlayer(playerid);
            PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, "http://www.choefm.com/images/Upload/sexy_chick-akon.mp3");
}
case 14:
{
StopAudioStreamForPlayer(playerid);
            PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, "http://www.angelfire.com/music5/jablckburn/Music/All_Star.mp3");
}
    case 15:
{
            StopAudioStreamForPlayer(playerid);
            }
}
}
}
}
return 1;
}
//Creado por adri1