Jump to content

Recommended Posts

Hello.

How to get a random weapon

and of course the ammunition (does not have to be random) 

 

removeAllWeapons _this;
removeAllAssignedItems _this;
removeAllContainers _this;
removeGoggles _this;
removeHeadgear _this;
removeVest _this;
removeUniform _this;

 

 

//Clothing
if (side player == east) then {
    _this addUniform "U_OG_Guerilla1_1";
    _this addHeadgear "H_Cap_red";
    _this addVest "V_TacVest_camo";
    if ((daytime < 6) or (daytime > 19)) then {
        _this addItem "NVGoggles_OPFOR";
        _this assignItem "NVGoggles_OPFOR";
    };
};
if (side player == west) then {
    _this addUniform "U_BG_Guerilla2_3";
    _this addHeadgear "H_Cap_blu";
    _this addVest "V_TacVest_camo";
    if ((daytime < 6) or (daytime > 19)) then {
        _this addItem "NVGoggles";
        _this assignItem "NVGoggles";
    };
};

 

//Items
_this addWeapon "ItemMap";
_this addWeapon "ItemCompass";
_this addWeapon "ItemRadio";
_this addWeapon "ItemWatch";
_this addWeapon "ItemGPS";
_this addItem "FirstAidKit";
_this addItem "FirstAidKit";

Share this post


Link to post
Share on other sites

If that is a question, you could use this:

 

private _weapon = selectRandom ["classname1","classname2","classnameN"];

[_this,_weapon,8] call bis_fnc_addWeapon;

 

(adds 8 magazines for the randomly selected weapon _weapon)

Share this post


Link to post
Share on other sites

@Belbo 

1. Yes this was a question.

 

2. 

On 2.11.2018 at 2:42 PM, Belbo said:

private _weapon = selectRandom ["classname1","classname2","classnameN"];

[_this,_weapon,8] call bis_fnc_addWeapon;

 

I did not get it right to work properly, even with Arma's own original weapons

 

3. 

_this addWeapon "ItemGPS";
_this addItem "FirstAidKit";
_this addItem "FirstAidKit";

 

private _weapon = selectRandom ["Weapon_arifle_TRG20_F","Weapon_arifle_TRG21_F","Weapon_arifle_Mk20_plain_F","Weapon_arifle_Katiba_F","Weapon_arifle_Katiba_C_F","Weapon_LMG_Mk200_F","Weapon_arifle_MX_SW_F","Weapon_arifle_MX_SW_Black_F","Weapon_LMG_Zafir_F","Weapon_srifle_EBR_F","Weapon_srifle_DMR_01_F"];
[_this,_weapon,5] call BIS_fnc_addWeapon;

/*
Vanilla
Weapon_arifle_TRG20_F
Weapon_arifle_TRG21_F
Weapon_arifle_Mk20_plain_F
Weapon_arifle_Katiba_F
Weapon_arifle_Katiba_C_F
Weapon_LMG_Mk200_F
Weapon_arifle_MX_SW_F
Weapon_arifle_MX_SW_Black_F
Weapon_LMG_Zafir_F
Weapon_srifle_EBR_F
Weapon_srifle_DMR_01_F
*/

I use this mod if I get to work (CBA_A3 and NIArms All in one)

/*
NIArms All in one
Weapon_hlc_rifle_RK62
Weapon_hlc_rifle_ak47
Weapon_hlc_rifle_M4a1carryhandle
Weapon_hlc_rifle_auga3
Weapon_hlc_rifle_awmagnu
*/

Share this post


Link to post
Share on other sites

Take what you need from this script.

 

 

/*Beerkan Camo Loadout Script
Author: Beerkan
Version 0.96

Add to Description.ext
----------------------
class CfgFunctions
{
    class CAMO
    {
        class loadout
        {
            preInit = 1;
            class LoadoutCamo { file = 'CAMO_FNC_init.sqf';};
        };
    };
};
------------------------
Put this in the init.sqf

{if (_x IsKindof 'Man' && faction _x isEqualTo 'BLU_F' || _x isEqualTo 'BLU_CTRG_F' )
    then{
            [_x] spawn CAMO_fnc_Loadout;
        };
} foreach allunits;
------------------------
*/

Private ['_unit','_type'];
_unit = _this select 0;
_type = typeOf _unit;
CamoActive = true;
_nighttime = false;
_unit setSpeaker selectRandom ['Male01ENGB','Male02ENGB','Male03ENGB','Male04ENGB','Male05ENGB'] call BIS_Fnc_MP;

//Detect if unit is in vehicle
if (_unit isKindOf 'LandVehicle' || _unit isKindOf 'Ship_F' || _unit isKindOf 'Air') exitWith {{[_x] call CAMO_Fnc_LoadoutCamo;} forEach crew _unit;};

//remove ALL Units equipment etc
removeAllWeapons _unit;
removeAllAssignedItems _unit;
removeAllContainers _unit;
removeHeadgear _unit;
removeGoggles _unit;
_unit enableFatigue false;_unit setCustomAimCoef 0.35;_unit setUnitRecoilCoefficient 0.35;_unit enableStamina false;
_unit setUnitTrait ["Medic",true];_unit setUnitTrait ["Engineer",true];

//Give Unit Essential items
{_unit linkItem _x} forEach ['ItemWatch','ItemGPS','ItemRadio','ItemCompass','ItemMap'];
_unit addVest 'V_TacVest_camo';
_unit addHeadGear 'H_HelmetB_camo';
_unit forceadduniform 'U_B_CTRG_1';
_unit setObjectTextureGlobal [0,"\a3\characters_f\BLUFOR\Data\clothing_wdl_co.paa"];

//Add NVGoggles if it's night time.
if ((date select 3) < 6 or (date select 3) > 19) then {_nighttime = true};
if (_nighttime) then {_unit assignitem 'O_NVGoggles_urb_F';_unit linkitem 'O_NVGoggles_urb_F'};

//Add random eyeware
_unit addGoggles selectrandom ['','','','','','','','','','','','G_Sport_Blackred','G_Tactical_Clear','G_Shades_Blue',
'G_Aviator','G_Squares_Tinted',    'G_Squares','G_Shades_Red','G_Balaclava_blk','G_Shades_Black','G_Lowprofile','G_Combat',
'G_Spectacles_Tinted','G_Spectacles','G_Balaclava_blk','G_Balaclava_combat','G_Balaclava_lowprofile','G_Balaclava_oli',
'G_Bandanna_aviator','G_Bandanna_beast','G_Bandanna_blk','G_Bandanna_oli','G_Bandanna_khk','G_Bandanna_shades','G_Bandanna_sport'];

// Equip each unit based on their type.
switch (_type) do
{
    case 'B_officer_F'://Officer
        {
        //Give Unit clothing of choice
        if (isClass(configfile >> "CfgFactionClasses" >> "CUP_B_GB")) then {_unit addHeadgear 'CUP_H_BAF_Officer_Beret_PRR_U'} else {_unit addHeadgear 'H_Beret_blk'};
        removeGoggles _unit;
        _unit addGoggles 'G_Tactical_Black';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MXC_khk_F',9,1] call BIS_fnc_addWeapon;
        _unit addPrimaryWeaponitem 'optic_ERCO_khk_F';
        if (_nighttime) then {{_unit addPrimaryWeaponItem _x} forEach ['muzzle_snds_65_TI_ghex_F','acc_pointer_IR'];};
        
        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',1,'11Rnd_45ACP_Mag'] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};
        for '_i' from 1 to 2 do {_unit addItemToVest '11Rnd_45ACP_Mag';_unit addItemToVest 'SmokeShell'};
        for '_i' from 1 to 3 do {_unit addItemToVest 'HandGrenade'};
        _unit addItemToVest 'FirstAidKit';

        //Give Unit Specialist Equipment
        _unit addweaponGlobal 'Rangefinder';
        };    

    case 'B_Soldier_SL_F'://Squad Leader
        {
        //Give Unit clothing of choice
        _unit addHeadGear 'CUP_H_FR_BoonieWDL';
        _unit addBackpack 'B_AssaultPack_rgr';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',10,1] call BIS_fnc_addWeapon;
        _unit addPrimaryWeaponitem 'optic_ERCO_khk_F';
        if (_nighttime) then {{_unit addPrimaryWeaponItem _x} forEach ['muzzle_snds_65_TI_ghex_F']};

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',3] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};
        _unit addmagazines ['HandGrenade',6];

        // Load up on FirstAidKits
        _unit additem 'FirstAidKit';

        //Give Unit Specialist Equipment
        _unit addweapon 'Rangefinder';
        };

    case 'B_Soldier_TL_F'://Team Leader
        {
        //Give Unit clothing of choice
        _unit addHeadGear 'H_Cap_oli_hs';
        _unit addBackpack 'B_AssaultPack_rgr';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',6,1] call BIS_fnc_addWeapon;

        if (_nighttime) then {{_unit addPrimaryWeaponItem _x} forEach ['muzzle_snds_65_TI_ghex_F']};

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',3] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        _unit addItemToVest 'FirstAidKit';
        for '_i' from 1 to 5 do {_unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer'};
        _unit addItemToVest 'SmokeShell';
        for '_i' from 1 to 2 do {_unit addItemToVest '11Rnd_45ACP_Mag'};

        //Give Unit Specialist Equipment
        _unit addweapon 'Rangefinder';
        };

    case 'B_medic_F'://Combat Live Saver
        {
        //Give Unit clothing of choice
        _unit addBackPack 'B_AssaultPack_blk';
        _unit addVest 'V_TacVestIR_blk';

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_SW_khk_F',6,1] call BIS_fnc_AddWeapon;
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_khk_F','bipod_01_F_khk'];
        if (_nighttime) then {{_unit addPrimaryWeaponItem _x} forEach ['muzzle_snds_65_TI_ghex_F','acc_pointer_IR']};

        //Give unit ammo and extras
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];
        for '_i' from 1 to 2 do {_unit addItemToVest 'HandGrenade'};
        for '_i' from 1 to 10 do {_unit addItem 'FirstAidKit'};

        //Give Unit Specialist Equipment
        _unit addItemToBackpack 'Medikit';
        for '_i' from 1 to 2 do {_unit addItemToBackpack 'HandGrenade'};
        _unit addweapon 'Binocular';
        };

    case 'B_engineer_F'://Engineer
        {
        //Give Unit clothing of choice
        _unit addBackPack 'G_Bergen';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',1,1] call BIS_fnc_addWeapon;
        _unit addPrimaryWeaponitem 'optic_ERCO_khk_F';
        if (_nighttime) then {{_unit addPrimaryWeaponItem _x} forEach ['muzzle_snds_65_TI_ghex_F']};

        //Give Unit sidearm and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',1] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        for '_i' from 1 to 8 do {_unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer'};
        for '_i' from 1 to 3 do {_unit addItemToVest 'HandGrenade'};
        {_unit addItemToVest _x} forEach ['DemoCharge_Remote_Mag','FirstAidKit'];

        //Give Unit Specialist Equipment
        {_unit addItemToBackpack _x} forEach ['MineDetector','ToolKit','DemoCharge_Remote_Mag'];
        for '_i' from 1 to 2 do {_unit addItemToBackpack 'ATMine_Range_Mag';_unit addItemToBackpack '11Rnd_45ACP_Mag'};

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';

        };

    case 'B_soldier_AT_F'://Anti_Tank
        {
        //Give Unit clothing of choice
        _unit addBackpack 'B_Carryall_cbr';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',3,1] call BIS_fnc_addWeapon;
        _unit addPrimaryWeaponitem 'optic_ERCO_khk_F';
        if (_nighttime) then {{_unit addPrimaryWeaponItem _x} forEach ['muzzle_snds_65_TI_ghex_F','acc_pointer_IR']};

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'launch_I_Titan_short_F',1] call BIS_fnc_addWeapon;

        //Give Unit sidearm and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',2] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        _unit addItemToVest 'FirstAidKit';
        for '_i' from 1 to 3 do {_unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer';_unit addItemToVest 'HandGrenade';_unit addItemToBackpack 'Titan_AT'};
        {_unit addItemToBackpack _x} forEach ['HandGrenade','11Rnd_45ACP_Mag'];

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };

    case 'B_soldier_AA_F'://Anti_Air
        {
        //Give Unit clothing of choice
        _unit addBackpack 'B_Carryall_cbr';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',1,1] call BIS_fnc_AddWeapon;
        _unit addPrimaryWeaponitem 'optic_ERCO_khk_F';
        if (_nighttime) then {{_unit addPrimaryWeaponItem _x} forEach ['muzzle_snds_65_TI_ghex_F','acc_pointer_IR']};

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'launch_B_Titan_tna_F',1] call BIS_fnc_AddWeapon;

        //Give Unit sidearm and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',1] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        _unit addItemToVest 'FirstAidKit';
        for '_i' from 1 to 8 do {_unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer'};
        for '_i' from 1 to 3 do {_unit addItemToVest 'HandGrenade';_unit addItemToBackpack 'Titan_AA'};
        {_unit addItemToBackpack _x} forEach ['HandGrenade','11Rnd_45ACP_Mag'];

        //Give Unit Specialist Equipment
        _unit addweapon 'Rangefinder';
        };

    case 'B_recon_M_F'://Recon Marksman 
        {
        //Give Unit clothing of choice
        _unit addHeadgear 'H_Watchcap_khk';
        _unit addBackpack 'B_AssaultPack_rgr'; 

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MXM_khk_F',18,1] call BIS_fnc_addWeapon;
        {_unit addPrimaryWeaponItem _x} forEach ['optic_DMS','bipod_01_F_khk','muzzle_snds_65_TI_ghex_F','acc_pointer_IR'];

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',4] call BIS_fnc_addWeapon;
        _unit addHandgunItem 'muzzle_snds_acp';
                    
        // Load up on FirstAidKits
        for '_i' from 1 to 2 do {_unit additemtoBackPack 'FirstAidKit'};
        _unit addmagazines ['HandGrenade',5];

        //Give Unit Specialist Equipment
        _unit addweapon 'Rangefinder';
        };

    case 'B_Soldier_GL_F'://Grenadier
        {
        //Give Unit clothing of choice
        _unit addHeadGear 'H_Cap_khaki_specops_UK';
        _unit addBackPack 'B_FieldPack_cbr';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        _unit addMagazine '3Rnd_HE_Grenade_shell';
        [_unit,'arifle_MX_GL_khk_F',1,1] call BIS_fnc_addWeapon;
        _unit addPrimaryWeaponitem 'optic_ERCO_khk_F';
        if (_nighttime) then {{_unit addPrimaryWeaponItem _x} forEach ['muzzle_snds_65_TI_ghex_F','acc_pointer_IR']};

        //Give Unit primary weapon attachments based on side and weapon capability
        _unit addprimaryweaponitem 'acc_flashlight';

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',1] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        for '_i' from 1 to 12 do {_unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer';};
        {_unit addItemToBackpack _x} forEach ['FirstAidKit','30Rnd_65x39_caseless_mag_Tracer'];
        for '_i' from 1 to 11 do {_unit addItemToBackpack '3Rnd_HE_Grenade_shell';};
        for '_i' from 1 to 3 do {_unit addItemToBackpack 'HandGrenade';};
        for '_i' from 1 to 2 do {_unit addItemToBackpack '11Rnd_45ACP_Mag';};

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };

        case 'B_sniper_F'://Sniper
        {
        //Give Unit clothing of choice
        if (isClass(configfile >> "CfgFactionClasses" >> "CUP_B_GB")) then {_unit forceAddUniform 'CUP_U_B_USMC_Ghillie_WDL'} else {_unit forceAddUniform 'U_B_GhillieSuit'};
        _unit addHeadGear 'H_HelmetB_snakeskin';
        _unit addBackpack 'B_AssaultPack_khk';            

        //Give unit First Aid and extras and place in Uniform
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        // BLUFOR SNIPER RIFE 
        [_unit,'srifle_LRR_camo_SOS_F',18] call BIS_fnc_addWeapon;

        //Give Unit primary weapon attachments based on side and weapon capability
        _unit addPrimaryWeaponItem 'optic_LRPS';

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',3] call BIS_fnc_addWeapon;
        _unit addHandgunItem 'muzzle_snds_acp';
        _unit addmagazines ['HandGrenade',6];
        {_unit addItemToBackpack _x} forEach ['5Rnd_127x108_Mag','FirstAidKit'];

        //Give Unit Specialist Equipment
        _unit addweapon 'Rangefinder';
        };

    case 'B_spotter_F'://Sniper Spotter
        {
        //Give Unit clothing of choice
        if (isClass(configfile >> "CfgFactionClasses" >> "CUP_B_GB")) then {_unit forceAddUniform 'CUP_U_B_USMC_Ghillie_WDL'} else {_unit forceAddUniform 'U_B_GhillieSuit'};
        _unit addHeadGear 'H_HelmetB_snakeskin';
        _unit addBackpack 'B_AssaultPack_khk';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MXM_khk_F',18,1] call BIS_fnc_addWeapon;
        if (_nighttime) then {{_unit addPrimaryWeaponItem _x} forEach ['muzzle_snds_65_TI_ghex_F','acc_pointer_IR']};

        //Give Unit primary weapon attachments based on side and weapon capability
        {_unit addPrimaryWeaponItem _x} forEach ['optic_DMS','bipod_01_F_khk','acc_pointer_IR'];

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',4] call BIS_fnc_addWeapon;
        _unit addHandgunItem 'muzzle_snds_acp';            

        // Load up on FirstAidKits
        for '_i' from 1 to 2 do {_unit additemtoBackPack 'FirstAidKit'};
        _unit addmagazines ['HandGrenade',5];

        //Give Unit Specialist Equipment
        _unit addweapon 'Rangefinder';
        };

    case 'B_soldier_exp_F'://Explosives Expert
        {
        //Give Unit clothing of choice
        _unit addBackpack 'G_Bergen';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];
        
        _unit addItemToVest 'FirstAidKit';
        for '_i' from 1 to 4 do {_unit addItemToVest 'HandGrenade'};

        //Give Unit Specialist Equipment
        {_unit addItemToBackpack _x} forEach ['MineDetector','ToolKit'];
        for '_i' from 1 to 5 do {_unit addItemToBackpack 'DemoCharge_Remote_Mag'};
        for '_i' from 1 to 2 do {_unit addItemToBackpack '11Rnd_45ACP_Mag'};
        for '_i' from 1 to 3 do {_unit addItemToBackpack 'ClaymoreDirectionalMine_Remote_Mag'};

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',10,1] call BIS_fnc_addWeapon;
        _unit addPrimaryWeaponitem 'optic_ERCO_khk_F';
        if (_nighttime) then {{_unit addPrimaryWeaponItem _x} forEach ['muzzle_snds_65_TI_ghex_F','acc_pointer_IR']};

        //Give Unit sidearm and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',1] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};
        _unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer';

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };

    case 'B_soldier_repair_F'://Repair Specialist
        {
        //Give Unit clothing of choice
        _unit addBackPack 'B_AssaultPack_rgr';
        
        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];
        {_unit addItemToVest _x} forEach ['FirstAidKit','HandGrenade'];    
        for '_i' from 1 to 4 do {_unit addItemToBackPack 'HandGrenade'};

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',9,1] call BIS_fnc_AddWeapon;
        _unit addPrimaryWeaponitem 'optic_ERCO_khk_F';
        if (_nighttime) then {{_unit addPrimaryWeaponItem _x} forEach ['muzzle_snds_65_TI_ghex_F','acc_pointer_IR']};

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',5] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};            

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        _unit addItemToBackpack 'Toolkit';
        };

    case 'B_soldier_M_F'://Marksman
        {
        //Give Unit clothing of choice
        _unit addHeadGear 'CUP_H_FR_BoonieWDL';            
        _unit addBackpack 'B_AssaultPack_rgr';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];
        {_unit addItemToVest _x} forEach ['FirstAidKit','HandGrenade'];    
        
        for '_i' from 1 to 3 do {_unit addItemToVest 'HandGrenade'};
        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_SPAR_03_khk_F',18,1] call BIS_fnc_addWeapon;
        {_unit addPrimaryWeaponItem _x} forEach ['optic_DMS','bipod_01_F_khk','acc_pointer_IR'];
        if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_B_khk_F'};
        
        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',3] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        //Give Unit Specialist Equipment
        _unit addweapon 'Rangefinder';
        };

    case 'B_Soldier_F'://Standard Soldier
        {
        //Give Unit clothing of choice
        _unit addBackpack 'B_AssaultPack_rgr';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};        
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];
        {_unit addItemToVest _x} forEach ['FirstAidKit','HandGrenade','SmokeShell','SmokeShell'];
        for '_i' from 1 to 6 do {_unit addItemToBackpack 'HandGrenade'};
        
        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',19,1] call BIS_fnc_addWeapon;
        _unit addPrimaryWeaponitem 'optic_ERCO_khk_F';
        if (_nighttime) then {{_unit addPrimaryWeaponItem _x} forEach ['muzzle_snds_65_TI_ghex_F']};

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',4] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };

    case 'B_Soldier_universal_F'://Universal Soldier
        {
        //Give Unit clothing of choice
        _unit addBackpack 'B_AssaultPack_rgr';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};        
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];
        {_unit addItemToVest _x} forEach ['FirstAidKit','HandGrenade','SmokeShell','SmokeShell'];
        for '_i' from 1 to 6 do {_unit addItemToBackpack 'HandGrenade'};

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_SW_khk_F',10,1] call BIS_fnc_AddWeapon;
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_khk_F','bipod_01_F_khk'];
        if (_nighttime) then {{_unit addPrimaryWeaponItem _x} forEach ['muzzle_snds_65_TI_ghex_F','acc_pointer_IR']};

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',4] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };

    case 'B_soldier_LAT_F'://Anti-Tank Gunner
        {
        //Give Unit clothing of choice
        _unit addBackpack 'B_Carryall_cbr';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',3,1] call BIS_fnc_addWeapon;
        _unit addPrimaryWeaponitem 'optic_ERCO_khk_F';
        if (_nighttime) then {{_unit addPrimaryWeaponItem _x} forEach ['muzzle_snds_65_TI_ghex_F']};

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'launch_NLAW_F',1] call BIS_fnc_addWeapon;

        //Give Unit sidearm and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',2] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        _unit addItemToVest 'FirstAidKit';
        for '_i' from 1 to 3 do {_unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer';_unit addItemToVest 'HandGrenade';_unit addItemToBackpack 'NLAW_F'};
        {_unit addItemToBackpack _x} forEach ['HandGrenade','11Rnd_45ACP_Mag'];

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };

    case 'B_Soldier_A_F'://Ammo Bearer
        {
        //Give Unit clothing of choice
        _unit addBackpack 'G_Bergen';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];
        
        _unit addItemToVest 'FirstAidKit';
        for '_i' from 1 to 4 do {_unit addItemToVest 'HandGrenade'};

        //Give Unit Specialist Equipment
        for '_i' from 1 to 6 do {_unit addItemToBackpack '30Rnd_65x39_caseless_mag_Tracer';_unit addItemToBackpack '20Rnd_762x51_Mag';_unit addItemToBackpack '100Rnd_65x39_caseless_mag_Tracer'};
        for '_i' from 1 to 2 do {_unit addItemToBackpack '11Rnd_45ACP_Mag'};

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',10,1] call BIS_fnc_addWeapon;
        _unit addPrimaryWeaponitem 'optic_ERCO_khk_F';
        if (_nighttime) then {{_unit addPrimaryWeaponItem _x} forEach ['muzzle_snds_65_TI_ghex_F','acc_pointer_IR']};

        //Give Unit sidearm and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',1] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};
        _unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer';

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };

    case 'B_soldier_AR_F'://AutoRifleman
    {
        //Give Unit clothing of choice
        _unit addBackPack 'B_AssaultPack_rgr';
        _unit addHeadgear 'CUP_H_FR_Cap_Headset_Green';
        
        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_SW_khk_F',14,1] call BIS_fnc_addWeapon;            
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_khk_F','bipod_01_F_khk'];
        if (_nighttime) then {{_unit addPrimaryWeaponItem _x} forEach ['muzzle_snds_65_TI_ghex_F','acc_pointer_IR']};

        //Give unit ammo and extras
        for '_i' from 1 to 2 do {_unit addItemToVest 'HandGrenade'};
        for '_i' from 1 to 3 do {_unit addItemToBackpack 'FirstAidKit'};

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };

    case 'B_soldier_AAR_F'://Assistant AutoRifleman
        {
        //Give Unit clothing of choice
        _unit addBackPack 'B_AssaultPack_rgr';
        _unit addHeadgear 'H_Watchcap_khk';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_SW_khk_F',14,1] call BIS_fnc_addWeapon;            
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_khk_F','bipod_01_F_khk'];
        if (_nighttime) then {{_unit addPrimaryWeaponItem _x} forEach ['muzzle_snds_65_TI_ghex_F','acc_pointer_IR']};

        //Give unit ammo and extras
        for '_i' from 1 to 2 do {_unit addItemToVest 'HandGrenade'};

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };
    
    case 'B_support_GMG_F'://Machine Gunner
        {
        //Give Unit clothing of choice
        _unit addBackpack 'B_AssaultPack_rgr';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];
        {_unit addItemToVest _x} forEach ['FirstAidKit','HandGrenade','SmokeShell','SmokeShell'];
        for '_i' from 1 to 6 do {_unit addItemToBackpack 'HandGrenade'};

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',19,1] call BIS_fnc_addWeapon;
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_khk_F','bipod_01_F_khk'];
        if (_nighttime) then {{_unit addPrimaryWeaponItem _x} forEach ['muzzle_snds_65_TI_ghex_F','acc_pointer_IR']};

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',4] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };

    case 'B_HeavyGunner_F'://Heavy Gunner
        {
        //Give Unit clothing of choice
        _unit addBackpack 'B_Kitbag_rgr';
        _unit addheadgear 'H_Bandanna_camo';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};        
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];
        {_unit addItemToVest _x} forEach ['FirstAidKit','HandGrenade','SmokeShell','SmokeShell'];
        for '_i' from 1 to 4 do {_unit addItemToVest 'HandGrenade'};

        //Give Unit primary weapons and magazines based on Side
        [_unit,'LMG_Mk200_F',5,1] call BIS_fnc_addWeapon;
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_snd_F','bipod_01_F_snd'];
        if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_H_MG_khk_F'};
        _unit addItemToBackpack    '200Rnd_65x39_cased_Box_Tracer';

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',4] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};            

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };

    case 'B_CTRG_Soldier_TL_tna_F'://Tanoa Team Leader
        {
        //Give Unit clothing of choice        
        _unit addHeadGear 'H_Booniehat_oli';
        _unit addBackpack 'B_AssaultPack_rgr';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',6,1] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_65_TI_ghex_F'};
        //if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_H_khk_F'};

        //Give Unit primary weapon attachments based on side and weapon capability
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_khk_F','bipod_01_F_khk','acc_pointer_IR'];

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',3] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        _unit addItemToVest 'FirstAidKit';
        for '_i' from 1 to 5 do {_unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer'};
        _unit addItemToVest 'SmokeShell';
        for '_i' from 1 to 2 do {_unit addItemToVest '11Rnd_45ACP_Mag'};
        for '_i' from 1 to 3 do {_unit addItemToBackpack 'HandGrenade';_unit addItemToBackpack '30Rnd_65x39_caseless_mag_Tracer'};

        //Give Unit Specialist Equipment
        _unit addweapon 'Rangefinder';
        };

    case 'B_CTRG_Soldier_Medic_tna_F'://Tanoa Combat Live Saver
        {
        //Give Unit clothing of choice
        _unit addBackPack 'B_AssaultPack_rgr';
        _unit addVest 'V_TacVestIR_blk';

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_SW_khk_F',6,1] call BIS_fnc_AddWeapon;
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_khk_F','bipod_01_F_khk','acc_pointer_IR'];
        if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_65_TI_ghex_F'};

        //Give unit ammo and extras
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];
        for '_i' from 1 to 2 do {_unit addItemToVest 'HandGrenade'};
        for '_i' from 1 to 10 do {_unit addItem 'FirstAidKit'};

        //Give Unit Specialist Equipment
        _unit addItemToBackpack 'Medikit';
        for '_i' from 1 to 2 do {_unit addItemToBackpack 'HandGrenade'};
        _unit addweapon 'Binocular';
        };

    case 'B_CTRG_Soldier_Exp_tna_F'://Tanoa Explosives Expert
        {
        //Give Unit clothing of choice
        _unit addBackpack 'B_TacticalPack_rgr';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];
        
        _unit addItemToVest 'FirstAidKit';
        for '_i' from 1 to 4 do {_unit addItemToVest 'HandGrenade'};

        //Give Unit Specialist Equipment
        {_unit addItemToBackpack _x} forEach ['MineDetector','ToolKit'];
        for '_i' from 1 to 5 do {_unit addItemToBackpack 'DemoCharge_Remote_Mag'};
        for '_i' from 1 to 2 do {_unit addItemToBackpack '11Rnd_45ACP_Mag'};
        for '_i' from 1 to 3 do {_unit addItemToBackpack 'ClaymoreDirectionalMine_Remote_Mag'};

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',10,1] call BIS_fnc_addWeapon;

        //Give Unit secondary weapons and magazines based on weapon capability
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_khk_F','bipod_01_F_khk','acc_pointer_IR'];
        if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_65_TI_ghex_F'};

        //Give Unit sidearm and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',1] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};
        _unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer';

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };

    case 'B_CTRG_Soldier_M_tna_F'://Tanoa Marksman
        {
        //Give Unit clothing of choice
        _unit addHeadGear 'H_Cap_khaki_specops_UK';
        _unit addBackpack 'B_AssaultPack_rgr';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];
        {_unit addItemToVest _x} forEach ['FirstAidKit','HandGrenade'];    
        
        for '_i' from 1 to 3 do {_unit addItemToVest 'HandGrenade'};
        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_SPAR_03_khk_F',18,1] call BIS_fnc_addWeapon;
        {_unit addPrimaryWeaponItem _x} forEach ['optic_DMS','bipod_01_F_khk','acc_pointer_IR'];
        if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_B_khk_F'};
        
        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',3] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        //Give Unit Specialist Equipment
        _unit addweapon 'Rangefinder';
        };

    case 'B_CTRG_Soldier_tna_F'://Tanoa Scout Soldier
        {
        //Give Unit clothing of choice
        _unit addHeadGear 'H_Watchcap_khaki_specops_UK';
        _unit addBackpack 'B_AssaultPack_rgr';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};        
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];
        {_unit addItemToVest _x} forEach ['FirstAidKit','HandGrenade','SmokeShell','SmokeShell'];
        for '_i' from 1 to 6 do {_unit addItemToBackpack 'HandGrenade'};
        
        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MXM_khk_F',19,1] call BIS_fnc_addWeapon;
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_khk_F','bipod_01_F_khk','muzzle_snds_65_TI_ghex_F'];

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',4] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };

    case 'B_CTRG_Soldier_LAT_tna_F'://Tanoa Anti-Tank Gunner
        {
        //Give Unit clothing of choice
        _unit addBackpack 'B_Kitbag_rgr';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',14,1] call BIS_fnc_addWeapon;
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_khk_F','bipod_01_F_khk'];
        if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_65_TI_ghex_F'};

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'launch_I_Titan_short_F',1] call BIS_fnc_addWeapon;

        //Give Unit sidearm and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',2] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        _unit addItemToVest 'FirstAidKit';
        for '_i' from 1 to 3 do {_unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer';_unit addItemToVest 'HandGrenade';_unit addItemToBackpack 'Titan_AT'};
        {_unit addItemToBackpack _x} forEach ['HandGrenade','HandGrenade','11Rnd_45ACP_Mag'];

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };

    case 'B_CTRG_Soldier_AR_tna_F'://Tanoa AutoRifleman
        {
        //Give Unit clothing of choice
        _unit addBackPack 'B_AssaultPack_rgr';
        
        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_SW_khk_F',14,1] call BIS_fnc_addWeapon;            
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_khk_F','bipod_01_F_khk'];
        if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_65_TI_ghex_F'};

        //Give unit ammo and extras
        for '_i' from 1 to 2 do {_unit addItemToVest 'HandGrenade'};
        for '_i' from 1 to 3 do {_unit addItemToBackpack 'FirstAidKit'};

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };

    case 'B_CTRG_Soldier_JTAC_tna_F'://Tanoa JTAC Unit
        {
        //Give Unit clothing of choice            
        _unit addHeadgear 'H_Cap_headphones';
        _unit addBackPack 'B_FieldPack_oli';
        _unit addGoggles 'G_Balaclava_blk';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        _unit addMagazine '3Rnd_HE_Grenade_shell';
        [_unit,'arifle_MX_GL_khk_Hamr_pointer_F',1,1] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_65_TI_ghex_F'};

        //Give Unit primary weapon attachments based on side and weapon capability
        {_unit addPrimaryWeaponItem _x} forEach ['acc_pointer_IR','bipod_01_F_khk','optic_ERCO_khk_F'];

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',1] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        for '_i' from 1 to 12 do {_unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer';};
        {_unit addItemToBackpack _x} forEach ['FirstAidKit','30Rnd_65x39_caseless_mag_Tracer'];
        for '_i' from 1 to 11 do {_unit addItemToBackpack '3Rnd_HE_Grenade_shell';};
        for '_i' from 1 to 3 do {_unit addItemToBackpack 'HandGrenade';};
        for '_i' from 1 to 2 do {_unit addItemToBackpack '11Rnd_45ACP_Mag';};

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };

    case 'B_Story_SF_Captain_F'://Captain Miller
        {
        //Give Unit clothing of choice
        removeHeadgear _unit;
        removeGoggles _unit;
        _unit addBackPack 'B_AssaultPack_rgr';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MXC_khk_F',9,1] call BIS_fnc_addWeapon;
        _unit addPrimaryWeaponitem 'optic_ERCO_khk_F';
        if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_65_TI_ghex_F'};

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',1,'11Rnd_45ACP_Mag'] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};
        for '_i' from 1 to 2 do {_unit addItemToVest '11Rnd_45ACP_Mag';_unit addItemToVest 'SmokeShell'};
        for '_i' from 1 to 3 do {_unit addItemToVest 'HandGrenade'};
        _unit addItemToVest 'FirstAidKit';

        //Give Unit Specialist Equipment
        _unit addweaponGlobal 'Binocular';
        };

    case 'B_CTRG_soldier_GL_LAT_F'://Northgate
        {
        //Give Unit clothing of choice
        _unit addHeadGear 'H_Cap_khaki_specops_UK';
        _unit addBackPack 'B_FieldPack_cbr';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        _unit addMagazine '3Rnd_HE_Grenade_shell';
        [_unit,'arifle_MX_GL_Black_Hamr_pointer_F',1,1] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_65_TI_ghex_F'};

        //Give Unit primary weapon attachments based on side and weapon capability
        _unit addprimaryweaponitem 'acc_flashlight';

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',1] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};
        for '_i' from 1 to 12 do {_unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer';};
        {_unit addItemToBackpack _x} forEach ['FirstAidKit','30Rnd_65x39_caseless_mag_Tracer'];
        for '_i' from 1 to 11 do {_unit addItemToBackpack '3Rnd_HE_Grenade_shell';};
        for '_i' from 1 to 3 do {_unit addItemToBackpack 'HandGrenade';};
        for '_i' from 1 to 2 do {_unit addItemToBackpack '11Rnd_45ACP_Mag';};

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };

    case 'B_CTRG_soldier_engineer_exp_F'://Hardy
        {
        //Give Unit clothing of choice
        _unit addBackPack 'G_Bergen';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',1,1] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_65_TI_ghex_F'};

        //Give Unit sidearm and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',1] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        for '_i' from 1 to 8 do {_unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer'};
        for '_i' from 1 to 3 do {_unit addItemToVest 'HandGrenade'};
        {_unit addItemToVest _x} forEach ['DemoCharge_Remote_Mag','FirstAidKit'];

        //Give Unit Specialist Equipment
        {_unit addItemToBackpack _x} forEach ['MineDetector','ToolKit','DemoCharge_Remote_Mag'];
        for '_i' from 1 to 2 do {_unit addItemToBackpack 'ATMine_Range_Mag';_unit addItemToBackpack '11Rnd_45ACP_Mag'};

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';

        };

    case 'B_CTRG_soldier_AR_A_F'://McKay
        {
        //Give Unit clothing of choice
        _unit addBackpack 'B_Kitbag_rgr';
        _unit addheadgear 'H_Bandanna_camo';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};        
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];
        {_unit addItemToVest _x} forEach ['FirstAidKit','HandGrenade','SmokeShell','SmokeShell'];
        for '_i' from 1 to 4 do {_unit addItemToVest 'HandGrenade'};

        //Give Unit primary weapons and magazines based on Side
        if (isClass(configfile >> "CfgFactionClasses" >> "CUP_B_GB"))
        then {
                [_unit,'CUP_lmg_L110A1_Aim_Laser',1,1] call BIS_fnc_addWeapon;
                for '_i' from 1 to 4 do {_unit addItemToBackpack 'CUP_200Rnd_TE4_Yellow_Tracer_556x45_M249'};
             }
        else {    
                [_unit,'LMG_Mk200_F',1,1] call BIS_fnc_addWeapon
                for '_i' from 1 to 4 do {_unit addItemToBackpack 'CUP_200Rnd_TE4_Yellow_Tracer_556x45_M249'};
             };
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_khk_F','bipod_01_F_khk'];            
        for '_i' from 1 to 5 do {_unit additemtobackpack '200Rnd_65x39_cased_Box_Tracer'};

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',4] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
    };

    case 'B_CTRG_soldier_M_medic_F'://Medic
        {
        //Give Unit clothing of choice
        _unit addBackPack 'B_AssaultPack_blk';
        _unit addVest 'V_TacVestIR_blk';

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_SW_khk_F',6,1] call BIS_fnc_AddWeapon;
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_khk_F','bipod_01_F_khk'];
        if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_65_TI_ghex_F'};

        //Give unit ammo and extras
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];
        for '_i' from 1 to 2 do {_unit addItemToVest 'HandGrenade'};
        for '_i' from 1 to 10 do {_unit addItem 'FirstAidKit'};

        //Give Unit Specialist Equipment
        _unit addItemToBackpack 'Medikit';
        for '_i' from 1 to 2 do {_unit addItemToBackpack 'HandGrenade'};
        _unit addweapon 'Binocular';
        };

    case 'B_CTRG_Miller_F':// Miller
        {
        //Give Unit clothing of choice
        removeHeadgear _unit;
        removeGoggles _unit;            

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',6,1] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_65_TI_ghex_F'};

        //Give Unit primary weapon attachments based on side and weapon capability
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_khk_F','bipod_01_F_khk'];

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_P07_khk_F',3] call BIS_fnc_addWeapon;            

        _unit addItemToVest 'FirstAidKit';
        for '_i' from 1 to 5 do {_unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer'};
        _unit addItemToVest 'SmokeShell';
        for '_i' from 1 to 2 do {_unit addItemToVest '11Rnd_45ACP_Mag'};

        //Give Unit Specialist Equipment
        _unit addweapon 'Rangefinder';
        };

    case 'B_T_Helipilot_F':// Pilot
        {
        //Give Unit clothing of choice        
        _unit addHeadgear 'H_PilotHelmetHeli_O';
        _unit addVest 'V_TacVest_oli';
        _unit forceAddUniform 'U_I_pilotCoveralls';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];
        _unit addItemToUniform 'HandGrenade';

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',6,1] call BIS_fnc_addWeapon;
        _unit addItemToUniform '30Rnd_65x39_caseless_mag_Tracer';
        
        //Give Unit primary weapon attachments based on side and weapon capability
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_khk_F','bipod_01_F_khk'];
        if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_65_TI_ghex_F'};

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',3] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        _unit addItemToVest 'FirstAidKit';
        for '_i' from 1 to 2 do {_unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer'};
        _unit addItemToVest 'SmokeShell';
        for '_i' from 1 to 2 do {_unit addItemToVest '11Rnd_45ACP_Mag'};
        
        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };

    case 'B_T_Crew_F':// Vehicle Crew
        {
        //Give Unit clothing of choice        
        _unit addHeadgear 'H_PilotHelmetHeli_O';
        _unit addVest 'V_TacVest_oli';
        _unit forceAddUniform 'U_I_pilotCoveralls';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];
        _unit addItemToUniform 'HandGrenade';

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',6,1] call BIS_fnc_addWeapon;
        _unit addItemToUniform '30Rnd_65x39_caseless_mag_Tracer';

        //Give Unit primary weapon attachments based on side and weapon capability
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_khk_F','bipod_01_F_khk'];
        if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_65_TI_ghex_F'};

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',3] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        _unit addItemToVest 'FirstAidKit';
        for '_i' from 1 to 2 do {_unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer'};
        _unit addItemToVest 'SmokeShell';
        for '_i' from 1 to 2 do {_unit addItemToVest '11Rnd_45ACP_Mag'};
        
        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };

    case 'B_helicrew_F':// Heli Crew
        {
        //Give Unit clothing of choice        
        _unit addHeadgear 'H_PilotHelmetHeli_O';
        _unit addVest 'V_TacVest_oli';
        _unit forceAddUniform 'U_I_pilotCoveralls';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];
        _unit addItemToUniform 'HandGrenade';

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',6,1] call BIS_fnc_addWeapon;
        _unit addItemToUniform '30Rnd_65x39_caseless_mag_Tracer';

        //Give Unit primary weapon attachments based on side and weapon capability
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_khk_F','bipod_01_F_khk'];
        if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_65_TI_ghex_F'};

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',3] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        _unit addItemToVest 'FirstAidKit';
        for '_i' from 1 to 2 do {_unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer'};
        _unit addItemToVest 'SmokeShell';
        for '_i' from 1 to 2 do {_unit addItemToVest '11Rnd_45ACP_Mag'};
        
        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };
        
    case 'NEW1':
        {
        };

    case 'NEW2':
        {
        };

    case 'NEW3':
        {
        };

    Default //Default Uniform
        {
        //Give Unit clothing of choice        
        _unit addBackpack 'B_AssaultPack_rgr';

        //Give unit ammo and extras and place in Uniform Vest and Backpack
        for '_i' from 1 to 3 do {_unit addItemToUniform 'FirstAidKit'};
        {_unit addItemToUniform _x} forEach ['HandGrenade','SmokeShell','Chemlight_blue'];

        //Give Unit primary weapons and magazines based on Side
        [_unit,'arifle_MX_khk_F',6,1] call BIS_fnc_addWeapon;

        //Give Unit primary weapon attachments based on side and weapon capability
        {_unit addPrimaryWeaponItem _x} forEach ['optic_ERCO_khk_F','bipod_01_F_khk'];
        if (_nighttime) then {_unit addPrimaryWeaponItem 'muzzle_snds_65_TI_ghex_F'};

        //Give Unit secondary weapons and magazines based on weapon capability
        [_unit,'hgun_Pistol_heavy_01_MRD_F',3] call BIS_fnc_addWeapon;
        if (_nighttime) then {_unit addHandgunItem 'muzzle_snds_acp'};

        _unit addItemToVest 'FirstAidKit';
        for '_i' from 1 to 5 do {_unit addItemToVest '30Rnd_65x39_caseless_mag_Tracer'};
        _unit addItemToVest 'SmokeShell';
        for '_i' from 1 to 2 do {_unit addItemToVest '11Rnd_45ACP_Mag'};
        for '_i' from 1 to 3 do {_unit addItemToBackpack 'HandGrenade';_unit addItemToBackpack '30Rnd_65x39_caseless_mag_Tracer'};

        //Give Unit Specialist Equipment
        _unit addweapon 'Binocular';
        };            
};
  • Thanks 1

Share this post


Link to post
Share on other sites
38 minutes ago, Casio91Fin said:

I did not get it right to work properly, even with Arma's own original weapons

You are using world object classnames, not inventory object classnames.

private _weapon = selectRandom [
"arifle_TRG20_F",
"arifle_TRG21_F",
"arifle_Mk20_plain_F",
"arifle_Katiba_F",
"arifle_Katiba_C_F",
"LMG_Mk200_F",
"arifle_MX_SW_F",
"arifle_MX_SW_Black_F",
"LMG_Zafir_F",
"srifle_EBR_F",
"srifle_DMR_01_F"
];

 

  • Like 3

Share this post


Link to post
Share on other sites

@Harzach 

Thanks for clearing it

 

@Beerkan

Thanks also to you. Oh God how long is it? I could not read it all at once. I'm going to study the script at some point.

Share this post


Link to post
Share on other sites

if you want you can take the following files from the above script pack:

VD_Settings.sqf (adjust loot arrays and manage what active mods may be used, you can also exclude any vanilla items)

VD_Arrays.sqf (generating the arrays for the various equipment slots)

VD_Functions.sqf (loads of functions, interessting for you are VD_Player_Equipper and VD_Equipper)

 

in init.sqf excecvm all those .sqf in the above order (!)

 

call the random player equipper with "player call VD_Player_Equipper (from initplayerlocal.sqf, onplayerrespawn.sqf)

call the random AI equipper for the AI Group with {_x call VD_Equipper}foreach units _Groupname;

 

basically these scripts will detect what mods are active and put the various items into classes (rifles, pistols, headgears, uniforms....) under settings you can further adjust those adrays, e.g. of you use IFA3, but u dont want the uniforms, just the weapons, you can select that there)

 

i hope this helps, let me know if you need any help.

cheers vd

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×