Jump to content

Recommended Posts

So I've been thinking that it is more than likely possible I can create a script that will play a customized .ogg file through an object that will play the sound within a certain radius instead of to everyone playing on the server, before I attempt creating a script and failing miserably would I actually need to create a script or could I place the object like you do with a billboard and adding custom art to it? I'm pretty new to this so before I venture into making something from scratch I just want to know if something like that was possible without having to write a script for it.

 

Thanks.

Share this post


Link to post
Share on other sites

I've been using this to play broadcast messages throughout a military base,

simply place a few loudspeaker objects, name them and run this script:

 


GOM_fnc_baseLoudspeakers = {

	params ["_loudspeakers","_sounds"];

	GOM_fnc_basePlaySounds = true;

	while {GOM_fnc_basePlaySounds} do {

		sleep random [10,20,30];//min mid max values, adjust as needed

		{

			_sound = selectRandom _sounds;

			if (alive _x) then {

				[_x,_sound] remoteExec ["say3D",0];

			};

		} forEach _loudspeakers;

	};

};

//to call it:

_loudspeakers = [speaker1,speaker2,speaker3];
_sounds = ["c_in1_20_broadcast_SPE_0","c_in1_20_broadcast_SPE_1","c_in1_21_broadcast_SPE_0","c_in1_21_broadcast_SPE_1","c_in1_22_broadcast_SPE_0","c_in1_22_broadcast_SPE_1","c_in1_23_broadcast_SPE_0"];

_play = [_loudspeakers, _sounds] spawn GOM_fnc_baseLoudspeakers;

You can also define custom sounds in description.ext and use them.

Works for MP.

 

Cheers

  • Like 2

Share this post


Link to post
Share on other sites
5 minutes ago, Grumpy Old Man said:

I've been using this to play broadcast messages throughout a military base,

simply place a few loudspeaker objects, name them and run this script:

 



GOM_fnc_baseLoudspeakers = {

	params ["_loudspeakers","_sounds"];

	GOM_fnc_basePlaySounds = true;

	while {GOM_fnc_basePlaySounds} do {

		sleep random [10,20,30];//min mid max values, adjust as needed

		{

			_sound = selectRandom _sounds;

			if (alive _x) then {

				[_x,_sound] remoteExec ["say3D",0];

			};

		} forEach _loudspeakers;

	};

};

//to call it:

_loudspeakers = [speaker1,speaker2,speaker3];
_sounds = ["c_in1_20_broadcast_SPE_0","c_in1_20_broadcast_SPE_1","c_in1_21_broadcast_SPE_0","c_in1_21_broadcast_SPE_1","c_in1_22_broadcast_SPE_0","c_in1_22_broadcast_SPE_1","c_in1_23_broadcast_SPE_0"];

_play = [_loudspeakers, _sounds] spawn GOM_fnc_baseLoudspeakers;

You can also define custom sounds in description.ext and use them.

Works for MP.

 

Cheers

 

 

Why thank you, I managed to find a guide but it was for ARMA 2 so I figured the code was out of date, however I will fiddle with this. Thank you kindly.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×