Little help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Little help (
/showthread.php?tid=615110)
Little help -
Muhammad78 - 17.08.2016
Код:
CMD:amusic(playerid, params[])
{
if(PlayerInfo[playerid][Level] >= 6 || IsPlayerAdmin(playerid))
{
if(isnull(params))
{
SendClientMessage(playerid, red, "USAGE: /amusic [url]");
SendClientMessage(playerid, white, "NOTE: /astop to stop the music!");
}
else
{
new string[128], namexx[24];
GetPlayerName(playerid,namexx,24);
format(string,sizeof(string),"Administrator '%s' has Started a music for all players!",namexx);
SendClientMessageToAll(CYAN,string);
for(new i;i<MAX_PLAYERS;i++)
{
PlayAudioStreamForPlayer(i, params);
}
}
} else SendClientMessage(playerid, red, "ERROR: You are not a high enough level to use this command");
return 1;
}
what is wrong with the command? when i did
/amusic url the music didn't started
Re: Little help -
M8 - 17.08.2016
Are you using ******* link to play music?
Re: Little help -
Muhammad78 - 18.08.2016
Quote:
Originally Posted by M8
Are you using ******* link to play music?
|
yes im using ******* link
Re: Little help - iLearner - 18.08.2016
You'll need to use .mp3 link I guess or a playlist
Re: Little help -
Tass007 - 18.08.2016
https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer
"The url to play. Valid formats are mp3 and ogg/vorbis. A link to a .pls (playlist) file will play that playlist."
The reason why the audio isn't streaming is because your posting a *******.com url. You need to get a direct link to a .mp3 file or ogg/vorbis file.
Re: Little help -
Muhammad78 - 18.08.2016
can you give me link of .mp3 uploader?
Re: Little help -
M8 - 18.08.2016
Songily worked for me. You can try that. Search the song and copy music link.
Re: Little help -
Tass007 - 09.09.2016
Hey. I know this is a little old, but this will work with ******* links.
PHP код:
CMD:amusic(playerid, params[])
{
if(PlayerInfo[playerid][Level] >= 6 || IsPlayerAdmin(playerid))
{
if(isnull(params))
{
SendClientMessage(playerid, red, "USAGE: /amusic [url]");
SendClientMessage(playerid, white, "NOTE: /astop to stop the music!");
}
else
{
new string[128], namexx[24];
GetPlayerName(playerid,namexx,24);
format(string,sizeof(string),"Administrator '%s' has Started a music for all players!",namexx);
SendClientMessageToAll(CYAN,string);
for(new i;i<MAX_PLAYERS;i++)
{
format(params, 145, "http://www.*******inmp3.com/fetch/?video=%s", params);
PlayAudioStreamForPlayer(i, params);
}
}
} else SendClientMessage(playerid, red, "ERROR: You are not a high enough level to use this command");
return 1;
}
Re: Little help -
SickAttack - 09.09.2016
Above, or this very similar advanced script:
https://sampforum.blast.hk/showthread.php?tid=614986