Jump to content
dezkit

How to make sirens like in GTA 5?

Recommended Posts

In GTA 5 police/service vehicles you have 1 button that throws out multiple sounds.

 

If you hold down X, you get sound #1, once you let go of button X, the sound stops, otherwise it loops.

If you press once the same button down X, you get sound #2, which loops. However when you hold down X while sound #2 is looping, sound #2 stops, and plays sound #3. 

 

Maybe this can be done solely using CfgWeapons, where button X is left click?

 

Would this be possible to recreate in arma 3 using scripting? Can anybody point me in the right direction? Thanks

Share this post


Link to post
Share on other sites

Do you have a video that shows what you're describing?

 

Either way, there are multiple issues that will make doing this a headache

Share this post


Link to post
Share on other sites

You'll be better off looking how some mods create sirens in the first place. If you're looking into making it a certain control scheme than you'll have to follow directions on scripting custom key commands.

 

http://www.armaholic.com/page.php?id=23712

 

That mod has a simple system for sirens. Just a useraction for different sounds. I am asking for a script where 1 input gives different outputs depending on how and when you use it.

Share this post


Link to post
Share on other sites

You can use a trigger to trigger a siren.

Share this post


Link to post
Share on other sites

Why don't you really post a video so we can analyze this?

Share this post


Link to post
Share on other sites


[] spawn { (findDisplay 46) displayAddEventHandler ["KeyDown",{

if (_this == 21) then {

_timeCurrent = time;

while {_timeCurrent < 0.2} do {

_timeCurrent = _timeCurrent - time;

playSound ["siren",1];

};

};

https://community.bistudio.com/wiki/DIK_KeyCodes

https://community.bistudio.com/wiki/time

https://community.bistudio.com/wiki/say3D

https://community.bistudio.com/wiki/say2D

Share this post


Link to post
Share on other sites

Why don't you really post a video so we can analyze this?

I apologize. I can't find a video on youtube that shows it, but I will upload one later today to give an example.

 

 [] spawn { (findDisplay 46) displayAddEventHandler ["KeyDown",{
if (_this == 21) then {
   _timeCurrent = time; 
   while {_timeCurrent < 0.2} do {
   _timeCurrent = _timeCurrent - time;
   playSound ["siren",1];
      };
   
};
https://community.bistudio.com/wiki/DIK_KeyCodes
https://community.bistudio.com/wiki/time
https://community.bistudio.com/wiki/say3D
https://community.bistudio.com/wiki/say2D

Thank you. That honestly looks very clever, using time and such. I will try this out.

Share this post


Link to post
Share on other sites

You'll have to account for defensive programming to make it "do what you want" but you get the general idea.

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

×