Play*******Song(playerid, *******[]) { new link[128]; format(link, 128, "http://www.*******inmp3.com/fetch/?video=%s", *******); PlayAudioStreamForPlayer(playerid, link); }
I use http://www.*******inmp3.com/ in my server to stream audio from *******.
Код:
Play*******Song(playerid, *******[]) { new link[128]; format(link, 128, "http://www.*******inmp3.com/fetch/?video=%s", *******); PlayAudioStreamForPlayer(playerid, link); } |
public OnPlayerConnect(playerid) { Play*******Song(playerid, "https://www.*******.com/......"); // ... Your code }
I use http://www.*******inmp3.com/ in my server to stream audio from *******.
Код:
Play*******Song(playerid, *******[]) { new link[128]; format(link, 128, "http://www.*******inmp3.com/fetch/?video=%s", *******); PlayAudioStreamForPlayer(playerid, link); } |
Use that function under OnPlayerConnect.
Код:
public OnPlayerConnect(playerid) { Play*******Song(playerid, "https://www.*******.com/......"); // ... Your code } |
Use this function to stop the stream audio https://sampwiki.blast.hk/wiki/StopAudioStreamForPlayer. Put them under OnPlayerSpawn callback and in stop music command.
And use that Play*******Song function in your play music command. |
@x337 how can i make a cmd that ******* song play with a cmd and stop with a cmd?
|
CMD:play(playerid, params[])
{
new song[40];
if(!sscanf(params, s[40], song)) //Seeing if the params is string.
{
Play*******Song(playerid, song); //Then using the function of X337
}
else SCM(playerid, -1, "USE: play [Song url]"); //else if the param isn't string send the following message.
return 1;
}
CMD:stop(playerid)
{
StopAudioStreamForPlayer(playerid); //This function to stop the audio (self describing)
return 1;
}