Search the Community
Showing results for tags 'radios'.
Found 1 result
-
Help with script syntax / Radio transmision for all radios
cc_kronus posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, With my very limited knowledge of programming (I am a copy-paster) I am trying to simulate a random radio broadcast to some radios placed in the scenario, but all radios must emit the same track. This is the code I am using in radios.sqf. The sountracks have already been defined in description.ext , and individually played, on a single radio as in - this say3d [ "voicetrack1" , 15,1] - they run OK. Now, I want all the radios. to play at the same time the same random track selected by the random function. _antena is an antena placed in the scenario. If destroyed, the transmissions end. _radios is the array of the devices I want to play the sound files, (the vanilla small black transistors) if !(isServer) exitWith {}; _antena = _this select 0; _radios = ["radio_1","radio_2","radio_3","radio_4","radio_5"]; _random = 3; while {alive _antena} do { _randomResult = floor(random _random); sleep 15; switch (_randomResult) do { case 0: {_radios say3D ["voicetrack1",15,1]; sleep 182;}; case 1: {_radios say3D ["voicetrack2",15,1]; sleep 197;}; case 2: {_radios say3D ["voicetrack3",15,1];sleep 171;}; }; }; The problem is that an error pops up and keeps telling me that it has found 5 elements (presumibly the radios) when only 2 where expected. I am totally lost and I have no idea on how to solve this issue. I would appreciate some help.