Jump to content
Sign in to follow this  
MrEddyG

Sound Issue

Recommended Posts

I have a mission that creates side missions. When the side mission starts, I want it to play a sound file. I have created the sound file, put it in a folder called sound. I created a description.ext file with the following entry.

 

class CfgSounds {
sounds[] = {};
class dis {
    name = "dis";
    sound[] = {"sound\dis.ogg", 1, 1};
    titles[] = {};
};
};
 
The file is in the folder named sound. 
The first line of the side mission sqf file calls for the sound playsound "dis";
 
if (isServer) then 
{
playsound "dis";
 
When in editor, I start the mission in multiplayer, the first mission starts up and the sound plays. Once I PBO the mission and load it up to the dedicated server, the sound no longer plays. Any Idea?
 

Share this post


Link to post
Share on other sites

You cant execute playsound server side and expecting to hear it as client in MP

Playsound are local command which minds its audible only where executed.

In editor preview you are the server thats why you can hear the sound.

 

use playSound3D or remoteexec playsound from server to clients

Share this post


Link to post
Share on other sites

Sorry I am new to this. Should it be playsound3d "dis" and it will work?

Or should it be this

Playsound3d ["sound\dis.ogg", player]

Share this post


Link to post
Share on other sites

Once I PBO the mission and load it up to the dedicated server, the sound no longer plays. Any Idea?

As davidoss already mentioned, try remoteExec, like dis:

if (isServer) then {"dis" remoteExec ["playSound"]};

Nikander

Share this post


Link to post
Share on other sites

Thank you for the help. I will put this code in.

Share this post


Link to post
Share on other sites

Thank you to all that help. Sorry for probably asking very noobish questions.

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  

×