?!(local server): exit
?(wtankcnt1 < 4): goto "makeM1A1"

#makeM1A1
~30
_wtnk1unitcnt = count units groupwsttnk1
?(_wtnk1unitcnt >=12): exit
_wtank = "M1Abrams" createVehicle getmarkerpos "wtnkpool"

"SoldierWB" createUnit [getMarkerPos "wtnkpool", groupwsttnk1, "TMP1=this"]
"SoldierWB" createUnit [getMarkerPos "wtnkpool", groupwsttnk1, "TMP2=this"]
"SoldierWB" createUnit [getMarkerPos "wtnkpool", groupwsttnk1, "TMP3=this"]

_crew1 = TMP1
_crew2 = TMP2
_crew3 = TMP3

_crew1 assignasdriver _wtank
_crew2 assignasgunner _wtank
_crew3 assignascommander _wtank
_crew1 moveindriver _wtank
_crew2 moveingunner _wtank
_crew3 moveincommander _wtank

TMP1 = nil
TMP2 = nil
TMP3 = nil

wtankcnt1 = wtankcnt1 + 1

#loop
~0.001
?!(alive _wtank): goto "quit"
goto "loop"


#quit
wtankcnt1 = wtankcnt1 - 1
[leader groupwsttnk1,getpos leader groupwsttnk1 select 0,getpos leader groupwsttnk1 select 1] exec "scripts\position.sqs"
~10
deletevehicle _wtank
deletevehicle _crew1
deletevehicle _crew2
deletevehicle _crew3
exit