Audio plugin for all
#1

Hi, I have a request it is a sound plugin I would like to make it so that you type cmd / playstreamed and everyone will hear the music not just me


Код:
dcmd_playstreamed (playerid, params[])
{
	#pragma unused playerid
	new
		bool:downmix,
		bool:loop,
		bool:pause,
		url[256];
	if (sscanf(params, "sddd", url, pause, loop, downmix))
	{
		SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /playstreamed <url> <pause (0/1)> <loop (0/1)> <downmix (0/1)>");
		return 1;
	}
	Audio_PlayStreamed(playerid, url, pause, loop, downmix);
	return 1;
}
sorry my English :<
Reply
#2

Quote:

Audio_PlayStreamed(playerid, url, pause, loop, downmix);

Change for:

pawn Код:
for(new i = 0; i < 500; i++)
{
    if(!IsPlayerConnected(i) || IsPlayerNPC(i)) continue;
    Audio_PlayStreamed(i, url, pause, loop, downmix);
}
That should work
Reply
#3

Thanks, and you could do the same with this cmd?
I tried the same thing as the playstreamed but it does not work

Код:
dcmd_set3dposition(playerid, params[])
{
	#pragma unused playerid
	new
		handleid,
		Float:distance,
		Float:x,
		Float:y,
		Float:z;
	if (sscanf(params, "dffff", handleid, x, y, z, distance))
	{
		SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /set3dposition <handleid> <x> <y> <z> <distance>");
		return 1;
	}
	new
		string[128];
	format(string, sizeof(string), "Audio 3D position set to %.01f, %.01f, %.01f (distance: %.01f) for handle ID %d", x, y, z, distance, handleid);
	SendClientMessage(playerid, COLOR_YELLOW, string);
    Audio_Set3DPosition(playerid, handleid, x, y, z, distance);
	return 1;
}
Reply
#4

Quote:

SendClientMessage(playerid, COLOR_YELLOW, string);
Audio_Set3DPosition(playerid, handleid, x, y, z, distance);

Try changing it to

pawn Код:
for(new i = 0; i < 500; i++){
    SendClientMessage(i, COLOR_YELLOW, string);
    Audio_Set3DPosition(i, handleid, x, y, z, distance);
}
That's what you wanted, right? Set 3D position for everyone.
Also, if you get an error ("unknown playerid" or something else), try removing "#pragma unused playerid".
You're now actually removing the 'playerid' from the function (a kind of).
Quote:

if (sscanf(params, "dffff", handleid, x, y, z, distance))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /set3dposition <handleid> <x> <y> <z> <distance>");
return 1;
}

And there you're using playerid. So you're calling something unknown, probably. Just try to remove that #pragma line
Reply
#5

Okay so everything works great. but I have another question. I do relog when a player is already there is no music, gave the advice may be to the music after leaving andentering the the server was still ?
Reply
#6

Try stopping/playing stuff when the player (dis)-connects
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)