PlayAudioStreamForPlayer.... HELP
#1

I need help with PlayAudioStreamForPlayer..... HOW to make the sound i want be played in game?!.. What streaming site do i have to use? Please can anyone help me!.... And tell me how to make this work!

And on which "Public" do i need to put it? What do i need to Include and so on?!
Have tried for almost 10hrs now!
+++++++REP!!
Reply
#2

This is the radio script i use.
PHP код:
#include <a_samp>
#include <zcmd>
#define RADIO 3000
#define COLOR_YELLOW 0xDABB3EAA
#define COLOR_GREEN 0x9EC73DAA
new Radio[MAX_PLAYERS];
new 
Radio1[MAX_PLAYERS];
new 
Radio2[MAX_PLAYERS];
new 
Radio3[MAX_PLAYERS];
new 
Radio4[MAX_PLAYERS];
new 
Radio5[MAX_PLAYERS];
new 
Radio6[MAX_PLAYERS];
new 
Radio7[MAX_PLAYERS];
new 
Radio8[MAX_PLAYERS];
new 
Radio9[MAX_PLAYERS];
new 
Radio10[MAX_PLAYERS];
new 
Radio11[MAX_PLAYERS];
new 
Radio12[MAX_PLAYERS];
new 
Radio13[MAX_PLAYERS];
new 
Radio14[MAX_PLAYERS];
CMD:radio(playeridparams[])
{
    
ShowPlayerDialog(playeridRADIODIALOG_STYLE_LIST"Real Online Radio""{007DFF}0 - Classic Rock\n{007DFF}1 - Pop\n{007DFF}2 - Dubstep\n{007DFF}3 - CLassical\n{007DFF}4 - Reggae\n{007DFF}5 - Infowars(Real Talk)\n{007DFF}6 - Comedy\n{007DFF}7 - Jazz\n{007DFF}8 - New Hip Hop\n{007DFF}9 - New Metal\n{007DFF}10 - Old School Metal\n{007DFF}11 - Classic Alternative\n{007DFF}12 - Russian\n{007DFF}13 - Old School Rap\n{007DFF}14 - Jungle\n{007DFF}[STOP RADIO]""Okay""Exit");
    
SendClientMessage(playerid,COLOR_GREEN,"Pick your radio station");
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == RADIO)
    {
        if(
response)
        {
            if(
listitem == 0)// (1-Classic Rock)
            
{
                    
Radio[playerid] = PlayAudioStreamForPlayer(playerid"http://yp.shoutcast.com/sbin/tunein-station.pls?id=49731");
               }
            if(
listitem == 1)// (2-Pop)
            
{
                    
Radio1[playerid] = PlayAudioStreamForPlayer(playerid"http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283896");
               }
            if(
listitem == 2)// (3-Dubstep)
            
{
                    
Radio2[playerid] = PlayAudioStreamForPlayer(playerid"http://yp.shoutcast.com/sbin/tunein-station.pls?id=148196");
               }
            if(
listitem == 3)// (4-CLassical)
            
{
                
Radio3[playerid] = PlayAudioStreamForPlayer(playerid"http://yp.shoutcast.com/sbin/tunein-station.pls?id=22146");
            }
            if(
listitem == 4)// (5-Reggae)
            
{
                
Radio4[playerid] = PlayAudioStreamForPlayer(playerid"http://yp.shoutcast.com/sbin/tunein-station.pls?id=1654897");
            }
            if(
listitem == 5)// (6-Infowars(Real talk))
            
{
                
Radio5[playerid] = PlayAudioStreamForPlayer(playerid"http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
            }
            if(
listitem == 6)// (7-Comedy)
            
{
                
Radio6[playerid] = PlayAudioStreamForPlayer(playerid"http://yp.shoutcast.com/sbin/tunein-station.pls?id=212920");
            }
            if(
listitem == 7)// (8-Jazz)
            
{
                
Radio7[playerid] = PlayAudioStreamForPlayer(playerid"http://yp.shoutcast.com/sbin/tunein-station.pls?id=9486735");
            }
            if(
listitem == 8)// (9-New Hip Hop)
            
{
                
Radio8[playerid] = PlayAudioStreamForPlayer(playerid"http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
            }
            if(
listitem == 9)// (10-New Metal)
            
{
                
Radio9[playerid] = PlayAudioStreamForPlayer(playerid"http://yp.shoutcast.com/sbin/tunein-station.pls?id=545492");
            }
            if(
listitem == 10)// (11-Old School Metal)
            
{
                 
Radio10[playerid] = PlayAudioStreamForPlayer(playerid"http://yp.shoutcast.com/sbin/tunein-station.pls?id=558051");
            }
            if(
listitem == 11)// (12-Classic Alternative)
            
{
                   
Radio11[playerid] = PlayAudioStreamForPlayer(playerid"http://yp.shoutcast.com/sbin/tunein-station.pls?id=99169508");
            }
            if(
listitem == 12)// (13-Russian)
            
{
                   
Radio12[playerid] = PlayAudioStreamForPlayer(playerid"http://yp.shoutcast.com/sbin/tunein-station.pls?id=9495657");
            }
            if(
listitem == 13)// (14-Old School Rap)
            
{
                   
Radio13[playerid] = PlayAudioStreamForPlayer(playerid"http://yp.shoutcast.com/sbin/tunein-station.pls?id=210543");
            }
            if(
listitem == 14)// (14-Jungle)
            
{
                   
Radio14[playerid] = PlayAudioStreamForPlayer(playerid"http://yp.shoutcast.com/sbin/tunein-station.pls?id=1531712");
            }
            if(
listitem == 15)// (STOP RADIO)
            
{
                
StopAudioStreamForPlayer(playerid);
            }
        }
     }
    return 
1;

To use PlayAudioStreamForPlayer i go to shoutcast.com and search for a station I like. To listen to the station I go to HELP - settings on the shoutcast page and select "Play SHOUTcast stations in SHOUTcast web player". Then to download the link for the stations I go to HELP - settings on the shoutcast page and select "Play SHOUTcast stations in default media player". Then finally I look at my downloads and copy paste the station URL into the correct place in PlayAudioStreamForPlayer like this:
PHP код:
PlayAudioStreamForPlayer(playerid"http://yp.shoutcast.com/sbin/tunein-station.pls?id=49731"); 
You can use PlayAudioStreamForPlayer anywhere that has a playerid or similar (killerid, damagedid, etc.), this will play the stream for the player at the same volume no matter where he is.

Or you can set the x, y, z, positions and range of the audio stream.

More help?
https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer
Reply
#3

Okay i will try this out! +REP
Reply
#4

Okay so my only problem now is that i cant hear any music at all! :/.. Nothing its just Quiet when i start the code
Is there anything more i have to do?
Reply
#5

That happens if your in-game radio sound is low. Check it in your game settings.
Reply
#6

I have the sound on highest settings..... I can hear StreamAudio on other servers but not mine! :/
Reply
#7

bump
Reply
#8

Try playing single audio file.
Reply
#9

I solved it! For thoose who has the same problem as me Goin to your "Grand Theft Auto User files" Then folder "SAMP" and the open the file "sa-mp.cfg" and change audioproxyoff=0 TO audioproxyoff=1
..
Start your server and hear the music!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)