SA-MP Forums Archive
Radio doesn't player after dead - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Radio doesn't player after dead (/showthread.php?tid=448770)



Radio doesn't player after dead - Lorenzosdm - 05.07.2013

I got a radio dialog system but when I die the radio stream stop playing so i need restart the radio stream again with the dialog, my question is now how can i make it so the radio gonna stream all the time?

Already Thanks for help!



Re: Radio doesn't player after dead - ToiletDuck - 05.07.2013

Not Tested
pawn Код:
#define <ZCMD>

new audioplayed[MAX_PLAYERS];//Put this top of your script
new audiourl[MAX_PLAYERS][128];//Put this top of your script

new audioplayed[playerid] = 0;//Put this Under OnplayerConnect to avoid problem or bug
format(audiourl[playerid], 128, "");//Put this Under OnplayerConnect to avoid problem or bug


CMD:playaudio(playerid, params[]))
{
    if(!isnull(params))
    {
        new music[128];
        PlayAudioStreamForPlayer(playerid, params);
        format(audiourl[playerid], 128, params); //save the url
        audioplayed[playerid] = 1;
        SendClientMessage(playerid, -1, "Audio played");
    }
    else SendClientMessage(playerid, COLOR_WHITE, "USAGE: /playaudio [url]");
    return 1;
}
public OnPlayerUpdate(playerid)
{
    if(audioplayed[playerid] == 1)
    {
        PlayAudioStreamForPlayer(playerid, audiourl[playerid]); // play the url all the time
    }
    return 1;
}



Re: Radio doesn't player after dead - MP2 - 05.07.2013

IIRC audio streams don't suddenly stop on death/respawn. Perhaps you're stopping it.


Re: Radio doesn't player after dead - Lorenzosdm - 05.07.2013

Okay il will look again to it thanks for the help!