Quote:
Originally Posted by Xabi
pawn Код:
stock PlayStreamForAll(url[]) { foreach(Player, i) { StopAudioStreamForPlayer(i); PlayAudioStreamForPlayer(i, url); } print("[AdmCmd]: Admin Is Streaming Music Globally."); return 1; }
pawn Код:
if(strcmp(cmd, "/stream", true) == 0) { if(PlayerInfo[playerid][pAdmin] >= 1) { new url[128]; new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; while ((idx < length) && ((idx - offset) < (sizeof(url) - 1))) { url[idx - offset] = cmdtext[idx]; idx++; } url[idx - offset] = EOS; foreach(Player, i) { PlayStreamForAll(url); } } else { SendClientMessage(playerid, COLOR_GREY," You are not authorized to use that command !"); } }
Try that, but this would be better scripted using ZCMD and sscanf2.
|
I've tried to get ingame and use just /stream then /stream [url] and look what it did:
Plus it played the music 3 times and when i used /stopstream with this command:
Код:
// Stops music for everyone!
if(strcmp(cmd, "/stopstream", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
foreach(Player, i)
{
StopAudioStreamForPlayer(i);
}
}
return 1;
}
it stops only 2 of those URL's, and i cant stop the third..