PlayStreamForAll
#3

Quote:
Originally Posted by Xabi
Посмотреть сообщение
pawn Код:
stock PlayStreamForAll(url[])
{
    foreach(Player, i)
    {
        StopAudioStreamForPlayer(i);
        PlayAudioStreamForPlayer(i, url);
    }
    print("[AdmCmd]: Admin Is Streaming Music Globally.");
    return 1;
}
pawn Код:
if(strcmp(cmd, "/stream", true) == 0)
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        new url[128];
        new length = strlen(cmdtext);
        while ((idx < length) && (cmdtext[idx] <= ' '))
        {
            idx++;
        }
        new offset = idx;
        while ((idx < length) && ((idx - offset) < (sizeof(url) - 1)))
        {
            url[idx - offset] = cmdtext[idx];
            idx++;
        }
        url[idx - offset] = EOS;
        foreach(Player, i)
        {
            PlayStreamForAll(url);
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY,"   You are not authorized to use that command !");
    }
}
Try that, but this would be better scripted using ZCMD and sscanf2.
I've tried to get ingame and use just /stream then /stream [url] and look what it did:


Plus it played the music 3 times and when i used /stopstream with this command:
Код:
// Stops music for everyone!
if(strcmp(cmd, "/stopstream", true) == 0)
{
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
	    foreach(Player, i)
	    {
	        StopAudioStreamForPlayer(i);
		}
	}
	return 1;
}
it stops only 2 of those URL's, and i cant stop the third..
Reply


Messages In This Thread
PlayStreamForAll - by maxpain43 - 25.07.2013, 10:51
Respuesta: PlayStreamForAll - by Xabi - 25.07.2013, 11:07
Re: Respuesta: PlayStreamForAll - by maxpain43 - 25.07.2013, 11:32
Respuesta: PlayStreamForAll - by Xabi - 25.07.2013, 13:26
Re: Respuesta: PlayStreamForAll - by maxpain43 - 25.07.2013, 23:47
Re: PlayStreamForAll - by PT - 26.07.2013, 02:56
Re: PlayStreamForAll - by maxpain43 - 26.07.2013, 03:34
Re: PlayStreamForAll - by maxpain43 - 26.07.2013, 15:06
Re: PlayStreamForAll - by PT - 26.07.2013, 16:55
Re: PlayStreamForAll - by maxpain43 - 26.07.2013, 17:37

Forum Jump:


Users browsing this thread: 1 Guest(s)