/music help
#1

This is the code and I would like it to play music to all of the players, but it will only play music to me for some reason. I even had someone else use the command and I heard the music but they did not. They do have the audio Client installed.
pawn Код:
CMD:music(playerid, params[])
{
    if(!IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid, COLOR_RED, "You cannot use this command");
        return 1;
    }
    else
    {
        new string[128], url[128];
        if(sscanf(params, "s[256]", url)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /music [url]");
        if(!strcmp(url, "stop", true, 4))
        {
            StopAudioStreamForPlayer(playerid);
            SendClientMessage(playerid, COLOR_RED, " You have stopped listening to music.");
            return 1;
        }

        format(string, sizeof(string), "An Admin Has Started A Song. Use '/music stop' to stop the song");
        SendClientMessageToAll(COLOR_ORANGE, string);
        foreach(Player, i)
        {
            PlayAudioStreamForPlayer(i, url);
        }
    }
    return 1;
}
Reply
#2

pawn Код:
CMD:music(playerid, params[])
{
    if(!IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid, COLOR_RED, "You cannot use this command");
        return 1;
    }
    else
    {
        new string[128], url[128];
        if(sscanf(params, "s[256]", url)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /music [url]");
        if(!strcmp(url, "stop", true, 4))
        {
            StopAudioStreamForPlayer(playerid);
            SendClientMessage(playerid, COLOR_RED, " You have stopped listening to music.");
            return 1;
        }

        format(string, sizeof(string), "An Admin Has Started A Song. Use '/music stop' to stop the song");
        SendClientMessageToAll(COLOR_ORANGE, string);
        foreach (new i : Player)
        {
            PlayAudioStreamForPlayer(i, url);
        }
    }
    return 1;
}
Didn't tested it! But try anyway!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)