By forum.sa-mp.com NEW to 0.3d RADIO
http://www.youtube.com/watch?v=8NvqxNfua00&
feature=player_embedded
//Credits to BloodMaster
#include a_samp
#include zcmd
// Define there how much songs you have
#define MAX_SONGS 40
#define RADIODIALOG (9445)
new songstr[512];
new struse[128];
enum infi
{
song[256],
sname[128],
}
new SongInfo[MAX_SONGS][infi];
new CurSongs=0;
stock AddSongToDialog(name[],url[])
{
CurSongs++;
format(SongInfo[CurSongs][song],256,"%s",url);
format(SongInfo[CurSongs][sname],128,"%s",name);
return 1;
}
public OnFilterScriptInit()
{
//Put your songs here
AddSongToDialog("Example Name","http://www.example.com/yoursong.mp3"); //Example
for(new i=0;i {
if(i != 0)
{
if(i==1) format(songstr,sizeof songstr,"%s\n",SongInfo[i][sname]);
if(i!=1) format(songstr,sizeof songstr,"%s%s\n",songstr,SongInfo[i][sname]);
}
}
return 1;
}
// The command to open the radio menu
CMD:radio(playerid)
{
ShowPlayerDialog(playerid,RADIODIALOG,DIALOG_STYLE_LIST,"{FF0000}Choose a Song:",songstr,"Listen","Turn off");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == RADIODIALOG)
{
if(!response) return StopAudioStreamForPlayer(playerid),SendClientMessage(playerid,-1,"You turned off the radio.");
if(listitem == CurSongs+1) return 1;
PlayAudioStreamForPlayer(playerid,SongInfo[listitem+1][song]);
for(new i=0;i<50;i++) SendClientMessage(playerid,-1," ");
SendClientMessage(playerid,-1,"{CCCC00}Loading!{FFFFFF} Please wait till the song is loaded. (It will take max. 10 seconds)");
format(struse,sizeof struse,"You are listening to: {0CC0FF}%s",SongInfo[listitem+1][sname]);
SendClientMessage(playerid,-1,struse);
return 1;
}
return 1;
}