14th Hoot 0 Posted November 8, 2001 Ok, let's say I have a group of civilians named zulu. How do I use a script to add weapons to all without using each individual units name (man1 addweapon, man2 addweapon, blah blah). I tried using the foreach command, but it gives an error due to the "" around the weapon name. Also tried using zulu addweapon, doesn't like that either, type group expected object. Anyone? Hoot out! Share this post Link to post Share on other sites
Shirson 0 Posted November 8, 2001 Try this [CivGroupName] exec "armingciv.sqs" ;-------------- _civGroup = _ this select 0 _allUnits = units group _civGroup _count = 0 #loop ?( _count > (count _allUnits)-1): exit _civ = _allunits select _count _civ addweapon "HK" _civ addmagazine "HK" _count=_count+1 Goto "loop" ;-------------- Share this post Link to post Share on other sites
Shirson 0 Posted November 8, 2001 Hmm... i think i know better method [CivGroupName] exec "armingciv.sqs" ;-------------- _civGroup = _ this select 0 "_x addweapon ""HK"" ForEach (units group _civGroup) "_x addmagazine ""HK"" ForEach (units group _civGroup) ;-------------- Share this post Link to post Share on other sites
14th Hoot 0 Posted November 9, 2001 Got this help from another site, it works: WeaponType = "M16"; "_x AddWeapon WeaponType" ForEach (Units Group this) in one of the group member's init fields. Will also try your suggestions. Thanks Hoot out! Share this post Link to post Share on other sites