Jump to content
Sign in to follow this  
djukel

How count vehicles in a group?

Recommended Posts

Hi!

A group consist only soldiers from "man" unittype, and sometimes soldiers occupy various empty vehicles. Question: How can I count the vehicles in a group? Is there a script somewhere do the similar thing?

Share this post


Link to post
Share on other sites

You have to ckeck in an ordner if anyone is in a vehicle, then compare the vehicles if there are duplicates to get the right vehicle count.

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_vehicleList = []

{if ( (vehicle _x != _x) and (not ((vehicle _x) in _vehicleList)) ) then {_vehicleList = _vehicleList + [vehicle _x]}} forEach units _group

_vehicleCount = count _vehicleList

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×