29.11.2013, 05:51
Usage: /streamtoall link SONGNAME SONGARTIST.
To stop the music:
PHP код:
CMD:streamtoall(playerid, params[])
{
new song[128], songname[128], songartist[128];
new string[128];
if(sscanf(params, "sss", song, songname, songartist)) return SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /streamtoall [Web link to an audio file. (mp3skull.com)] [Song Name (Underscore for space)] [Song Artist (Underscore for space)]");
for(new i = 0; i < strlen(songname); i++)
{
if(songname[i] == '_')
{
songname[i] = ' ';
}
}
for(new i = 0; i < strlen(songartist); i++)
{
if(songartist[i] == '_')
{
songartist[i] = ' ';
}
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
format(string, sizeof(string), "Song playing: %s by %s.", songname, songartist);
SendClientMessage(i, COLOR_ORANGE, string);
PlayAudioStreamForPlayer(i, song);
}
}
return 1;
}
PHP код:
CMD:stopplay(playerid, params[])
{
StopAudioStreamForPlayer(playerid);
SendClientMessage(playerid, COLOR_ORANGE, "Audio stopped!");
return 1;
}