ALPHIVE 14 Posted May 29, 2019 Hi everybody, I tried everyything but no one worked :'( ... I want, when i push "Activate alarm" on my computer, that everybody in my base heard the alarm I use actually this command alarmFB2 say3D ["Sirenair", 1500, 1]; in alarm1.sqf, and in my mission i call this script through this addAction["Activate Alarm", "scripts\alarm1.sqf"]; (that i placed on INIT in a computer) But when my server is up, im the only one who heard it ... So my question is : is there a way for players on my server heard my say3D when i activate through call to action ? Is there a command i miss ? Thank you for you help guys Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted May 29, 2019 Hello there ALPHIVE ! Try this : [alarmFB2,["Sirenair", 1500, 1]] remoteExec ["say3d",0,true]; Share this post Link to post Share on other sites
ALPHIVE 14 Posted May 29, 2019 Hi George, do i place this in my SQF file "alarm1.sqf" ? Or just after addaction ? Share this post Link to post Share on other sites
ZaellixA 383 Posted May 29, 2019 What George sent you should replace your lines so change alarmFB2 say3D ["Sirenair", 1500, 1]; with [alarmFB2,["Sirenair", 1500, 1]] remoteExec ["say3d",0,true]; that George sent you. 1 Share this post Link to post Share on other sites
NeoArmageddon 958 Posted May 29, 2019 It works also inline with addaction if you want to keep that stuff short but harder to read: this addAction["Activate Alarm", {([alarmFB2,["Sirenair", 1500, 1]] remoteExec ["say3d",0,true];}]; 2 Share this post Link to post Share on other sites
ALPHIVE 14 Posted May 29, 2019 I will try that thank you for your help guys ! 2 Share this post Link to post Share on other sites
ALPHIVE 14 Posted May 30, 2019 13 hours ago, NeoArmageddon said: It works also inline with addaction if you want to keep that stuff short but harder to read: this addAction["Activate Alarm", {([alarmFB2,["Sirenair", 1500, 1]] remoteExec ["say3d",0,true];}]; Neo i got an error when i place this on INIT box of my computer : And, based on this command, if i want activate the song on severals objects in same time, how can i do ? (for exemple i want activate alarm on "AlarmFB2", "AlarmFB3" and "AlarmFB4" objects) Share this post Link to post Share on other sites
ZaellixA 383 Posted May 30, 2019 Well, the error you get is because you have an opening parenthesis (or brackets, depends on where you live :P) but you never close it. I believe it is not needed and NeoArmaggedon placed it accidentally (or coded it differently before he sent you this version and forgot to delete it). Regarding your question about simultaneous activation the easiest and most straight forward way to do it is to call remoteExec as many times as you want with different arguments. Meaning, in every call you give the appropriate siren you want to "activate" (where you have AlarmFB1 you place AlarmFB2, and in the next AlarmFB3 and so on and so forth...). I am not sure if you can give multiple sirens to say3D and I can't look it up right now. I will have a look later on and let you know. So to sum up: Instead of just one remoteExec you place as many as you want (I am sure there is a better way than that, but I don't have enough time at the moment to find a neat and easy way). So, an example would be: this addAction["Activate Alarm", {[alarmFB2, ["Sirenair", 1500, 1]] remoteExec ["say3d", 0, true]; [alarmFB3, ["Sirenair", 1500, 1]] remoteExec ["say3d", 0, true]; [alarmFB4, ["Sirenair", 1500, 1]] remoteExec ["say3d", 0, true];}]; This will "activate" three alarms named alarmFB2, alarmFB3 and alarmFB4. Hope this helps, at least for the moment and to give you an idea of how you could just hardcode all the sirens you want to activate. I will do my best to find a neater solution as soon as possible to provide. Please don't hesitate to ask again if something goes wrong or you need clarifications. 1 Share this post Link to post Share on other sites
ALPHIVE 14 Posted May 30, 2019 Really, thank you for your precious help 😄 (i placed the missing parenthesis) The command worked perfectly and players on my servers listened the alarm 🙂 i will try your synchro say3D script ! 😄 Beside this, im really happy to see someone that takes time to explain clearly like that 2 Share this post Link to post Share on other sites
NeoArmageddon 958 Posted May 30, 2019 2 hours ago, ZaellixA said: Well, the error you get is because you have an opening parenthesis (or brackets, depends on where you live :P) but you never close it. I believe it is not needed and NeoArmaggedon placed it accidentally (or coded it differently before he sent you this version and forgot to delete it). I just copy and pasted the lines from the first post together on my mobile 😛 1 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted May 30, 2019 18 minutes ago, ALPHIVE said: Beside this, im really happy to see someone that takes time to explain clearly like that Bi Forum so far , is an active community , with a lot of helpful members ! 1 Share this post Link to post Share on other sites
NeoArmageddon 958 Posted May 30, 2019 To reduce redundancy you can use a foreach and an array of objects this addAction["Activate Alarm", {{[_x, ["Sirenair", 1500, 1]] remoteExec ["say3d", 0, true];} foreach [alarmFB2,alarmFB3,alarmFB4];}]; Also not tested. Any error is an exercise in SQF debugging for you 😛 3 Share this post Link to post Share on other sites
ZaellixA 383 Posted May 30, 2019 3 minutes ago, NeoArmageddon said: To reduce redundancy you can use a foreach and an array of objects this addAction["Activate Alarm", {{[_x, ["Sirenair", 1500, 1]] remoteExec ["say3d", 0, true];} foreach [alarmFB2,alarmFB3,alarmFB4];}]; Also not tested. Any error is an exercise in SQF debugging for you 😛 I guess this is as clear as it can get without placing the commands in a different .sqf. Thanks NeoArmaggeddon 1 Share this post Link to post Share on other sites
ALPHIVE 14 Posted May 31, 2019 Everything work perfectly, thank you all of you guys ! 2 Share this post Link to post Share on other sites
haleks 8212 Posted May 31, 2019 One last thing : addAction is local, just like say3D. If you want the action itself to show up on all clients : [this, ["Activate Alarm", {{[_x, ["Sirenair", 1500, 1]] remoteExec ["say3d", 0]} foreach [alarmFB2,alarmFB3,alarmFB4]}]] remoteExec ["addAction", 0, true]; 3 Share this post Link to post Share on other sites
ZaellixA 383 Posted May 31, 2019 3 hours ago, haleks said: One last thing : addAction is local, just like say3D. If you want the action itself to show up on all clients : [this, ["Activate Alarm", {{[_x, ["Sirenair", 1500, 1]] remoteExec ["say3d", 0]} foreach [alarmFB2,alarmFB3,alarmFB4]}]] remoteExec ["addAction", 0, true]; Yep, that's about right, good point haleks. It may seem a bit complicated but don't worry, a lot of "one-liners" may be. You can divide it in parts if it gets you confused. Once more, if you find yourself in a deadlock don't hesitate to ask. 1 Share this post Link to post Share on other sites