How can i script an Admin CMD to put music for a server with a custom URL
#1

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
Reply
#2

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

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;
}
Reply
#4

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

dude check my post o.O
Reply
#6

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

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)