sariel 11 Posted September 26, 2016 Hi there, does anybody know how to check if a unit exists? i have set a group of 5 units. i named them unit1, unit2, unit3, ... i have done this to play the mission with 5 people or less. when there are less than 5 players ai will be disabled. in a helicopter extraction i have set the condition for a waypoint to: ((!alive unit1) OR (unit1 in heli)) AND ((!alive unit2) OR (unit2 in heli)) AND ((!alive unit3) OR (unit3 in heli)) but this will only work if all units exist. so i need a way to check if the unit is present. thanks for your help. sariel Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted September 26, 2016 !(_unit isEqualTo objNull) Wiki. For multiple units do this: {!(_x isEqualTo objNull)} count allPlayers will return the amount of all players in the mission. Cheers 2 1 Share this post Link to post Share on other sites
sariel 11 Posted September 26, 2016 thanks @Grumpy Old Man looks great! :) can you tell me how to count all players in the heli too? and: does !(_unit isEqualTo objNull) work with _unit1, _unit2, ... or did i miss something there? Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted September 26, 2016 If you named your units unit1, unit2 etc then use that instead _unit. To get the number of players inside a chopper do this: {isPlayer _x} count crew MyChopperName; Will return 0 if no player is in the chopper. Cheers 1 Share this post Link to post Share on other sites
Tajin 348 Posted September 26, 2016 "count" is probably one of the most useful and at the same time most underestimated commands out there. :D 1 Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted September 26, 2016 "count" is probably one of the most useful and at the same time most underestimated commands out there. :D Probably one of my most favorite commands, next to the new alternative syntax of select. Then there's apply and of course not to forget the glorious params. Quite a treat these new commands. Cheers 1 Share this post Link to post Share on other sites