30.08.2013, 09:51
How can i stream music for all players on server with command. Someone please help.
foreach(Player, i)
{
PlayAudioStreamForPlayer(i, "http://somafm.com/tags.pls");
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, "http://somafm.com/tags.pls");
}
Have you created any code or something?
With foreach: pawn Код:
Without foreach: pawn Код:
|
COMMAND:stream(playerid, params[])
{
ShowPlayerDialog(playerid, 1302, DIALOG_STYLE_LIST, "Stream", "Song 1\nSong 2\nSong 3", "Select", "Close");
return 1;
}
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;
}
pawn Код:
pawn Код:
|