Hi m8. Not sure who posted this little number in the Script Snippets pages - but it sounds like what yr after...I quote:
"Basically it allows a player to continually add extra guys under his/her command at the respawn point.
It only allows up to a maximum # that the creator specifies. Take a look:
First I added players that are in a group in and of themselves. Then I add the appropriate respawn point (Respawn_west for this example - I am using respawn at marker option). Then I add a game logic unit (we'll call this Create1) with the init field: this exec "addactions.sqs"
Now the Addactions script is:
_this addaction ["Create Soldier","1.sqs"]
_this addaction ["Create Medic","2.sqs"]
_this addaction ["Create Grenadier","3.sqs"]
_this addaction ["Create AA Soldier","4.sqs"]
_this addaction ["Create LAW Soldier","5.sqs"]
_this addaction ["Create AT Soldier","6.sqs"]
_this addaction ["Create Mortar Soldier","7.sqs"]
_this addaction ["Create MG Soldier","8.sqs"]
_this addaction ["Create Sniper","9.sqs"]
_this addaction ["Create G36a Soldier","10.sqs"]
_this addaction ["Create Steyr Soldier","11.sqs"]
_this addaction ["Create XMS Soldier","12.sqs"]
_this addaction ["Create Engineer","13.sqs"]
_this addaction ["Create BlackOp","14.sqs"]
_this addaction ["Create BlackOp (Day)","15.sqs"]
_this addaction ["Create BlackOp (Laser)","16.sqs"]
_this addaction ["Create BlackOp (XMS)","17.sqs"]
_this addaction ["Create Heavy Grenadier","18.sqs"]
exit
(now you can add whatever you wish and call the scripts whatever you like, but this is only for example)
Notice it adds actions to the game logic unit(anyone can use a different object if they like - truck for instance) that when a player gets close to it, the actions will appear in their menu somewhat like an ammo crate does.
now in each numbered script that the action calls contains the following:
_currentunits=count units group player ? _currentunits==1:_rank="LIEUTENANT" ? _currentunits==2:_rank="CORPORAL" ? _currentunits==3:_rank="PRIVATE" ? _currentunits>=4:goto "toomany" "SoldierWB" createunit [getpos create1,group player,"",1,_rank] exit
#toomany titletext["You already have max units.","plain"] exit
now everytime the player hits the action - it counts the number of guys he has (in this case max of 4 including himself) and adds the soldier to his group if he has room. "SoldierWB" can be of any type, and skill (in this case "1" or max skill) can be of any level.
I have tested this in MP and it creates units similar to "grabbing ammo" with a maximum of 3 additional units in this case. Now the game logic unit in my map is right by the respawn point, but it can be anywhere you would like to place it. Also, the players have a higher rank than Lt. It makes it interesting, in that when I die.. I respawn and they still are under my command, but if they die they do not respawn and I can call up a new soldier of any of the types listed.