JBOY_soundLoop is a simple function that will have an object say a sound repeatedly. This is useful for any object that you want to play a sound continously (say a radio playing a song loop, or a generator playing a generator noise, of flys buzzing around an outhouse, etc.).
Here's a sample call:
dmy=[toilet, "fxFlies4secs", 3.95 , 10000] execvm "JBOY_soundLoop.sqf";
Parameter 1: Object that will "say" the sound.
Parameter 2: Name of sound in quotes from your description.ext.
Parameter 3: Length of sound in seconds.
Parameter 4: # of times to execute the loop. For infinite, pass in -1.
Pretty simple, but useful to me, so maybe useful to someone else...
Sorry, Schuler--I know this is bad for my reputation--but this script does not blow anything up!
Script Updated per Wolfrug's suggestions:- Modified so that -1 in Parameter 4 will cause the loop to run infinitely (if object is alive).
- Modified loop to only Say the sound if player is within 250 meters to save on resources.
Attached file has been updated.
OFPEC Download