30.03.2012, 21:45
Hello,
Today I'm going to teach you about some audio stream functions you can use.
Audio Stream was here way before but you needed a special AudioClient to actually receive the audio client client side but since 0.3d Kalcor and his team has implemented AudioClient inside the SA-MP client itself.
So here we go.
What functions is there for the Audio Stream? There is plenty of functions for different kind of usage
Let's work on "PlayAudioStreamForPlayer" for example. Basically what this function do is that it Plays a Stream it could be a radio.pls or even a song.mp3. But this will play it for the player only that calls the functions.
Let's do a simple command with it
And if you wish to stop the Stream you will use the function StopAudioStreamForPlayer(playerid);
You can even use the PlayAudioStreamForPlayer with floats so further you go where you started the stream less you will hear the music or sound
Let's do a quick example
I hope you learned a little about AudioStream and hope to see you read my Part 2 that will be with OnPlayerStateChange and other features.
Today I'm going to teach you about some audio stream functions you can use.
Audio Stream was here way before but you needed a special AudioClient to actually receive the audio client client side but since 0.3d Kalcor and his team has implemented AudioClient inside the SA-MP client itself.
So here we go.
What functions is there for the Audio Stream? There is plenty of functions for different kind of usage
Let's work on "PlayAudioStreamForPlayer" for example. Basically what this function do is that it Plays a Stream it could be a radio.pls or even a song.mp3. But this will play it for the player only that calls the functions.
Let's do a simple command with it
pawn Код:
CMD:play(playerid, params[])
{
PlayAudioStreamForPlayer(playerid, "play.pls"); // Basically this will play the URL Given to the player
}
You can even use the PlayAudioStreamForPlayer with floats so further you go where you started the stream less you will hear the music or sound
Let's do a quick example
pawn Код:
CMD:play2(playerid, params[])
{
new Float:X, Float:Y, Float:Z, Float:Distance = 5.0; // Basically the Distance is the range of the sound/music
GetPlayerPos(playerid, X, Y, Z); // This will get the player Position to set the AudioStream
PlayAudioStreamForPlayer(playerid, "test.pls");
return 1;
}