All players got units on their squad because you put "group player"
The Trigger sincronize the command to all players, so try with this script "on activation"
[thislist] exec "NewUnit.sqs"
You need to set the groups on the init of the leader, like
And, the server gamelogic placed on the mission.
Save this script on the main directory of your mission.
It should work, I haven't tested it =P.
_groupnew = 0
_posnew = 0
;Check if the player is in the trigger, and not a simple AI
? (player in thislist): goto "checkgroup"
;Check the group that is purchasing the new troop and if its the leader, and the number of units in the groups
? (leader group1 in thislist and count units group1 < 8): _groupnew = group1; _posnew = position leader group1; goto "create"
? (leader group2 in thislist and count units group2 < 8): _groupnew = group2; _posnew = position leader group2; goto "create"
server sidechat ">>> HQ: You have more than 8 units <<<"
;And keep adding more if you have more groups that can purchase units
;Create the unit
"SoldierWB" createUnit [_posnew,_groupnew]
Ah, and i forgot your second question, editing.