Audio Stream For all on command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Audio Stream For all on command (
/showthread.php?tid=460611)
Audio Stream For all on command -
jovapeba - 29.08.2013
I need a FS or code for somecommand where i put my link and the musis streams for all players. Thanks
Re: Audio Stream For all on command -
lewismichaelbbc - 29.08.2013
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/playurl", cmdtext, true, 10) == 0)
{
if(IsPlayerConnected(playerid))
{
new idx,sendername[200];
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[500];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_RED, "USAGE: /playurl [AudioURL]");
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, (result));
}
}
return 1;
}
return 0;
}
Have fun

>> Keep in mind that the Audio URL cannot be too long, otherwise it wont play. Use /playurl <URL>