Radio doesn't player after dead
#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


Messages In This Thread
Radio doesn't player after dead - by Lorenzosdm - 05.07.2013, 18:18
Re: Radio doesn't player after dead - by ToiletDuck - 05.07.2013, 18:42
Re: Radio doesn't player after dead - by MP2 - 05.07.2013, 18:46
Re: Radio doesn't player after dead - by Lorenzosdm - 05.07.2013, 21:05

Forum Jump:


Users browsing this thread: 1 Guest(s)