Code:
// 0 = [this, "M16A2GL"] call compile preprocessFile "scripts\assigngear.sqf";
_unit = _this select 0;
_strLoadout = _this select 1;
if (!isServer) exitWith {};
removeAllWeapons _unit;
switch (_strLoadout) do
{
case "M249":
{
{_unit addMagazine "200Rnd_556x45_M249";} forEach [1,2,3,4];
_unit addWeapon "M249_EP1";
{_unit addMagazine "HandGrenade_West";} forEach [1,2];
_unit addMagazine "SmokeShell";
_unit addMagazine "SmokeShellGreen";
};
case "M16A2GL":
{
{_unit addMagazine "30Rnd_556x45_Stanag";} forEach [1,2,3,4,5,6,7,8];
{_unit addMagazine "1Rnd_HE_M203";} forEach [1,2,3,4,5];
{_unit addMagazine "FlareWhite_M203";} forEach [1,2,3];
_unit addWeapon "M16A2GL";
{_unit addMagazine "HandGrenade_West";} forEach [1,2];
_unit addMagazine "SmokeShell";
_unit addMagazine "SmokeShellGreen";
_unit addWeapon "M136";
};
case "SATCHELS":
{
{_unit addMagazine "30Rnd_556x45_Stanag";} forEach [1,2,3,4,5,6];
{_unit addMagazine "1Rnd_HE_M203";} forEach [1,2,3,4,5];
{_unit addMagazine "FlareWhite_M203";} forEach [1,2,3];
_unit addWeapon "M16A2GL";
{_unit addMagazine "PipeBomb";} forEach [1,2];
_unit addMagazine "SmokeShell";
_unit addMagazine "SmokeShellGreen";
};
case "M16A2GLTL":
{
{_unit addMagazine "30Rnd_556x45_Stanag";} forEach [1,2,3,4,5,6,7,8];
{_unit addMagazine "1Rnd_HE_M203";} forEach [1,2,3,4,5];
{_unit addMagazine "FlareWhite_M203";} forEach [1,2,3];
_unit addWeapon "M16A2GL";
{_unit addMagazine "HandGrenade_West";} forEach [1,2];
_unit addMagazine "SmokeShell";
_unit addMagazine "SmokeShellGreen";
_unit addWeapon "binocular";
};
};
if (!(_unit hasWeapon "itemGPS")) then
{
// _unit addWeapon "itemGPS"; // Uncomment to give everyone a GPS
};
if (!(_unit hasWeapon "LaserDesignator") && !(_unit hasWeapon "Binocular_Vector")) then
{
// _unit addWeapon "binocular"; // Uncomment to give everyone binocs
};
// Stan had NVGs
if (_unit == btz8) then {
_unit addWeapon "NVGoggles";
};
// Kiwi had a GPS
if (_unit == btz6) then {
_unit addWeapon "ItemGPS";
};
// Vince had a pistol.
if (_unit == btz2) then {
{_unit removeMagazine "FlareWhite_M203";} forEach [1,2,3];
{_unit addMagazine "15Rnd_9x19_M9";} forEach [1,2,3];
_unit addWeapon "M9";
};
_primaryWeapon = primaryWeapon _unit;
_unit selectweapon _primaryWeapon;
// Fix for weapons with grenade launcher
_muzzles = getArray(configFile>>"cfgWeapons" >> _primaryWeapon >> "muzzles");
_unit selectWeapon (_muzzles select 0);
That version was edited for a specific mission with old school items, but you can mix and match and add new loadout strings if you wanted to.