Audiostream help
#1

Код:
CMD:animals(playerid, params[])
{
    for( new u; u < MAX_PLAYERS; u++ )
    {
        PlayAudioStreamForPlayer( u, "http://k002.kiwi6.com/hotlink/v01a10y69h/animals.mp3" );
    }
    SendClientMessageToAll(-1, "Now playing: Martin Garrix - Animals");
    return 1;
}
Dis I have made, When one writes /animals, the message pops, but no music.

Add this:

Код:
CMD:animals(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
{
    for( new u; u < MAX_PLAYERS; u++ )
    {
        PlayAudioStreamForPlayer( u, "http://k002.kiwi6.com/hotlink/v01a10y69h/animals.mp3" );
    }
}
else {
SendClientMessage(playerid, -1, "Nope!");
}
SendClientMessageToAll(-1, "Now playing: Martin Garrix - Animals");
return 1;
}
Only I as the RCOn admin can hear it.

Im trying to make it so when 1 writes /animals, everybody on the server gets looped the stream.

Help apprecciated and will get repped.

Ty in advance!
Reply
#2

Create a public function like that.. Then use it under your cmd..
pawn Код:
forward PlayerAudioStreamForAll(url);
Public PlayAudioStreamForAll(url)
{
   for(new i =0;i<MAX_PLAYERS;i++)
  {
     PlayAudioStreamForPlayer(i, url);
  }
return 1;
}
Reply
#3

pawn Код:
CMD:animals(playerid, params[])
{
new audioplaying;
    if(IsPlayerAdmin(playerid))
{
    audioplaying =1;
}
for( new u; u < MAX_PLAYERS; u++ )
    {
        if(audioplaying == 1)
            {
            PlayAudioStreamForPlayer( u, "http://k002.kiwi6.com/hotlink/v01a10y69h/animals.mp3" );
            }
}
else {
SendClientMessage(playerid, -1, "Nope!");
}
SendClientMessageToAll(-1, "Now playing: Martin Garrix - Animals");
return 1;
}
apologies for the shitty indents.
Reply
#4

The last one is so random, it does the exact opposite for what I want.
The idea is right, but I want every player to have "Audioplaying == 1".

I couldn't make the first answer work also.

Still need help.
Reply
#5

Код:
new Audioplaying;

forward PlayerAudioStreamForAll(url);
Public PlayAudioStreamForAll(url)
{
   for(new i =0;i<MAX_PLAYERS;i++)
  {
     PlayAudioStreamForPlayer(i, url);
     Audioplaying[i] == 1;
  }
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)