This source codeis a lot more efficient because it directly accesses only units and all other ways include useless objects, buildings, and other stuff that then needs to be filtered out.
Game Hacks and Cheats
[Source - ARMA 3] Another AllUnits in C++ (Not a executable hack, developers source)
Submitted by Riot, 07-04-2018, 06:19 AM, Thread ID: 83452
Thread Closed