SA-MP Forums Archive
PlayAudioStreamForPlayer 0.3x - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: PlayAudioStreamForPlayer 0.3x (/showthread.php?tid=422610)



PlayAudioStreamForPlayer 0.3x - Maartinshskd - 14.03.2013

Can someone help me with making a script for audio streaming? And what plugin do I need?
I want the audio to start on OnPlayerConnect and to end on OnPlayerSpawn
Have been looking for solutions on web for hours, so don't judge me...


Re: PlayAudioStreamForPlayer 0.3x - Scenario - 14.03.2013

https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer

https://sampwiki.blast.hk/wiki/StopAudioStreamForPlayer

It's simple, mate.

When using that function, though, make sure your GTA radio volume is turned up because otherwise it won't play anything for you!


Re: PlayAudioStreamForPlayer 0.3x - Maartinshskd - 14.03.2013

I tryed this one, but I got errors about undefined symbols cmdtext and PlayAudioStreamForPlayer


Re: PlayAudioStreamForPlayer 0.3x - Scenario - 14.03.2013

Post your code, then! This is a help forum after all...


Re: PlayAudioStreamForPlayer 0.3x - Maartinshskd - 14.03.2013

I just used the example from samp wiki
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/play radio", cmdtext, true) == 0) 
    {
        PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls");
        return 1;
    }
    if (strcmp("/radio in my pos", cmdtext, true) == 0)
    {
        new Float:X, Float:Y, Float:Z, Float:Distance = 5.0;
        GetPlayerPos(playerid, X, Y, Z);
	PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", X, Y, Z, Distance, 1);
	return 1;
    }
    return 0;
}



Re: PlayAudioStreamForPlayer 0.3x - IstuntmanI - 14.03.2013

Add
pawn Код:
#include <a_samp>
...

Look in other scripts.


Re: PlayAudioStreamForPlayer 0.3x - Scenario - 14.03.2013

Make sure you have this at the top of your script:

pawn Код:
#include <a_samp>
It should be at the very top, otherwise, put it there!


Re: PlayAudioStreamForPlayer 0.3x - Maartinshskd - 14.03.2013

It is there!


Re: PlayAudioStreamForPlayer 0.3x - Scenario - 14.03.2013

PM me your full code then, I'll take a look.


Re: PlayAudioStreamForPlayer 0.3x - ViruZz - 14.03.2013

pawn Код:
public OnPlayerConnect(playerid) {
    PlayAudioStreamForPlayer(playerid, "your url here");
    return 1;
}

public OnPlayerSpawn(playerid) {
    StopAudioStreamForPlayer(playerid);
    return 1;
}
was that so hard lol?