Depends on how you want to do it.
Here's some suggestions:
First place a copter and give it waypoints. Then I'll explain what to do along the way.
1)
In the copters properties, take away all it's fuel.
If the chopper starts from the ground then add a trigger which is activated by anyone and then put this in the condition field:
this && ({_x in copter} count units grp) >= (count units grp) && ({_x in copter} count units grp2) >= (count units grp2)
copter is the name of the copter.
grp and grp2 are the groups names that should enter the copter. You can change the names of them if you wish.
Then in the on activation of the trigger put:
copter setfuel 1
This will make the copter lift off.
2)
If the copter is in the air, then you could do this.
Give the chopper a waypoint to the location you want it to pick up the squad. Then lock the copters waypoint and also execute the following script:
[] exec "wait.sqs"
And the script should look something like this:
copter flyinheight 1
@({_x in copter} count units grp) >= (count units grp) && ({_x in copter} count units grp2) >= (count units grp2)
copter lockWP FALSE
copter flyinheight 35
exit
You can also do that with triggers, but I just wanted to do this one fast. ;D
Once the script is done, the copter will move on to the next waypoint. Assuming you have made one for it.
Never tried this myself, but in theory this should work. ;D If you're having probs then don't hesitate to ask.
Hawkins