How to play music in server? -
tobi736 - 03.08.2018
i want to code, if play join the game, the music will play and loops?
pls help me, i need a example
Re: How to play music in server? -
GRiMMREAPER - 03.08.2018
PlayAudioStreamForPlayer under OnPlayerConnect.
Re: How to play music in server? -
tobi736 - 03.08.2018
i want to loop it? how i can?
Re: How to play music in server? -
DBZdabIt3Bro7 - 03.08.2018
Quote:
Originally Posted by tobi736
i want to loop it? how i can?
|
I wouldn't do that... by the script... just imagine getting spammed with:
PHP код:
Audio Stream: http://example.com/folder/subfolder/index.php?file=example&extension=mp3
Audio Stream: http://example.com/folder/subfolder/index.php?file=example&extension=mp3
Audio Stream: http://example.com/folder/subfolder/index.php?file=example&extension=mp3
Audio Stream: http://example.com/folder/subfolder/index.php?file=example&extension=mp3
Audio Stream: http://example.com/folder/subfolder/index.php?file=example&extension=mp3
Audio Stream: http://example.com/folder/subfolder/index.php?file=example&extension=mp3
Audio Stream: http://example.com/folder/subfolder/index.php?file=example&extension=mp3
...
Just loop your audio file instead.
Re: How to play music in server? -
sonn51280 - 04.08.2018
onplayerconnect Add Code PlayAudioStreamForPlayer
Re: How to play music in server? -
RogueDrifter - 04.08.2018
Set a timer thats approx the same time of ur music that will stop and replay the same file to loop it.
Ex:
PHP код:
#define MUSIC_TIME 3*60*60 // 3 minutes (The length of the music you play).
public OnPlayerConnect(playerid)
{
PlayAudioStreamForPlayer(playerid, "Link"); // Firstly play once they connect.
SetTimerEx("PlayMusic", MUSIC_TIME, true, "i", playerid);//The timer to constantly play the music.
return 1;
}
forward PlayMusic(playerid);
public PlayMusic(playerid)
{
StopAudioStreamForPlayer(playerid); // Stop the audio stream in case if it was running.
PlayAudioStreamForPlayer(playerid, "Link"); // Replay it.
return 1;
}
Re: How to play music in server? -
MattBe - 04.08.2018
Set A Timer In Music
Re: How to play music in server? -
Juvanii - 04.08.2018
why you people keep posting same replies, this is not a count of posts race forum. he GOT the idea.
Re: How to play music in server? -
Sew_Sumi - 04.08.2018
I hate music that I can't turn off, as I put the game sound through my sound system, and my music through my headset so I can shut off the music by just muting the headset.
Even though I can turn down the audio in the game, I'd still prefer to be able to pick up the dust.
Re: How to play music in server? -
tobi736 - 04.08.2018
love all, i got a new idea
thanks