SA-MP Forums Archive
How can i script an Admin CMD to put music for a server with a custom URL - 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: How can i script an Admin CMD to put music for a server with a custom URL (/showthread.php?tid=511839)



How can i script an Admin CMD to put music for a server with a custom URL - D3vin - 07.05.2014

Guys please help me i want to make a command to put music for all players on my server
also a command for players so they can stop the music if they didn't like /stopplay to stop music for player and /toggleplay to toggle the music off till he log



Re: How can i script an Admin CMD to put music for a server with a custom URL - Guest4390857394857 - 07.05.2014

Learn foreach.inc
And use play,stop audios stream for player functions.


Re: How can i script an Admin CMD to put music for a server with a custom URL - Eth - 07.05.2014

pawn Код:
CMD:stopplay(playerid,params[])
{
 StopAudioStreamForPlayer(playerid);
return 1;
}
at the top of the script:
pawn Код:
new music[MAX_PLAYERS];
now the command for the playaudiostream for everyone :
pawn Код:
CMD:play(playerid,params[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(music[i] == 0)
{
    PlayAudioStreamForPlayer(i, "musichere");
}
}
return 1;
}
now the toggle:
pawn Код:
CMD:toggleplay(playerid,params[])
{
if(music[playerid] == 0)
{
music[playerid] = 1;
SendClientMessage(playerid,-1,"Notice:you can't hear the music now");
}
if(music[playerid] == 1)
{
music[playerid] = 0;
SendClientMessage(playerid,-1,"Notice:you can hear the music now");
}
return 1;
}



Re : How can i script an Admin CMD to put music for a server with a custom URL - D3vin - 07.05.2014

what about the /toggleplay to stop music for the player till he logs


Re: How can i script an Admin CMD to put music for a server with a custom URL - Eth - 07.05.2014

dude check my post o.O


Re : How can i script an Admin CMD to put music for a server with a custom URL - D3vin - 07.05.2014

Should i script the URL lol ? i said i want to type a custom URL IG i ment not script it man


Re: Re : How can i script an Admin CMD to put music for a server with a custom URL - iZN - 07.05.2014

Quote:
Originally Posted by D3vin
Посмотреть сообщение
Should i script the URL lol ? i said i want to type a custom URL IG i ment not script it man
With that English, nobody can help. I guess you meant this?

pawn Код:
CMD:play(playerid, params[])
{
    if(isnull(params))
    {
        SendClientMessage(playerid, -1, "USAGE: /play (link)");
        return true;
    }

    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(music[i] != 0)
        {
            PlayAudioStreamForPlayer(i, params);
        }
    }

    return true;
}