There are many ways of changing the loadout for units in the game via scripting.
Here’s the code to load your unit out with an M4A3 CCO with 6 magazines, a G17 pistol and 4 magazines, 4 hand grenades, a red and a green smoke grenade, binoculars, night vision goggles and GPS.
removeAllWeapons this; {this addMagazine "30Rnd_556x45_Stanag"} forEach [1,2,3,4,5,6]; this addWeapon "M4A3_CCO_EP1"; {this addMagazine "17Rnd_9x19_glock17"} forEach [1,2,3,4]; this addWeapon "glock17_EP1"; {this addMagazine "HandGrenade_West"} forEach [1,2,3,4]; this addMagazine "SmokeShellGreen"; this addMagazine "SmokeShellRed"; this addWeapon "Binocular"; this addWeapon "NVGoggles"; this addWeapon "ItemGPS";
It’s important to removeAllWeapons first so that you start with no weapons. Also remember to addWeapon after using addMagazine so that the weapons will be loaded at start.
Here are a few more methods from shk:
Manual Count Array method:
{this addmagazine "smokeshell"} foreach [1,2,3,4,5,6,7,8,9,10,11,12];
For Loop method:
for "_i" from 1 to 12 do {this addmagazine "smokeshell"};
Array of units method:
pilot_array = [pilot_01, pilot_02, pilot_03, pilot_04, pilot_05, pilot_06, pilot_07, pilot_08, pilot_09, pilot_10, pilot_11, pilot_12, pilot_13]; { _o = _x; removeAllWeapons _o; for "_i" from 1 to 4 do {_o addmagazine "15Rnd_9x19_M9"}; {_o addweapon _x} foreach ["M9","Binocular","NVgoggles"]; for "_i" from 1 to 3 do {_o addmagazine "smokeshell"}; } foreach pilot_array;