/astream [mp3 link] help [SIMPLE] - 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: /astream [mp3 link] help [SIMPLE] (
/showthread.php?tid=467014)
/astream [mp3 link] help [SIMPLE] -
PabloDiCostanzo - 30.09.2013
Greetings,
Hi users, okay I was making a simple command like when an admin use /astream [mp3 link] all teh serevr listen the song, but it doesen`t wotk. Wehn I try to use it I get this in the server:
pawn Код:
Audio Stream:
(For example if I have 3 players conected send the same 3 times)
And I don`t know why the server can not read the mp3 link
Here is my code:
pawn Код:
CMD:astream(playerid, params[])
{
if(gPlayerInfo[playerid][pAdmin] >= 4)
{
new string[128];
format(string, sizeof(string), "SERVER: Administrator %s has putted music", GetName(playerid));
SendClientMessageToAll(COL_ORANGE, string);
{
foreach(Player, i)
{
if(isnull(params)) return SendClientMessage(playerid, -1, "{878787}USAGE: /music [mp3 link]");
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
format(string, sizeof(string), "%s");
PlayAudioStreamForPlayer(i, string);
}
}
}
}
} else SendClientMessage(playerid, -1, "SERVER: You are not allowed to use this command");
return 1;
}
If anyone can help me
Regards,
Pablo.
Re: /astream [mp3 link] help [SIMPLE] - Patrick - 30.09.2013
Try this
pawn Код:
CMD:astream(playerid, params[])
{
if(gPlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, -1, "SERVER: You are not allowed to use this command");
{
if(isnull(params)) return SendClientMessage(playerid, -1, "{878787}USAGE: /music [mp3 link]");
{
foreach(Player, i)
{
PlayAudioStreamForPlayer(i, params);
}
}
new string[128];
format(string, sizeof(string), "SERVER: Administrator %s has played a music", GetName(playerid));
SendClientMessageToAll(COL_ORANGE, string);
}
return 1;
}
Your Mistakes
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
// and //
foreach(Player, i)
Both of them are loop, they work the same, you don't need two! you just need one.
pawn Код:
PlayAudioStreamForPlayer(i, string);
// should be //
PlayAudioStreamForPlayer(i, params);
String is a string, obviously the music won't play, string and params works different
Re: /astream [mp3 link] help [SIMPLE] -
AphexCCFC - 30.09.2013
Upload your mp3 tunes to Dropbox and use the link from that. I had the same problem with mp3 streaming.