Jump to content
Sign in to follow this  
Rawshark

Looping sound in MP

Recommended Posts

So I can get ambient sound/music to loop in a single player setting using ehID = addMusicEventHandler ["MusicStop", {playMusic "music1";}];playMusic "music1"but I am not sure if this will work if I host a multiplayer game. Does anyone know if this is liable to break in MP or know of a sound looping script that will definitively work in MP? Finally, I would also like to end said loop once it got started via a radio command, I already know how to set the trigger up but I don't know what I have to put in the activation field to make it stop, I tried 

terminate my_music_handle; 
but that didn't work.

Thanks in advance for the help.


 

Share this post


Link to post
Share on other sites

Do all players need to hear the same sound/music at the same time?

 

To stop a music track just use playMusic " ";

Share this post


Link to post
Share on other sites

Well the way I envisioned it was that they would hear it via a radio command trigger (radio alpha) executed by me and then stopped using a similar but separate trigger (radiop Bravo). Would I need to add the playMusic "" in the activation line of Radio Bravo?

Share this post


Link to post
Share on other sites

Some code snippets from a previous project.

_soundSource = "Land_HelipadEmpty_F" createVehicle (position _npc);
[_soundSource, ["Alarm_BLUFOR", 125, 1]] remoteExec ["say3D", ([0, -2] select isDedicated), false];
deleteVehicle _soundSource;

What you can do is, setup a radio trigger or something similar that only YOU can execute. You create the sound source where you want and terminate the sound source using deleteVehicle when executed again. Don't attach the sound source to a player though, for obvious reasons. If you need the sound source to be on a player just simply create a dummy object and attach it to them.

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
Sign in to follow this  

×