Jump to content
DanilKan

How to attach a sound to vehicle

Recommended Posts

Would like to know how to make a script making this possible:
Once I'm inside a vehicle I have an action choosing of which starts playing a custom sound so players outside and inside the vehicle could hear it . Also need an action that stops playing this sound

Basically, I need to make the same thing like this guy did with siren but with different vehicle and sound:

I tried to download his mod to try to look at the script but the link is expired

Share this post


Link to post
Share on other sites
1 hour ago, sarogahtyp said:

I typed this into 'init' of a vehicle in editor:

c1 addAction [ "Turn music on" , { 
c1 say3D [ "3Dsound", 50, 1];  
} ];

I hear the played sound but I need it to be activated only by a gunner or a driver of the vehicle. With the script I currently have, it is possible to activate it from the outside 10+ meters away which I don't need. Also cannot figure now how to addAction to stop the sound.

Share this post


Link to post
Share on other sites

Look at Example 5 in the addAction wiki link provided by @sarogahtyp above.  In it you will see all the parameters for addAction.   Adapt your addAction call to match that example (with your code being executed) and change the condition to check if player is driver or gunner of vehicle.  I could do it for you, but sometimes its better to learn how to fish than to be given a fish.

 

Hint:  For the condition you will need the following commands:  gunner, driver, isEqualTo

  • Like 3

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

×