Spooner,thank you for point out my wrongs.
I CTRL+C scripts & CTRL + V in TXT for edit,
but I copy a wrong one to the posts.
Unfortunately,I forgot check it before I send.
modify soon
ps. somethings if you dont use the variable of groups you dont have to add the leader I think.the high rank unit will be the leader.
usually I make lots group like this;
//first make a group name like GRPW1
grpw1=Creategroup west
"SquadLeaderw" createUnit [getMarkerPos"wr1",,"w1=this;",1,"sergant"];
"Soldierwat" createUnit [getMarkerPos"wr1",grpW1,"",1,"Corporal"]
"SoldierwMG" createUnit [getMarkerPos"wr1",grpW1,"",1,"Corporal"]
exit
//set the variable.
_a = w1;
_group = group _a;
when you need create group2 ,the leader named W2 just like
_a = w2;
_group = group _a;
If you want add a waypoint,
you can write,
_group addwaypoint[getmarkerpos"wp1",0]
[_group,1] setwaypointtype"Move";
the complete script;
//first make a group name like GRPW1
grpw1=Creategroup west
"SquadLeaderw" createUnit [getMarkerPos"wr1",,"w1=this;",1,"sergant"];
"Soldierwat" createUnit [getMarkerPos"wr1",grpW1,"",1,"Corporal"]
"SoldierwMG" createUnit [getMarkerPos"wr1",grpW1,"",1,"Corporal"]
//set the variable.
_a = w1;
_group = group _a;
//add waypoints
_group addwaypoint[getmarkerpos"wp1",0]
[_group,1] setwaypointtype"Move";
_group addwaypoint[getmarkerpos"wp21",0]
[_group,2] setwaypointtype"SAD";
exit
if you want create other groups,just change the name of teamleader and group name.also dont forget the variable name.