Radio doesn't player after dead
#1

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!
Reply
#2

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;
}
Reply
#3

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)