12.08.2012, 05:12
This is the code and I would like it to play music to all of the players, but it will only play music to me for some reason. I even had someone else use the command and I heard the music but they did not. They do have the audio Client installed.
pawn Код:
CMD:music(playerid, params[])
{
if(!IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, COLOR_RED, "You cannot use this command");
return 1;
}
else
{
new string[128], url[128];
if(sscanf(params, "s[256]", url)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /music [url]");
if(!strcmp(url, "stop", true, 4))
{
StopAudioStreamForPlayer(playerid);
SendClientMessage(playerid, COLOR_RED, " You have stopped listening to music.");
return 1;
}
format(string, sizeof(string), "An Admin Has Started A Song. Use '/music stop' to stop the song");
SendClientMessageToAll(COLOR_ORANGE, string);
foreach(Player, i)
{
PlayAudioStreamForPlayer(i, url);
}
}
return 1;
}