Hey there!
I currently have an array in my code, but I have absolutely no idea on how to interact with all of them at the same time. (I only know how to interact with specific ones)
That’s my current array:
@editable SongArray : []radio_device = array{}
How can I interact with all of them at the same time to stop the radio devices with .Stop()?
This allows you to pass any number of radio_devices to the StopRadioDevices method, where it then does the same as the first snippet, just in a more reusable format. And then you can pass in your SongArray like so:
StopRadioDevices(SongArray)
I haven’t tested this so it may need adjusting, and there could also be a global way to stop all devices that I’m unaware of, but that should do the trick. It could also get a bit hectic depending on how many radio_devices you’re using as it iterates through the array, so keep that in mind too.