Posts: 351
Threads: 54
Joined: Apr 2010
How do i connect these 2 to work together (that /stopmusic stops /music)
Код:
if(strcmp(cmd, "/music", true) == 0)
{
Audio_PlayStreamed(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=674096", false, false, false);
return 1;
}
if(strcmp(cmd, "/stopmusic", true) == 0)
{
Audio_Stop(playerid, 0);
return 1;
}
Thanks
Posts: 351
Threads: 54
Joined: Apr 2010
Quote:
Originally Posted by Raimis_R
Also you can create new Music[MAX_PLAYERS]; and check if player listening music or not
Код:
if(strcmp(cmd, "/music", true) == 0)
{
if(Music[playerid] == 0)
{
Music[playerid] = Audio_PlayStreamed(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=674096");
SendClientMessage(playerid,COLOR,"You are listening Tunein Station.");
Music[playerid] = 1;
}
return true;
}
if(strcmp(cmd, "/stopmusic", true) == 0)
{
if(Music[playerid] == 1)
{
Audio_Stop(playerid, Music[playerid]);
SendClientMessage(playerid,COLOR,"Your are stoped Radio.");
Music[playerid] = 0;
}
return true;
}
|
Quote:
Originally Posted by Fj0rtizFredde
Like this:
pawn Код:
new Radio[MAX_PLAYERS]; //On top of your script (Not sure if you need MAX_PLAYERS but I use it like that :p)
//In your /music cmd: Radio[playerid] = Audio_PlayStreamed(blah.......);
//In your /stop cmd: Audio_Stop(playerid, Radio[playerid]);
|
Thanks, testing it right now
EDIT : tanks so much for help, works great