Music command help
#2

Try this...
pawn Код:
CMD:music(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /music [url]");
    if(!strcmp(params, "stop", true, 4))
    {
        StopAudioStreamForPlayer(playerid);
        SendClientMessage(playerid, COLOR_LIGHTRED, " You have stopped listening to music.");
        return 1;
    }
    if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    format(string, sizeof(string), "AdmCmd: %s has started playing a song globally. ('/music stop' to stop listening)", RPN(playerid));
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    format(string,sizeof(string),"http://americanrp.x10.mx/songs/%s",params);
    foreach(Player, i)
    {
        PlayAudioStreamForPlayer(i, string);
    }
    return 1;
}
Reply


Messages In This Thread
Music command help - by MichaelWharton101 - 20.03.2013, 01:19
Re: Music command help - by mastermax7777 - 20.03.2013, 07:38

Forum Jump:


Users browsing this thread: 1 Guest(s)