06.02.2014, 05:56
Quote:
pawn Код:
|
All players will see the message, but only player 0 will hear it.
pawn Код:
command(burn, playerid, params[]) //This is how the ZCMD processor is used, this is creating the command so it can be used and perform the required code.
{
for(new i=0; i<MAX_PLAYERS; i++) //This will create a loop to see who is connected to the server.
{
if(IsPlayerConnected(i)) //This will check the loop to see if the player(s) are connected, and if so they will be selected and the music file will be played out to them.
{
PlayAudioStreamForPlayer(i,"http://dl.farskids405.com/Aria/92/4/15/Ellie%20Goulding%20-%20Burn%20[128].mp3"); //This function will grab the mp3 file from the URL, then play it back to the connected players.
}
}
SendClientMessageToAll(-1, "Track playing-Ellie Goulding - Burn"); //This will send a message to all connected players, notifying them that "Ellie Goulding - Burn" is playing.
return 1;
}
Just put the message outside the loop.