I added that and increased the sleep to 4, but unfortunately it didn't work.
And I found out that it isn't the range that prevents the ai from firing. I placed another ambient unit that is supposed to shoot a pistol at a target 25m away and he doesn't do that either.
(this is the code I used:)
Copyright (c) 2006 - 2020 Armaholic.com All Rights Reserved.
Armed Assault, ArmA: Combat Operations, ArmA: Queen's Gambit, Arma 2, Arma 2: Operation Arrowhead, Arma 2: Combined Operations, Arma 2: British Armed Forces, Arma 2: Private Military Company, Arma 2: Army of the Czech Republic, Arma 2: Reinforcements, Arma 2: Firing Range and Arma 3 are trademarks or registered trademarks of Bohemia Interactive a.s.