Stream for all players?
#1

How can i stream music for all players on server with command. Someone please help.
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=92679
Reply
#3

Quote:
Originally Posted by RedJohn
Посмотреть сообщение
I dont get this can u write me FS or code?
Reply
#4

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.
Reply
#5

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?
Reply
#6

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.
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)