if(strcmp(cmd, "/playradio", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
}
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "{FF0000}[USAGE]:{FFFFFF} /playradio {009900}(on/off){FFFFFF}");
return 1;
}
if(strcmp(tmp,"on",true) == 0)
{
if(PlayerInfo[playerid][pAdmin] == 1337)
{
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
playerBoombox[playerid] = CreateObject(2103, X, Y+1, Z, 1.5, 0.0, 0.0, 0.0);
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Los Santos Radio","Top Teen Radio\nTop Radio\nClassic Hits Radio\nRock Radio\nTop Teen Radio (ALL)\nTop Radio (ALL)\nChristmas Songs\nChristmas Songs (ALL)","Select","Cancel"); }
}
if(strcmp(tmp,"off",true) == 0)
{
if(PlayerInfo[playerid][pAdmin] == 1337)
{
DestroyObject(playerBoombox[playerid]);
for(new i = 0; i < MAX_PLAYERS; i++)
StopAudioStreamForPlayer(i);
}
}
return 1;
}
if(dialogid == 1 && response)
{
switch(listitem)//playradio
{
case 0:
{ // Top Teen Radio
new Float:X, Float:Y, Float:Z, Float:Distance = 500.0;
GetPlayerPos(playerid, X, Y, Z);
for(new i = 0; i < MAX_PLAYERS; i++)
PlayAudioStreamForPlayer(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=104760", X, Y, Z, Distance, 500);//Teen Top Music
}
case 1:
{ // Top Radio
new Float:X, Float:Y, Float:Z, Float:Distance = 500.0;
GetPlayerPos(playerid, X, Y, Z);
for(new i = 0; i < MAX_PLAYERS; i++)
PlayAudioStreamForPlayer(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1078816", X, Y, Z, Distance, 500);//Top Music Songs
}
case 2:
{ // Classic Hits Radio
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
for(new i = 0; i < MAX_PLAYERS; i++)
PlayAudioStreamForPlayer(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=9472196", X, Y, Z, Distance, 500);//Hit Music (Old and New)
}
case 3:
{ // Rock Radio
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
for(new i = 0; i < MAX_PLAYERS; i++)
PlayAudioStreamForPlayer(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1331010", X, Y, Z, Distance, 500);//Rock
}
case 4:
{ // Top Teen Radio (ALL)
new Float:X, Float:Y, Float:Z, Float:Distance = 100.0;
GetPlayerPos(playerid, X, Y, Z);
for(new i = 0; i < MAX_PLAYERS; i++)
PlayAudioStreamForPlayer(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=104760", X, Y, Z, Distance, 100);//Teen Top Music (ALL)
}
case 5:
{ // Top Radio (ALL)
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
for(new i = 0; i < MAX_PLAYERS; i++)
PlayAudioStreamForPlayer(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1078816", X, Y, Z, Distance, 500);//Top Music Songs (ALL)
}
case 6:
{ // Christmas Songs
new Float:X, Float:Y, Float:Z, Float:Distance = 100.0;
GetPlayerPos(playerid, X, Y, Z);
for(new i = 0; i < MAX_PLAYERS; i++)
PlayAudioStreamForPlayer(i, "http://listen.sky.fm/public3/christmas.pls", X, Y, Z, Distance, 100);//Christmas Music
}
case 7:
{ // Christmas Songs (ALL)
new Float:X, Float:Y, Float:Z, Float:Distance = 500.0;
GetPlayerPos(playerid, X, Y, Z);
for(new i = 0; i < MAX_PLAYERS; i++)
PlayAudioStreamForPlayer(i, "http://listen.sky.fm/public3/christmas.pls", X, Y, Z, Distance, 500);//Christmas Music (ALL)
}
}
}

|
Ahhh, I'm confused which is why I need help.
How would I do range as is depends on stream being played (somtimes it's 500 and somtimes 100)? How would I do the code that it's on? Please tell me exactly what to put based on my code (sorry, but I am a very begginer to this type of thing). Thanks so much! +1 Rep for the help so far. |