Search the Community
Showing results for tags 'looping'.
Found 2 results
-
[SOLVED] Looping switch-do, skip a case if true during earlier loop
Asmodeuz posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello, the short script I've typed below is checking whether a player is inside a marker's area (or not). When the player is (inside the marker's area) an action "Test action" will be added to the player's action menu. Now, since the script is being looped a new action menu entry gets added to the action menu every 5 seconds. Thus far haven't been able to come up with anything meaningfull so: is there a way to stop new action menu entry being added if one has already been added during the earlier loop? [] spawn {while {alive player} do {switch (true) do { case (player inArea "marker1"): {testActionID = player addAction ["Test action",{}];}; case !(player inArea "marker1"): {player removeAction testActionID}; }; sleep 5; }; }; -
So I can get ambient sound/music to loop in a single player setting using ehID = addMusicEventHandler ["MusicStop", {playMusic "music1";}];playMusic "music1"; but I am not sure if this will work if I host a multiplayer game. Does anyone know if this is liable to break in MP or know of a sound looping script that will definitively work in MP? Finally, I would also like to end said loop once it got started via a radio command, I already know how to set the trigger up but I don't know what I have to put in the activation field to make it stop, I tried terminate my_music_handle; but that didn't work. Thanks in advance for the help.