Assassin,
If you want to add men to your own group it should be:
_ambpos = getpos player
_ax = _ambpos select 0
_ay = _ambpos select 1
_az = _ambpos select 2
"soldierWB" createunit [ [_ax + (random 10),_ay + (random 10),_az],group player,"",0.5,"sergeant"]
"soldierWB" createunit [ [_ax + (random 10),_ay - (random 10),_az],group player,"",0.5,"corporal"]
"soldierWB" createunit [ [_ax - (random 10),_ay + (random 10),_az],group player,"",0.5,"private"]
"soldierWB" createunit [ [_ax - (random 10),_ay - (random 10),_az],group player,"",0.5,"private"]
If you added an AI unit in the editor and named him Man1, you could assign the new guys to him with:
_ambpos = getpos Man1
_ax = _ambpos select 0
_ay = _ambpos select 1
_az = _ambpos select 2
"soldierWB" createunit [ [_ax + (random 10),_ay + (random 10),_az],group Man1,"",0.5,"sergeant"]
"soldierWB" createunit [ [_ax + (random 10),_ay - (random 10),_az],group Man1,"",0.5,"corporal"]
"soldierWB" createunit [ [_ax - (random 10),_ay + (random 10),_az],group Man1,"",0.5,"private"]
"soldierWB" createunit [ [_ax - (random 10),_ay - (random 10),_az],group Man1,"",0.5,"private"]
If you want to add a completle new group you have to be a bit tricky, off the top of my head it's something like:
Create an ai soldier and add this to his init field:
MyGroup1=Group This ; DeleteVehicle This
This creates a copy of his group, so when he gets deleted at the start of the game. He leaves a copy of his group in the variable MyGroup1.
Just assign your guys to this group:
_ambpos = getmarkerpos "ambush_mkr"
_ax = _ambpos select 0
_ay = _ambpos select 1
_az = _ambpos select 2
"soldierWB" createunit [ [_ax + (random 10),_ay + (random 10),_az],MyGroup1,"",0.5,"sergeant"]
"soldierWB" createunit [ [_ax + (random 10),_ay - (random 10),_az],MyGroup1,"",0.5,"corporal"]
"soldierWB" createunit [ [_ax - (random 10),_ay + (random 10),_az],MyGroup1,"",0.5,"private"]
"soldierWB" createunit [ [_ax - (random 10),_ay - (random 10),_az],MyGroup1,"",0.5,"private"]
You can create upto 64 groups this way, including civilian and Res.