SA-MP Forums Archive
Song for all - 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: Song for all (/showthread.php?tid=369549)



Song for all - Vizi - 17.08.2012

How to make a song for all??Like a cmd and when type the cmd to play a song for everybody


Re: Song for all - Youice - 17.08.2012

here, good luck (;


Re: Song for all - RanSEE - 17.08.2012

Ok, we can start off simply.

Код:
COMMAND:wawmusic(playerid, params[])
{
	PlayAudioStreamForPlayer(playerid, *PUT URL HERE*");
	SendClientMessage(playerid, COLOR_BLUE, "[INFO] You Have turned waw music on!");
	return 1;
}



Re: Song for all - Vizi - 17.08.2012

i need for all players i know that


Re: Song for all - RanSEE - 17.08.2012

Код:
stock PlayAudioStreamForAll(url[])
{
    for(new i; i<GetMaxPlayers(); i++)
    {
        if(IsPlayerConnected( i ))
        {
            PlayAudioStreamForPlayer(i, url, x, y, z, distance);
        }
    }
    return 1;
   
}
stock StopAudioStreamForAll(url[])
{
    for(new i; i<GetMaxPlayers(); i++)
    {
        if(IsPlayerConnected( i ))
        {
             StopAudioStreamForPlayer(playerid);
        }
    }
    return 1;
   
}
YCMD:stopmusic(playerid, params[], help)
{
#pragma unused params
    if (help)
    {
        SendClientMessage(playerid, 0xFF0000AA, "Stops audio for everyone.");
    }
    else
    {
        new
            str[32];
        if (isnull(params))
        {
            format(str, sizeof (str), "Usage: \"/stopmusic\"";
            SendClientMessage(playerid, 0xFF0000AA, str);
        }
        else
        {
            StopAudioStreamForPlayer(playerid);
        }
    }
    return 1;
}
YCMD:music(playerid, params[], help)
{
    if (help)
    {
        SendClientMessage(playerid, 0xFF0000AA, "Plays audio for everyone.");
    }
    else
    {
        new
            str[32];
        if (isnull(params))
        {
            format(str, sizeof (str), "Usage: \"/music [url]\"";
            SendClientMessage(playerid, 0xFF0000AA, str);
        }
        else
        {
            PlayAudioStreamForAll(params);
        }
    }
    return 1;
}
Here is what i use, ycmd