Audio Stream For all on command
#1

I need a FS or code for somecommand where i put my link and the musis streams for all players. Thanks
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/playurl", cmdtext, true, 10) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new idx,sendername[200];
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[500];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_RED, "USAGE: /playurl [AudioURL]");
                return 1;
            }
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                PlayAudioStreamForPlayer(i, (result));
            }
        }
        return 1;
    }
    return 0;
}
Have fun >> Keep in mind that the Audio URL cannot be too long, otherwise it wont play. Use /playurl <URL>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)