dezkit 28 Posted March 3, 2016 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
dreadedentity 278 Posted March 3, 2016 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
driftingnitro 38 Posted March 3, 2016 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 Share this post Link to post Share on other sites
dezkit 28 Posted March 3, 2016 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
Joe98 92 Posted March 3, 2016 You can use a trigger to trigger a siren. Share this post Link to post Share on other sites
Yuval 29 Posted March 4, 2016 displayAddEventHandler seems to be what you want. I'm no genuis at this but I think music is layered like cutRsc and cutText. If it's not, and you can't stop a sound either any way you're in deep trouble to make it work. https://community.bistudio.com/wiki/displayAddEventHandler Share this post Link to post Share on other sites
inlesco 233 Posted March 4, 2016 Why don't you really post a video so we can analyze this? Share this post Link to post Share on other sites
MarkCode82 21 Posted March 4, 2016 [] 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
dezkit 28 Posted March 4, 2016 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
MarkCode82 21 Posted March 4, 2016 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