Little help
#1

Код:
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
Reply
#2

Are you using ******* link to play music?
Reply
#3

Quote:
Originally Posted by M8
Посмотреть сообщение
Are you using ******* link to play music?
yes im using ******* link
Reply
#4

You'll need to use .mp3 link I guess or a playlist
Reply
#5

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.
Reply
#6

can you give me link of .mp3 uploader?
Reply
#7

Songily worked for me. You can try that. Search the song and copy music link.
Reply
#8

Hey. I know this is a little old, but this will work with ******* links.

PHP код:
CMD:amusic(playeridparams[])
{
    if(
PlayerInfo[playerid][Level] >= || IsPlayerAdmin(playerid))
    {
        if(
isnull(params))
        {
            
SendClientMessage(playeridred"USAGE: /amusic [url]");
            
SendClientMessage(playeridwhite"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(params145"http://www.*******inmp3.com/fetch/?video=%s"params);
            
PlayAudioStreamForPlayer(iparams);
            }
        }
    } else 
SendClientMessage(playeridred"ERROR: You are not a high enough level to use this command");
    return 
1;

Reply
#9

Above, or this very similar advanced script: https://sampforum.blast.hk/showthread.php?tid=614986
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)