Stream for all players? - 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: Stream for all players? (
/showthread.php?tid=460863)
Stream for all players? -
jovapeba - 30.08.2013
How can i stream music for all players on server with command. Someone please help.
Re: Stream for all players? -
RedJohn - 30.08.2013
https://sampforum.blast.hk/showthread.php?tid=92679
Re: Stream for all players? -
jovapeba - 30.08.2013
Quote:
Originally Posted by RedJohn
|
I dont get this can u write me FS or code?
Re: Stream for all players? -
RedJohn - 30.08.2013
Have you created any code or something?
With foreach:
pawn Код:
foreach(Player, i)
{
PlayAudioStreamForPlayer(i, "http://somafm.com/tags.pls");
}
Download foreach and place it into your includes folder.
Without foreach:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, "http://somafm.com/tags.pls");
}
Both have same result, but it's faster with foreach.
Re: Stream for all players? -
jovapeba - 30.08.2013
Quote:
Originally Posted by RedJohn
Have you created any code or something?
With foreach:
pawn Код:
foreach(Player, i) { PlayAudioStreamForPlayer(i, "http://somafm.com/tags.pls"); }
Download foreach and place it into your includes folder.
Without foreach:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++) { PlayAudioStreamForPlayer(i, "http://somafm.com/tags.pls"); }
Both have same result, but it's faster with foreach.
|
Ok I dont have any code, i get this now but how can i make dialog with my song and i select one and then it play for all players. Is that posbile and if it is how?
Re: Stream for all players? -
RedJohn - 30.08.2013
pawn Код:
COMMAND:stream(playerid, params[])
{
ShowPlayerDialog(playerid, 1302, DIALOG_STYLE_LIST, "Stream", "Song 1\nSong 2\nSong 3", "Select", "Close");
return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new i;
if(response)
{
switch(listitem)
{
case 0:
{
for(i = 0; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, "http://somafm.com/tags.pls");
}
}
case 1:
{
for(i = 0; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, "http://somafm.com/tags.pls");
}
}
case 2:
{
for(i = 0; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, "http://somafm.com/tags.pls");
}
}
}
}
return 1;
}
Change urls to your music urls.
Re: Stream for all players? -
jovapeba - 30.08.2013
Quote:
Originally Posted by RedJohn
pawn Код:
COMMAND:stream(playerid, params[]) { ShowPlayerDialog(playerid, 1302, DIALOG_STYLE_LIST, "Stream", "Song 1\nSong 2\nSong 3", "Select", "Close"); return 1; }
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { new i; if(response) { switch(listitem) { case 0: { for(i = 0; i < MAX_PLAYERS; i++) { PlayAudioStreamForPlayer(i, "http://somafm.com/tags.pls"); } } case 1: { for(i = 0; i < MAX_PLAYERS; i++) { PlayAudioStreamForPlayer(i, "http://somafm.com/tags.pls"); } } case 2: { for(i = 0; i < MAX_PLAYERS; i++) { PlayAudioStreamForPlayer(i, "http://somafm.com/tags.pls"); } } } } return 1; }
Change urls to your music urls.
|
OK thanks.