12.08.2012, 08:48
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 (new i : Player)
{
PlayAudioStreamForPlayer(i, url);
}
}
return 1;
}