Music play for all
#1

How to play music play for all players ? example /music [link]...
Reply
#2

pawn Код:
CMD:music(playerid, params[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        PlayAudioStreamForPlayer(i, ''Link Here'');
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by HY
Посмотреть сообщение
pawn Код:
CMD:music(playerid, params[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        PlayAudioStreamForPlayer(i, ''Link Here'');
    }
    return 1;
}
This.
Reply
#4

He asked specifically for a command where you type "/music URL" ingame, so you choose your music without having to edit it in the script.

pawn Код:
CMD:music(playerid, params[])
{
    new url[128];
    if(sscanf(params,"s[128]",url)) return SendClientMessage(playerid,-1,"USAGE: /music (url)");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            PlayAudioStreamForPlayer(i, url);
        }
        return 1;
}
Or if you want it for RCON only:

pawn Код:
CMD:music(playerid, params[])
{
    if(!PlayerIsAdmin(playerid)) return SendClientMessage(playerid,-1,"ERROR: Only administrators may use this command.");
    {
        new url[128];
        if(sscanf(params,"s[128]",url)) return SendClientMessage(playerid,-1,"USAGE: /music (url)");
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                PlayAudioStreamForPlayer(i, url);
            }
    }
        return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)