/astream [mp3 link] help [SIMPLE]
#1

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.
Reply
#2

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
Reply
#3

Upload your mp3 tunes to Dropbox and use the link from that. I had the same problem with mp3 streaming.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)