SA-MP Forums Archive
audio problem - 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: audio problem (/showthread.php?tid=596425)



audio problem - GeneralAref - 17.12.2015

i found Previous issue.
but now i need play Different audio for killer.


Re: audio problem - SickAttack - 17.12.2015

pawn Код:
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=69351");
Change "playerid" for "killerid".


Re: audio problem - GeneralAref - 17.12.2015

no no random audio for killer.


Re: audio problem - SickAttack - 17.12.2015

pawn Код:
// ** INCLUDES

#include <a_samp>

// ** ARRAYS AND ENUMERATORS

enum eRandomStreams
{
    random_stream_url[128],
};

static const aRandomStreams[][eRandomStreams] =
{
    {"example.com/audio.mp3"},
    {"example.com/audio.mp3"},
    {"example.com/audio.mp3"}
};

// ** MAIN

main()
{
    print("Loaded \"random_streams.amx\".");
}

// ** CALLBACKS

public OnGameModeInit()
{
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    PlayAudioStreamForPlayer(playerid, aRandomStreams[random(sizeof(aRandomStreams))][random_stream_url]);
    return 1;
}



Re: audio problem - GeneralAref - 17.12.2015

how about this?
Код:
public OnPlayerDeath(playerid,killerid,reason)
{
	new url[120];
	switch(random(5))
	{
	    case 0: url="...";
	    case 1: url="...";
	    case 2: url="...";
	    case 3: url="...";
	    case 4: url="..."; //your URLs in these fields. Add more or less depends of number of your sounds.
	}
	PlayAudioStreamForPlayer(playerid,url,0.0,0.0,0.0,0.0,0);
	return 1;
}



Re: audio problem - SickAttack - 17.12.2015

Quote:
Originally Posted by GeneralAref
Посмотреть сообщение
how about this?
Код:
public OnPlayerDeath(playerid,killerid,reason)
{
	new url[120];
	switch(random(5))
	{
	    case 0: url="...";
	    case 1: url="...";
	    case 2: url="...";
	    case 3: url="...";
	    case 4: url="..."; //your URLs in these fields. Add more or less depends of number of your sounds.
	}
	PlayAudioStreamForPlayer(playerid,url,0.0,0.0,0.0,0.0,0);
	return 1;
}
I'd go with the example I posted, but it's your choice. That would work too.