Some music in onplayerrequestclass
#1

Hi guys,

I want to add some music in OnPlayerRequestClass, but I dont know how to do that, I've tried a lot of things that I found in this forum and ****** etc.. But without results. My question is if anyone can help me out.

Thanks

mickos
Reply
#2

Код:
public OnPlayerRequestClass(playerid,classid)
{
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls");
return 1;
}
Just change the URL to your specified radio channel
Reply
#3

pawn Код:
new bool:playmusic[MAX_PLAYERS];

public OnPlayerRequestClass(playerid, classid)
{
    if(playmusic[playerid] == false) {
        // PlayAudioStreamForPlayer or PlayerPlaySound
        playmusic[playerid] = true;
    }
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    playmusic[playerid] = false;
    return 1;
}
About:
PlayAudioStreamForPlayer
PlayerPlaySound

Have fun.
Reply
#4

Quote:
Originally Posted by Dopefull
Посмотреть сообщение
Код:
public OnPlayerRequestClass(playerid,classid)
{
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls");
return 1;
}
Just change the URL to your specified radio channel
That will play the music each time player clicks ">>>>" next section button.
I'd use a variable to detects if it's the first class.
pawn Код:
new Var[MAX_PLAYERS];
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
        if(Var[playerid] == 0){
              PlayAudioStreamForPlayer(playerid, url[])
              Var[playerid] = 1;
        }
    return 1;
}
And for your question, it's this function:
PlayAudioStreamForPlayer
ADD: too damn late.
Reply
#5

I dont have my own music station
Reply
#6

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
That will play the music each time player clicks ">>>>" next section button.
I'd use a variable to detects if it's the first class.
pawn Код:
new Var[MAX_PLAYERS];
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
        if(Var[playerid] == 0){
              PlayAudioStreamForPlayer(playerid, url[])
              Var[playerid] = 1;
        }
    return 1;
}
And for your question, it's this function:
PlayAudioStreamForPlayer
ADD: too damn late.
Well I'm new to all this so I didn't know OP use this example instead


Quote:
Originally Posted by mickos
Посмотреть сообщение
I dont have my own music station
Use this site: www.shoutcast.com and search for the specific radio that you like
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)