Jump to content

Recommended Posts

15 hours ago, CHICKENLICKEN said:

i think i understand. SO

 

You need to wait for the updated version !

 

 

GF Set Custom Loadout Script

3.0 version

news_download_a3_3.png

Share this post


Link to post
Share on other sites


still not working: here: is what I have: just a test: i want them to only use pistol. But they have everythingL

 

Quote

/________________ GF_SCL_east.sqf _____________


GF_SCL_east_primaryWeapon_array = [
    
];
            
GF_SCL_east_handgunWeapon_array = [
//    Pistols

"hgun_Rook40_F",

            
        

GF_SCL_east_Uniform_array = [

"V_EOD_olive_F"            
]; 


GF_SCL_east_Backpacks_array = [

];  

            
GF_SCL_east_Headgear_array = [

"H_Cap_police"
];


GF_SCL_east_Goggles_array = [

];
            
            
GF_SCL_east_items_array_1 = [
//for RyanZombies
//"RyanZombiesAntiVirusTemporary_Item",
//"RyanZombiesAntiVirusCure_Item",

//Vanilla            
"ToolKit",
"MediKit",
"FirstAidKit",
"FirstAidKit",             

//    Tools
"Binocular",
"Rangefinder",            
"Laserdesignator",
"Laserdesignator_02",
"Laserdesignator_03",
"MineDetector"
];
    
    
GF_SCL_east_items_array_2 = [
//Here ONLY :items , PointerAttachments , BipodAttachments , MuzzleAttachments , OpticAttachments , NVG
"ItemCompass",
"ItemWatch",
"ItemRadio",
"ItemGPS",
"ItemMap",

//    x2
"ItemCompass",
"ItemWatch",
"ItemRadio",
"ItemGPS",
"ItemMap",

//    PointerAttachments
"acc_flashlight",
"acc_pointer_IR",

//    BipodAttachments
"bipod_01_F_blk",
"bipod_01_F_mtp",
"bipod_01_F_snd",
"bipod_02_F_blk",
"bipod_02_F_hex",
"bipod_02_F_tan",
"bipod_03_F_blk",
"bipod_03_F_oli",

//    Apex
"bipod_01_F_khk",

//    MuzzleAttachments


//    Apex

//    NVG

];

    
GF_SCL_east_items_array_3 = [
//    Flares
"Chemlight_blue",
"Chemlight_green",
"Chemlight_red",

//    Smokes


//    Explosives

];
            

GF_SCL_east_Ravage_items_array = [        
//    Ravage_items
//    x1
"rvg_plasticBottleEmpty",
"rvg_canteenEmpty",
"rvg_hose",
"rvg_sleepingBag_Blue", 
"rvg_foldedTent",
"rvg_rustyCan",
"rvg_Geiger",
"rvg_canisterFuel_Empty",
"rvg_toolkit",
"rvg_tire",

//    Vital            
"rvg_money", 
"rvg_notepad", 
"rvg_docFolder",
"rvg_canOpener",
"rvg_guttingKnife", 
"rvg_matches",
"rvg_plasticBottle",
"rvg_plasticBottlePurified", 
"rvg_spirit", 
"rvg_franta",
"rvg_beans", 
"rvg_bacon", 
"rvg_milk", 
"rvg_rice",
"rvg_antiRad",
"rvg_purificationTablets",                        

//x2 Vital
"rvg_money", 
"rvg_notepad", 
"rvg_docFolder",
"rvg_canOpener",
"rvg_guttingKnife", 
"rvg_matches",
"rvg_plasticBottle",
"rvg_plasticBottlePurified", 
"rvg_spirit", 
"rvg_franta",
"rvg_beans", 
"rvg_bacon", 
"rvg_milk", 
"rvg_rice",
"rvg_antiRad",
"rvg_purificationTablets",

//    Mask
"Mask_M40_OD",
"Mask_M40",
"Mask_M50"
];
            


            
            
//________________    Exclude list    ________________

GF_SCL_east_Exclude_List = [

    //    Ravage zombies
    "zombie_bolter",
    "zombie_runner",
    "zombie_walker",
    
    "B_Pilot_F",
    "B_Fighter_Pilot_F",
    "B_Helipilot_F",
    "B_helicrew_F",
    "B_soldier_PG_F",
    
    "O_Pilot_F",
    "O_Fighter_Pilot_F",
    "O_helipilot_F",
    "O_helicrew_F",
    "O_soldier_PG_F",
    
    "I_pilot_F",
    "I_Fighter_Pilot_F",
    "I_helipilot_F",
    "I_helicrew_F"
    ];             

    
//________________    Exclude list for Medic , AT etc     ________________
/*
In order to exclude from changing their special Gear , as bagpacks or , AT  , mines , etc
To get automatically the classnames , you can add the units in the editor , link them all togethere 
and add this code in the init of the leader unit.
grpclasses = []; {hint format["%1",(typeOf  _x)]; grpclasses = grpclasses + [(typeOf _x)]; sleep 1} foreach units group this; copyToClipboard format["%1",grpclasses];
*/


GF_SCL_east_Exclude_List_Gear = [
    
    "B_support_AMG_F",
    
    ];     

    
                
GF_SCL_east = {

    
//________________ Settings ________________
//________________ Set true or false  ________________
    
_Exclude_List_Gear                    = true;     //    exclude from changing their special Gear , as bagpacks or , AT  , mines , etc
    
//________________ Clear Unit's items ________________

_Remove_Everything                     = true;    //    If true  Remove Everything    
    
//________________ or filter ________________

_removeallweapons                     = true;    //    It' s better not in order to keep the certain classes of medics , AT etc
     
_Remove_primaryWeapon                 = true; 
_Remove_secondaryWeapon                = true;        
_Remove_handgunWeapon                 = true; 
    
_removeAllItems                     = true;     
_clear_UniformContainer             = true;     
_clear_VestContainer                 = true; 
_clear_BackpackContainer             = true;    
_removeAllAssignedItems             = true; 

_removeUniform                         = true;     
_removeVest                         = true;     
_removeBackpack                     = true;     
_removeHeadgear                     = true; 
_removeGoggles                         = true; 

//________________ _add ________________

_Link_Items                            = true;         

_AddUniform                            = true;             
_addVest                            = true;        
_addBackpack                        = true;           
_addHeadgear                        = true; 
_addGoggles                            = true; 

_Add_primaryWeapon                    = true; 
_Add_primaryWeapon_Attachments        = true; 

_Add_secondaryWeapon                = true; 
_Add_secondaryWeapon_Attachments    = true; 

_Add_handgunWeapon                    = true;         
_Add_handgunWeapon_Attachments        = true;     

_addItemToUniform                    = true;  
_addItemToVest                        = true; 
_addItemToBackpack                    = true;         

_Magazines_in_Backpack                = true; 

_addItems_for_Ravage_mod            = true;
_addItems_for_ACE3_mod                = true;


_Add_Rarity                            = floor (random 10) < 4;    
_Random_Amount                         = round (1 + random 2);

_Change_Loadout_on_Respawn            = true; 


//________________    _Change_Loadout_on_Respawn    ________________    

if (_Change_Loadout_on_Respawn) then {

_this addEventHandler ["Respawn", {
    params ["_unit", "_corpse"];
    _unit setVariable ["Var_GF_SCL_east",false];
}];
};


//________________    Randomize    ________________

_Uniform = selectRandom GF_SCL_east_Uniform_array;    //    For Civilian : GF_SCL_east_Civilian_Uniform_Custom_array
_Headgear = selectRandom GF_SCL_east_Headgear_array; 
_Goggles = selectRandom GF_SCL_east_Goggles_array; 
_Vests = selectRandom GF_SCL_east_Vests_array; 
_Backpacks = selectRandom GF_SCL_east_Backpacks_array;
_primaryWeapon = selectRandom GF_SCL_east_primaryWeapon_array;
_secondaryWeapon = selectRandom GF_SCL_east_secondaryWeapon_array;
_handgunWeapon = selectRandom GF_SCL_east_handgunWeapon_array;


//________________ addItemToVest    ________________

_items_array_1_addtoVest = selectRandom GF_SCL_east_items_array_1;
_items_array_2_addtoVest = selectRandom GF_SCL_east_items_array_2;
_items_array_3_addtoVest = selectRandom GF_SCL_east_items_array_3;
_Ravage_items_array_addtoVest = selectRandom GF_SCL_east_Ravage_items_array;
_ACE3_mod_Medical_array_addtoVest = selectRandom GF_SCL_east_ACE3_mod_Medical_array;
_ACE3_mod_items_array_addtoVest = selectRandom GF_SCL_east_ACE3_mod_items_array;

//________________ addItemToBackpack    ________________

_items_array_1_addtoBackpack = selectRandom GF_SCL_east_items_array_1;
_items_array_2_addtoBackpack = selectRandom GF_SCL_east_items_array_2;
_items_array_3_addtoBackpack = selectRandom GF_SCL_east_items_array_3;
_Ravage_items_array_addtoBackpack = selectRandom GF_SCL_east_Ravage_items_array;
_ACE3_mod_Medical_array_addtoBackpack = selectRandom GF_SCL_east_ACE3_mod_Medical_array;
_ACE3_mod_items_array_addtoBackpack = selectRandom GF_SCL_east_ACE3_mod_items_array;

//________________    add _primaryWeapon's mags    ________________

_primaryWeapon_Magazines = getArray (configFile / "CfgWeapons" / _primaryWeapon / "magazines");
_Spawn_primaryWeapon_magazines = selectRandom _primaryWeapon_Magazines; 

//________________    add _secondaryWeapon's mags    ________________

_secondaryWeapon_Magazines = getArray (configFile / "CfgWeapons" / _secondaryWeapon / "magazines");
_Spawn_secondaryWeapon_Magazines = selectRandom _secondaryWeapon_Magazines; 


//________________    add _handgunWeapon's mags    ________________

_handgunWeapon_Magazines = getArray (configFile / "CfgWeapons" / _handgunWeapon / "magazines");
_Spawn_handgunWeapon_Magazines = selectRandom _handgunWeapon_Magazines; 


//________________    _Spawn_Magazines    ________________

_Magazines = _primaryWeapon_Magazines + _secondaryWeapon_Magazines + _handgunWeapon_Magazines;
_Spawn_Magazines = selectRandom _Magazines;        


    
_UniformContainer =  UniformContainer _this;
_VestContainer = vestContainer _this;
_BackpackContainer = BackpackContainer _this;


//________________ Clear Unit's items ________________
//________________ Remove_Everything ________________

if (_Remove_Everything) then {

    removeallweapons _this;
    removeAllItems _this;
    removeAllAssignedItems _this;
    removeUniform _this;
    removeVest _this;
    removeBackpack _this;
    removeHeadgear _this;
    removeGoggles _this;    
};


//________________ or ________________

if (_removeallweapons) then {
        
    if (_Exclude_List_Gear) then {
    if (!((typeOf _this) in GF_SCL_east_Exclude_List_Gear)) then {
    removeallweapons _this;
    };
    
    } else {
    removeallweapons _this;
    };
};

if (_Remove_primaryWeapon) then {
    _this removeWeapon (primaryWeapon _this);
};

if (_Remove_secondaryWeapon) then {

    if (_Exclude_List_Gear) then {
    if (!((typeOf _this) in GF_SCL_east_Exclude_List_Gear)) then {
    _this removeWeapon (secondaryWeapon _this);
    };
    
    } else {
    _this removeWeapon (secondaryWeapon _this);
    };
};

if (_Remove_handgunWeapon) then {
    _this removeWeapon (handgunWeapon _this);
};

if (_removeAllItems) then {
    removeAllItems _this;
};

if (_clear_UniformContainer) then {
    clearMagazineCargoGlobal _UniformContainer;
    clearItemCargoGlobal _UniformContainer;
};

if (_clear_VestContainer) then {
    clearMagazineCargoGlobal _VestContainer;
    clearItemCargoGlobal _VestContainer;
};

if (_clear_BackpackContainer) then {

    if (_Exclude_List_Gear) then {
    if (!((typeOf _this) in GF_SCL_east_Exclude_List_Gear)) then {
    clearMagazineCargoGlobal _BackpackContainer;
    clearItemCargoGlobal _BackpackContainer;
    };
    
    } else {
    clearMagazineCargoGlobal _BackpackContainer;
    clearItemCargoGlobal _BackpackContainer;
    };
};

if (_removeAllAssignedItems) then {
    removeAllAssignedItems _this;
};

if (_removeUniform) then {
    removeUniform _this;
};

if (_removeVest) then {
    removeVest _this;
};

if (_removeBackpack) then {

    if (_Exclude_List_Gear) then {
    if (!((typeOf _this) in GF_SCL_east_Exclude_List_Gear)) then {
    removeBackpack _this;
    };
    
    } else {
    removeBackpack _this;
    };
};

if (_removeHeadgear) then {
    removeHeadgear _this;
};

if (_removeGoggles) then {
    removeGoggles _this;
};


//________________    Link items to their inventory    ________________            

if (_Link_Items) then {
                                            
    //    link an item
    //    _this linkItem "ItemMap";        
            
    //    or _Add_Rarity 
    if (_Add_Rarity) then {_this linkItem "ItemMap"};
    if (_Add_Rarity) then {_this linkItem "ItemCompass"};
    if (_Add_Rarity) then {_this linkItem "ItemWatch"};
    if (_Add_Rarity) then {_this linkItem "ItemRadio"};
    if (_Add_Rarity) then {_this linkItem "ItemGPS"};
    if (_Add_Rarity) then {_this linkItem "O_UavTerminal"};
    if (_Add_Rarity) then {_this linkItem "NVGoggles_OPFOR"};
};             


//________________    _AddUniform    ________________

if (_AddUniform) then {

_this forceAddUniform _Uniform;
};


//________________ _addVest ________________

if (_addVest) then {
            
_this addVest _Vests;            
};


//________________ _addBackpack ________________

if (_addBackpack) then {            

if (_Exclude_List_Gear) then {
    if (!((typeOf _this) in GF_SCL_east_Exclude_List_Gear)) then {            
    //_this addBackpack _Backpacks;    
    //    add rarity 
    if (_Add_Rarity) then {_this addBackpack _Backpacks;};    
    };
    
    } else {
    if (_Add_Rarity) then {_this addBackpack _Backpacks;};
    };
};


//________________ addHeadgear ________________

if (_addHeadgear) then {            
            
_this addHeadgear _Headgear;                                        
};


//________________ _addGoggles ________________

if (_addGoggles) then {            
            
_this addGoggles _Goggles;                    
};


//________________    add _primaryWeapon    ________________

if (_Add_primaryWeapon) then {            
    
_this addWeapon _primaryWeapon;
};


//________________    addPrimaryWeaponItem    ________________    

if (_Add_primaryWeapon_Attachments) then {

//________________    add _primaryWeapon's compatible attachments    ________________

_primaryWeapon_MuzzleSlot = getArray (configFile / "CfgWeapons" >> _primaryWeapon >> "WeaponSlotsInfo" >> "MuzzleSlot" >> "compatibleItems");
if (count _primaryWeapon_MuzzleSlot >= 1) then {_primaryWeapon_Muzzle = selectRandom _primaryWeapon_MuzzleSlot;
if (_Add_Rarity) then {_this addPrimaryWeaponItem _primaryWeapon_Muzzle;};}; 

_primaryWeapon_CowsSlot = getArray (configFile / "CfgWeapons" >> _primaryWeapon >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems");
if (count _primaryWeapon_CowsSlot >= 1) then {_primaryWeapon_Optic = selectRandom _primaryWeapon_CowsSlot;
if (_Add_Rarity) then {_this addPrimaryWeaponItem _primaryWeapon_Optic;};}; 

_primaryWeapon_PointerSlot = getArray (configFile / "CfgWeapons" >> _primaryWeapon >> "WeaponSlotsInfo" >> "PointerSlot" >> "compatibleItems");
if (count _primaryWeapon_PointerSlot >= 1) then {_primaryWeapon_Pointer = selectRandom _primaryWeapon_PointerSlot;
if (_Add_Rarity) then {_this addPrimaryWeaponItem _primaryWeapon_Pointer;};}; 

_primaryWeapon_UnderBarrelSlot = getArray (configFile / "CfgWeapons" >> _primaryWeapon >> "WeaponSlotsInfo" >> "UnderBarrelSlot" >> "compatibleItems");
if (count _primaryWeapon_UnderBarrelSlot >= 1) then {_primaryWeapon_UnderBarrel = selectRandom _primaryWeapon_UnderBarrelSlot;
if (_Add_Rarity) then {_this addPrimaryWeaponItem _primaryWeapon_UnderBarrel;};}; 
};


//________________    _Add_secondaryWeapon    ________________

if (_Add_secondaryWeapon) then {            

if (_Exclude_List_Gear) then {
    if (!((typeOf _this) in GF_SCL_east_Exclude_List_Gear)) then {    

    //    add rarity 
    if (_Add_Rarity) then {
    
    _has_Backpack = backpack _this;
    if (_has_Backpack isequalto [])  then {
    _this addBackpack _Backpacks;
    };
    _this addWeapon _secondaryWeapon;
    for "_i" from 0 to 3 do {_this addItemToBackpack _Spawn_secondaryWeapon_Magazines;};
    };    
    };
    } else {
    
    _has_Backpack = backpack _this;
    if (_has_Backpack isequalto [])  then {
    _this addBackpack _Backpacks;
    };
    _this addWeapon _secondaryWeapon;
    for "_i" from 0 to 3 do {_this addItemToBackpack _Spawn_secondaryWeapon_Magazines;};
    };
};


//________________    addSecondaryWeaponItem    ________________    

if (_Add_secondaryWeapon_Attachments) then {

//________________    add _secondaryWeapon 's compatible attachments    ________________

_secondaryWeapon_CowsSlot = getArray (configFile / "CfgWeapons" >> _secondaryWeapon >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems");
if (count _secondaryWeapon_CowsSlot >= 1) then {_secondaryWeapon_Optic = selectRandom _secondaryWeapon_CowsSlot;
if (_Add_Rarity) then {_this addSecondaryWeaponItem _secondaryWeapon_Optic;};}; 

_secondaryWeapon_PointerSlot = getArray (configFile / "CfgWeapons" >> _secondaryWeapon >> "WeaponSlotsInfo" >> "PointerSlot" >> "compatibleItems");
if (count _secondaryWeapon_PointerSlot >= 1) then {_secondaryWeapon_Pointer = selectRandom _secondaryWeapon_PointerSlot;
if (_Add_Rarity) then {_this addSecondaryWeaponItem _secondaryWeapon_Pointer;};}; 
};

//________________    add _handgunWeapon    ________________

if (_Add_handgunWeapon) then {

_this addWeapon _handgunWeapon; 
};


//________________    addHandgunItem    ________________

if (_Add_handgunWeapon_Attachments) then {

//________________    add _handgunWeapon's compatible attachments    ________________

_handgunWeapon_MuzzleSlot = getArray (configFile / "CfgWeapons" >> _handgunWeapon >> "WeaponSlotsInfo" >> "MuzzleSlot" >> "compatibleItems");
if (count _handgunWeapon_MuzzleSlot >= 1) then {_handgunWeapon_Muzzle = selectRandom _handgunWeapon_MuzzleSlot;
if (_Add_Rarity) then {_this addHandgunItem _handgunWeapon_Muzzle;};}; 

_handgunWeapon_CowsSlot = getArray (configFile / "CfgWeapons" >> _handgunWeapon >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems");
if (count _handgunWeapon_CowsSlot >= 1) then {_handgunWeapon_Optic = selectRandom _handgunWeapon_CowsSlot;
if (_Add_Rarity) then {_this addHandgunItem _handgunWeapon_Optic;};}; 

_handgunWeapon_PointerSlot = getArray (configFile / "CfgWeapons" >> _handgunWeapon >> "WeaponSlotsInfo" >> "PointerSlot" >> "compatibleItems");
if (count _handgunWeapon_PointerSlot >= 1) then {_handgunWeapon_Pointer = selectRandom _handgunWeapon_PointerSlot;
if (_Add_Rarity) then {_this addHandgunItem _handgunWeapon_Pointer;};}; 
};


//________________    addItemToUniform    ________________

if (_addItemToUniform) then {

for "_i" from 1 to 1 do {_this addItemToUniform "FirstAidKit";};
for "_i" from 1 to 2 do {_this addItemToUniform _Spawn_handgunWeapon_Magazines;};
};


//________________    addItemToVest    ________________

if (_addItemToVest) then {

for "_i" from 1 to 6 do {_this addItemToVest _Spawn_primaryWeapon_magazines;};
for "_i" from 1 to 1 do {_this addItemToVest "FirstAidKit";};
for "_i" from 1 to 1 do {_this addItemToVest "HandGrenade";};
for "_i" from 1 to 1 do {_this addItemToVest "MiniGrenade";};
for "_i" from 1 to 1 do {_this addItemToVest "SmokeShell";};

if (_Add_Rarity) then {_this addItemToVest _items_array_1_addtoVest;};
if (_Add_Rarity) then {_this addItemToVest _items_array_2_addtoVest;};
if (_Add_Rarity) then {_this addItemToVest _items_array_3_addtoVest;};

if (_addItems_for_Ravage_mod) then {
if (_Add_Rarity) then {_this addItemToVest _Ravage_items_array_addtoVest;};
};

if (_addItems_for_ACE3_mod) then {
if (_Add_Rarity) then {_this addItemToVest _ACE3_mod_Medical_array_addtoVest;};
if (_Add_Rarity) then {_this addItemToVest _ACE3_mod_items_array_addtoVest;};
};

//________________    vestContainer    ________________
if (_Add_Rarity) then {_VestContainer addItemCargoGlobal [_items_array_3_addtoVest, _Random_Amount];};

if (_addItems_for_Ravage_mod) then {
if (_Add_Rarity) then {_VestContainer addItemCargoGlobal [_Ravage_items_array_addtoVest, _Random_Amount];};
};

if (_addItems_for_ACE3_mod) then {
if (_Add_Rarity) then {_VestContainer addItemCargoGlobal [_ACE3_mod_Medical_array_addtoVest, _Random_Amount];};
if (_Add_Rarity) then {_VestContainer addItemCargoGlobal [_ACE3_mod_items_array_addtoVest, _Random_Amount];};
};
};


//________________    addItemToBackpack    ________________

if (_addItemToBackpack) then {

if (_Add_Rarity) then {_this addItemToBackpack _items_array_1_addtoBackpack;};
if (_Add_Rarity) then {_this addItemToBackpack _items_array_2_addtoBackpack;};
if (_Add_Rarity) then {_this addItemToBackpack _items_array_3_addtoBackpack;};

if (_addItems_for_Ravage_mod) then {
if (_Add_Rarity) then {_this addItemToBackpack _Ravage_items_array_addtoBackpack;};
};

if (_addItems_for_ACE3_mod) then {
if (_Add_Rarity) then {_this addItemToBackpack _ACE3_mod_Medical_array_addtoBackpack;};
if (_Add_Rarity) then {_this addItemToBackpack _ACE3_mod_items_array_addtoBackpack;};
};

if (_Add_Rarity) then {_BackpackContainer addItemCargoGlobal [_items_array_3_addtoBackpack, _Random_Amount];};

if (_addItems_for_Ravage_mod) then {
if (_Add_Rarity) then {_BackpackContainer addItemCargoGlobal [_Ravage_items_array_addtoBackpack, _Random_Amount];};
};

if (_addItems_for_ACE3_mod) then {
if (_Add_Rarity) then {_BackpackContainer addItemCargoGlobal [_ACE3_mod_Medical_array_addtoBackpack, _Random_Amount];};
if (_Add_Rarity) then {_BackpackContainer addItemCargoGlobal [_ACE3_mod_items_array_addtoBackpack, _Random_Amount];};
};
};


//________________    _Magazines_in_Backpack    ________________    

if (_Magazines_in_Backpack) then {    

_BackpackContainer    = BackpackContainer _this;
//________________    _Spawn_Magazines    ________________
_BackpackContainer addMagazineCargoGlobal [_Spawn_Magazines, _Random_Amount];    
};    


//________________    reload handgunWeapon    ________________

_this selectweapon handgunWeapon _this;
sleep 3;
reload _this;
sleep 8; 

//________________    reload primaryWeapon    ________________

_this selectweapon primaryWeapon _this;
sleep 3;
reload _this;
sleep 8;

//________________    reload secondaryWeapon    ________________

_this selectweapon secondaryWeapon _this;
sleep 3;
reload _this;

};
//________________    *** End ***     ________________    
    


//________________    This are extra    ________________


GF_SCL_east_Change_Equipment_civilian = {

removeAllWeapons _this;
removeAllItems _this;
removeAllAssignedItems _this;
removeUniform _this;
removeVest _this;
removeBackpack _this;
removeHeadgear _this;
removeGoggles _this;

//________________    Randomize    ________________

_Uniform = selectRandom GF_SCL_east_Civilian_Uniform_Custom_array;    //    GF_SCL_east_Uniform_array;
_Headgear = selectRandom GF_SCL_east_Headgear_array; 
_Goggles = selectRandom GF_SCL_east_Goggles_array; 
_Vests = selectRandom GF_SCL_east_Vests_array; 
_Backpacks = selectRandom GF_SCL_east_Backpacks_array;

_this forceAddUniform _Uniform;
_this addHeadgear _Headgear;
_this addGoggles _Goggles;

//    add rarity 
if (floor (random 10) < 4) then {_this addVest _Vests;};
if (floor (random 10) < 3) then {_this addBackpack _Backpacks;};
};


//________________    Informations about exlude or spawn    ________________     
/*
In order to exlude or spawn , you can do it with many ways:

1.    You can  write the classnames in the Exclude lists ,

2.    you can add in the init of the unit :
    this setVariable ["Var_GF_SCL_east", true];

3.    you can also spawn this for a certain unit :
    name this unit  ex : GF_SCL_east_1
    GF_SCL_east_1 spawn GF_SCL_east;
 
4.     you can also spawn this for a certain unit in the Editor :
    add this in the init of a unit :
    null = this execVM "GF_SCL_east\GF_SCL_east.sqf";

    and add instead of the spawn code in the end :
    _this spawn GF_SCL_east;
    
5.    only for player : 
    player spawn GF_SCL_east;
    
6.    for everyone : 
    null = {_x spawn GF_SCL_east_Spawn_Custom_Equipment;}forEach allUnits;
*/
//________________    End    ________________     

[] spawn {
    while {true} do {        
        {        
        if (
        ((alive _x)) 
        && (!(_x getVariable ["Var_GF_SCL_east",false])) 
        && (!((typeOf _x) in GF_SCL_east_Exclude_List)) 
        
        /*
        //________________    You can filter the side here    ________________    
        && {((side group _x) == west || 
            (side group _x) == east || 
            (side group _x) == independent || 
            (side group _x) == civilian)}
        */
                        
        //    && (side group _x == playerSide)
        //    && (!(side group _x == playerSide))
        
        && (side group _x == east)
        
        ) then {
            
            _x spawn GF_SCL_east;
            
            };                        
            _x setVariable ["Var_GF_SCL_east",true];
            {waitUntil {!alive _x};
            _x setVariable ["Var_GF_SCL_east",false];         
            };
        }forEach allUnits;
        sleep 5;
    };
};        


diag_log "//________________    GF Set Custom Loadout Script Initialized    _____________";
systemchat "GF Set Custom Loadout Script Initialized";

 

 

 

Share this post


Link to post
Share on other sites
1 hour ago, CHICKENLICKEN said:

just

 

First of all when you are posting codes , you should click first the button above "<>" and write your code as :

<code>

and if it's that much as my script , then you should definitely add the code in a spoiler , as :

Spoiler

<code>

 

You need to pay attention on the syntax of the code , because you have a lot of script errors .

 

On 5/10/2018 at 1:50 AM, GEORGE FLOROS GR said:

https://community.bistudio.com/wiki/SQF_syntax
Don't try to open this with the simple notepad.

For everything that is with comment // in front or between /*
means that it is disabled , so there is no need to delete the extra lines.

You can open this ex:
with notepad++
https://notepad-plus-plus.org/

 

Spoiler
1 hour ago, CHICKENLICKEN said:

GF_SCL_east_primaryWeapon_array = [
    
];
            
GF_SCL_east_handgunWeapon_array = [
//    Pistols

"hgun_Rook40_F",

            
        

GF_SCL_east_Uniform_array = [

"V_EOD_olive_F"            
]; 


GF_SCL_east_Backpacks_array = [

];  

            
GF_SCL_east_Headgear_array = [

"H_Cap_police"
];


GF_SCL_east_Goggles_array = [

];
            
            
GF_SCL_east_items_array_1 = [
//for RyanZombies
//"RyanZombiesAntiVirusTemporary_Item",
//"RyanZombiesAntiVirusCure_Item",

//Vanilla            
"ToolKit",
"MediKit",
"FirstAidKit",
"FirstAidKit",             

//    Tools
"Binocular",
"Rangefinder",            
"Laserdesignator",
"Laserdesignator_02",
"Laserdesignator_03",
"MineDetector"
];
    
    
GF_SCL_east_items_array_2 = [
//Here ONLY :items , PointerAttachments , BipodAttachments , MuzzleAttachments , OpticAttachments , NVG
"ItemCompass",
"ItemWatch",
"ItemRadio",
"ItemGPS",
"ItemMap",

//    x2
"ItemCompass",
"ItemWatch",
"ItemRadio",
"ItemGPS",
"ItemMap",

//    PointerAttachments
"acc_flashlight",
"acc_pointer_IR",

//    BipodAttachments
"bipod_01_F_blk",
"bipod_01_F_mtp",
"bipod_01_F_snd",
"bipod_02_F_blk",
"bipod_02_F_hex",
"bipod_02_F_tan",
"bipod_03_F_blk",
"bipod_03_F_oli",

//    Apex
"bipod_01_F_khk",

//    MuzzleAttachments


//    Apex

//    NVG

];

    
GF_SCL_east_items_array_3 = [
//    Flares
"Chemlight_blue",
"Chemlight_green",
"Chemlight_red",

//    Smokes


//    Explosives

];
            

GF_SCL_east_Ravage_items_array = [        
//    Ravage_items
//    x1
"rvg_plasticBottleEmpty",
"rvg_canteenEmpty",
"rvg_hose",
"rvg_sleepingBag_Blue", 
"rvg_foldedTent",
"rvg_rustyCan",
"rvg_Geiger",
"rvg_canisterFuel_Empty",
"rvg_toolkit",
"rvg_tire",

//    Vital            
"rvg_money", 
"rvg_notepad", 
"rvg_docFolder",
"rvg_canOpener",
"rvg_guttingKnife", 
"rvg_matches",
"rvg_plasticBottle",
"rvg_plasticBottlePurified", 
"rvg_spirit", 
"rvg_franta",
"rvg_beans", 
"rvg_bacon", 
"rvg_milk", 
"rvg_rice",
"rvg_antiRad",
"rvg_purificationTablets",                        

//x2 Vital
"rvg_money", 
"rvg_notepad", 
"rvg_docFolder",
"rvg_canOpener",
"rvg_guttingKnife", 
"rvg_matches",
"rvg_plasticBottle",
"rvg_plasticBottlePurified", 
"rvg_spirit", 
"rvg_franta",
"rvg_beans", 
"rvg_bacon", 
"rvg_milk", 
"rvg_rice",
"rvg_antiRad",
"rvg_purificationTablets",

//    Mask
"Mask_M40_OD",
"Mask_M40",
"Mask_M50"
];
            


            
            
//________________    Exclude list    ________________

GF_SCL_east_Exclude_List = [

    //    Ravage zombies
    "zombie_bolter",
    "zombie_runner",
    "zombie_walker",
    
    "B_Pilot_F",
    "B_Fighter_Pilot_F",
    "B_Helipilot_F",
    "B_helicrew_F",
    "B_soldier_PG_F",
    
    "O_Pilot_F",
    "O_Fighter_Pilot_F",
    "O_helipilot_F",
    "O_helicrew_F",
    "O_soldier_PG_F",
    
    "I_pilot_F",
    "I_Fighter_Pilot_F",
    "I_helipilot_F",
    "I_helicrew_F"
    ];             

    
//________________    Exclude list for Medic , AT etc     ________________
/*
In order to exclude from changing their special Gear , as bagpacks or , AT  , mines , etc
To get automatically the classnames , you can add the units in the editor , link them all togethere 
and add this code in the init of the leader unit.
grpclasses = []; {hint format["%1",(typeOf  _x)]; grpclasses = grpclasses + [(typeOf _x)]; sleep 1} foreach units group this; copyToClipboard format["%1",grpclasses];
*/


GF_SCL_east_Exclude_List_Gear = [
    
    "B_support_AMG_F",
    
    ];   

Try and if you don't make it , i will help you.

Share this post


Link to post
Share on other sites
10 minutes ago, CHICKENLICKEN said:

I have no clue.

 

Are you editing this script with an editor like poseidon or notepad ++ or anything ?

If so , you will understand the errors that you have done and also you can activate the "show error script" at the launcher.

 

The errors that you have in your edit , are so basic mistakes , that even if i correct your example above , you will still write them incorrect.

 

Check and read about the sqf syntax and it's prefered to open your scripts with a highlighting mode.

  • Like 1

Share this post


Link to post
Share on other sites
7 hours ago, CHICKENLICKEN said:

I have no clue.

 

Example :

_array_name = [
    
  "classname",
  "classname",
  "classname"		//	NO comma here
  ];  

 

This is your edit corrected :

Spoiler

GF_SCL_east_primaryWeapon_array = [
    
];
            
GF_SCL_east_handgunWeapon_array = [

//    Pistols

"hgun_Rook40_F"
]; 
            
        

GF_SCL_east_Uniform_array = [

"V_EOD_olive_F"            
]; 


GF_SCL_east_Backpacks_array = [

];  

            
GF_SCL_east_Headgear_array = [

"H_Cap_police"
];


GF_SCL_east_Goggles_array = [

];
            
            
GF_SCL_east_items_array_1 = [

//Vanilla            
"ToolKit",
"MediKit",
"FirstAidKit",
"FirstAidKit",             

//    Tools
"Binocular",
"Rangefinder",            
"Laserdesignator",
"Laserdesignator_02",
"Laserdesignator_03",
"MineDetector"
];
    
    
GF_SCL_east_items_array_2 = [
//Here ONLY :items , PointerAttachments , BipodAttachments , MuzzleAttachments , OpticAttachments , NVG
"ItemCompass",
"ItemWatch",
"ItemRadio",
"ItemGPS",
"ItemMap",

//    x2
"ItemCompass",
"ItemWatch",
"ItemRadio",
"ItemGPS",
"ItemMap",

//    PointerAttachments
"acc_flashlight",
"acc_pointer_IR",

//    BipodAttachments
"bipod_01_F_blk",
"bipod_01_F_mtp",
"bipod_01_F_snd",
"bipod_02_F_blk",
"bipod_02_F_hex",
"bipod_02_F_tan",
"bipod_03_F_blk",
"bipod_03_F_oli",

//    Apex
"bipod_01_F_khk"
];

    
GF_SCL_east_items_array_3 = [
//    Flares
"Chemlight_blue",
"Chemlight_green",
"Chemlight_red"
];
            

GF_SCL_east_Ravage_items_array = [        
//    Ravage_items
//    x1
"rvg_plasticBottleEmpty",
"rvg_canteenEmpty",
"rvg_hose",
"rvg_sleepingBag_Blue", 
"rvg_foldedTent",
"rvg_rustyCan",
"rvg_Geiger",
"rvg_canisterFuel_Empty",
"rvg_toolkit",
"rvg_tire",

//    Vital            
"rvg_money", 
"rvg_notepad", 
"rvg_docFolder",
"rvg_canOpener",
"rvg_guttingKnife", 
"rvg_matches",
"rvg_plasticBottle",
"rvg_plasticBottlePurified", 
"rvg_spirit", 
"rvg_franta",
"rvg_beans", 
"rvg_bacon", 
"rvg_milk", 
"rvg_rice",
"rvg_antiRad",
"rvg_purificationTablets",                        

//x2 Vital
"rvg_money", 
"rvg_notepad", 
"rvg_docFolder",
"rvg_canOpener",
"rvg_guttingKnife", 
"rvg_matches",
"rvg_plasticBottle",
"rvg_plasticBottlePurified", 
"rvg_spirit", 
"rvg_franta",
"rvg_beans", 
"rvg_bacon", 
"rvg_milk", 
"rvg_rice",
"rvg_antiRad",
"rvg_purificationTablets",

//    Mask
"Mask_M40_OD",
"Mask_M40",
"Mask_M50"
];
            


            
            
//________________    Exclude list    ________________

GF_SCL_east_Exclude_List = [

    //    Ravage zombies
    "zombie_bolter",
    "zombie_runner",
    "zombie_walker",
    
    "B_Pilot_F",
    "B_Fighter_Pilot_F",
    "B_Helipilot_F",
    "B_helicrew_F",
    "B_soldier_PG_F",
    
    "O_Pilot_F",
    "O_Fighter_Pilot_F",
    "O_helipilot_F",
    "O_helicrew_F",
    "O_soldier_PG_F",
    
    "I_pilot_F",
    "I_Fighter_Pilot_F",
    "I_helipilot_F",
    "I_helicrew_F"
    ];             

    
//________________    Exclude list for Medic , AT etc     ________________
/*
In order to exclude from changing their special Gear , as bagpacks or , AT  , mines , etc
To get automatically the classnames , you can add the units in the editor , link them all togethere 
and add this code in the init of the leader unit.
grpclasses = []; {hint format["%1",(typeOf  _x)]; grpclasses = grpclasses + [(typeOf _x)]; sleep 1} foreach units group this; copyToClipboard format["%1",grpclasses];
*/


GF_SCL_east_Exclude_List_Gear = [
    
    "B_support_AMG_F"    
    ];  

 

 

Share this post


Link to post
Share on other sites

Still does not work.

 

I put just one copy of SQF in misison folder - allunits.sqf

 

Replaced code with the one you corrected above.

 

 

Ran from SQF

 

 

No change.

Share this post


Link to post
Share on other sites
13 hours ago, CHICKENLICKEN said:

Still does not work.

 

I put just one copy of SQF in misison folder - allunits.sqf

 

Replaced code with the one you corrected above.

 

 

Ran from SQF

 

 

No change.

 

Really ! 

just add here the list of the classnames that you want , in order to fix this for you.

Share this post


Link to post
Share on other sites
On 1/8/2019 at 11:44 AM, GEORGE FLOROS GR said:

 

Really ! 

just add here the list of the classnames that you want , in order to fix this for you.

I would appreciate that a lot.

 

Spoiler


this forceAddUniform "SE_Scavenger_Coat";

this addItemToUniform "CUP_8Rnd_9x18_Makarov_M";

this addItemToUniform "CSW_M870_8Rnd_buck";


this addVest "SE_Armored_Eastern_Tactical_Vest_Black";
this addItemToVest "FirstAidKit";
for "_i" from 1 to 2 do {this addItemToVest "CSW_M870_8Rnd_buck";};
for "_i" from 1 to 2 do {this addItemToVest "CSW_M870_8Rnd_slug";};
for "_i" from 1 to 2 do {this addItemToVest "CUP_8Rnd_9x18_MakarovSD_M";};
for "_i" from 1 to 2 do {this addItemToVest "GrenadeMolotovPSRUS";};


this addHeadgear "SE_Ushanka";


this addGoggles "SE_GP5";

 

 

Primary Weapon:
this addWeapon "CSW_M870";

this addPrimaryWeaponItem "CSW_M870_flashlight_normal";


comment "Add items";
this linkItem "SAN_Headlamp_v1";

So:

 

Uniform:

"SE_Scavenger_Coat";

 

Vest:

"SE_Armored_Eastern_Tactical_Vest_Black";

 

headgear:

"SE_Ushanka";

 

Goggles:

"SE_GP5";

 

Primary weapon:

"CSW_M870";

 

Primary attachment:

"CSW_M870_flashlight_normal";

 

:secondary

"CUP_hgun_Makarov";

 

And with the equipment/ammo in the spoiler in the vest.

 

Share this post


Link to post
Share on other sites
1 hour ago, CHICKENLICKEN said:

So:

 

Is this for every unit or for ex: only for the enemy ?

Share this post


Link to post
Share on other sites
24 minutes ago, GEORGE FLOROS GR said:

 

Is this for every unit or for ex: only for the enemy ?

Just for OPfor enemy! I'm using Ravage.

OPfor raiders.

thanks!

Share this post


Link to post
Share on other sites
26 minutes ago, CHICKENLICKEN said:

Just for OPfor enemy! I'm using Ravage.

 

Since it is like this let's move to the newest script here :

Because it will be easier to understand and also the GF Set Custom Loadout Script , is actually good to run multiple scripts.

Share this post


Link to post
Share on other sites

What do I do with the new script? As I wanted different loadout for Independent side too. Just thought I would see yours first.

Share this post


Link to post
Share on other sites
22 minutes ago, CHICKENLICKEN said:

As I wanted different loadout for Independent side too.

 

Here is the code .

Check it & tell me :

Spoiler




//________________  Author : GEORGE FLOROS [GR] ___________ 15.12.18 _____________

/*
________________ GF Set Custom Loadout Script ________________

https://forums.bohemia.net/forums/topic/219669-gf-set-custom-loadout-script/

Please keep the Credits or add them to your Diary

https://community.bistudio.com/wiki/SQF_syntax
Don't try to open this with the simple notepad.
For everything that is with comment  //  in front  or between /*
means that it is disabled , so there is no need to delete the extra lines.

You can open this ex:
with notepad++
https://notepad-plus-plus.org/

and also use the extra pluggins
(this way will be better , it will give also some certain colors to be able to detect ex. problems )
http://www.armaholic.com/page.php?id=8680

or use any other program for editing .

For the Compilation List of my GF Scripts , you can search in:
https://forums.bohemia.net/forums/topic/215850-compilation-list-of-my-gf-scripts/
*/


//________________	***	Every sqf has different variables	***	________________
//________________	You can add in the init of a unit to exclude 	________________	
//	this setVariable ["Var_GF_SCL_east", true];
	
	
diag_log "//________________	GF Set Custom Loadout Script Initializing	_____________";
diag_log "//________________	GF_SCL_east.sqf	_____________";

systemchat "GF Set Custom Loadout Script Initializing";


//________________ GF_SCL_east.sqf _____________


GF_SCL_east_primaryWeapon_array = [
"CSW_M870"
];
	

GF_SCL_east_secondaryWeapon_array = [

];
			
GF_SCL_east_handgunWeapon_array = [
"CUP_hgun_Makarov"
];
			
			
GF_SCL_east_Civilian_Uniform_Custom_array = [

];


GF_SCL_east_Uniform_array = [
"SE_Scavenger_Coat"
];

			
GF_SCL_east_Vests_array =  [
"SE_Armored_Eastern_Tactical_Vest_Black"
]; 


GF_SCL_east_Backpacks_array = [

];  

			
GF_SCL_east_Headgear_array = [
"SE_Ushanka"
];


GF_SCL_east_Goggles_array = [
"SE_GP5"
];
			
			
GF_SCL_east_items_array_1 = [
"FirstAidKit"
];
	
	
GF_SCL_east_items_array_2 = [
"CSW_M870_8Rnd_slug"
];

	
GF_SCL_east_items_array_3 = [
"GrenadeMolotovPSRUS"
];
			

GF_SCL_east_Ravage_items_array = [		
//	Ravage_items
//	x1
"rvg_plasticBottleEmpty",
"rvg_canteenEmpty",
"rvg_hose",
"rvg_sleepingBag_Blue", 
"rvg_foldedTent",
"rvg_rustyCan",
"rvg_Geiger",
"rvg_canisterFuel_Empty",
"rvg_toolkit",
"rvg_tire",

//	Vital			
"rvg_money", 
"rvg_notepad", 
"rvg_docFolder",
"rvg_canOpener",
"rvg_guttingKnife", 
"rvg_matches",
"rvg_plasticBottle",
"rvg_plasticBottlePurified", 
"rvg_spirit", 
"rvg_franta",
"rvg_beans", 
"rvg_bacon", 
"rvg_milk", 
"rvg_rice",
"rvg_antiRad",
"rvg_purificationTablets",						

//x2 Vital
"rvg_money", 
"rvg_notepad", 
"rvg_docFolder",
"rvg_canOpener",
"rvg_guttingKnife", 
"rvg_matches",
"rvg_plasticBottle",
"rvg_plasticBottlePurified", 
"rvg_spirit", 
"rvg_franta",
"rvg_beans", 
"rvg_bacon", 
"rvg_milk", 
"rvg_rice",
"rvg_antiRad",
"rvg_purificationTablets",

//	Mask
"Mask_M40_OD",
"Mask_M40",
"Mask_M50"
];
			
//	ACE3 Class Names
//	https://ace3mod.com/wiki/class-names.html
GF_SCL_east_ACE3_mod_Medical_array = [
"ACE_atropine",
"ACE_fieldDressing",
"ACE_elasticBandage",
"ACE_quikclot",
"ACE_bloodIV",
"ACE_bloodIV_500",
"ACE_bloodIV_250",
"ACE_bodyBag",
"ACE_bodyBagObject",
"ACE_epinephrine",
"ACE_morphine",
"ACE_packingBandage",
"ACE_personalAidKit",
"ACE_plasmaIV",
"ACE_plasmaIV_500",
"ACE_plasmaIV_250",
"ACE_salineIV",
"ACE_salineIV_500",
"ACE_salineIV_250",
"ACE_surgicalKit",
"ACE_tourniquet"
]; 


GF_SCL_east_ACE3_mod_items_array = [
//	AtragMX
"ACE_ATragMX",

//	Captive
"ACE_CableTie",

//	Chemlights
"ACE_Chemlight_HiOrange",
"ACE_Chemlight_HiRed",
"ACE_Chemlight_HiYellow",
"ACE_Chemlight_HiWhite",
"ACE_Chemlight_Orange",
"ACE_Chemlight_White",
"ACE_Chemlight_IR",

//	Common
"ACE_Banana",

//	Concertina Wire
"ACE_ConcertinaWireCoil",
"ACE_ConcertinaWire",

//	DAGR
"ACE_DAGR",

//	Explosives
"ACE_Cellphone",
"ACE_Clacker",
"ACE_M26_Clacker",
"ACE_DefusalKit",
"ACE_DeadManSwitch",

//	Flashlights
"ACE_Flashlight_MX991",
"ACE_Flashlight_KSF1",
"ACE_Flashlight_XL50",

//	Grenades
"ACE_HandFlare_White",
"ACE_HandFlare_Red",
"ACE_HandFlare_Green",
"ACE_HandFlare_Yellow",
"ACE_M14",
"ACE_M84",

//	Gun Bag
"ACE_gunbag",
"ACE_gunbag_Tan",

//	Hearing
"ACE_EarPlugs",

//	HuntIR
"ACE_HuntIR_monitor",
"ACE_HuntIR_M203",
"ACE_HuntIR_Box",

//	Kestrel
"ACE_Kestrel4500",

//	Laser Pointers
"acc_pointer_IR",
"ACE_acc_pointer_red",
"ACE_acc_pointer_green_IR",
"ACE_acc_pointer_green",

//	ACE_acc_pointer_green
"ACE_UAVBattery",
"ACE_wirecutter",			

//	Map Tools
"ACE_MapTools",

//	MicroDAGR
"ACE_microDAGR",

//	Mine Detector
"ACE_VMH3",
"ACE_VMM3",

//	MX2A	Binocular
"ACE_MX2A",

//	Nightvision
"ACE_NVG_Gen1",
"ACE_NVG_Gen2",
"ACE_NVG_Gen4",
"ACE_NVG_Wide",

//	Optics
"ACE_optic_Arco_2D",
"ACE_optic_Arco_PIP",
"ACE_optic_LRPS_2D",
"ACE_optic_LRPS_PIP",
"ACE_optic_SOS_2D",
"ACE_optic_SOS_PIP",
"ACE_optic_MRCO_2D",
"ACE_optic_MRCO_PIP",
"ACE_optic_Hamr_2D",
"ACE_optic_Hamr_PIP",

//	Rangecard
"ACE_RangeCard",

//	ACE_Track
"ACE_Track",
"ACE_Wheel",

//	Sandbag
"ACE_Sandbag_empty",
"ACE_SandbagObject",

//	Spotting Scope
"ACE_SpottingScope",
"ACE_SpottingScopeObject",

//	Tactical Ladder
"ACE_TacticalLadder_Pack",
//	"ACE_Tactical_Ladder",

//	ACE_Tactical_Ladder
"ACE_SpraypaintBlack",
"ACE_SpraypaintBlue",
"ACE_SpraypaintGreen",
"ACE_SpraypaintRed",

//	Trenches
"ACE_EntrenchingTool",

//	Tripod
"ACE_Tripod",
"ACE_TripodObject",

//	Vehicle Lock
"ACE_key_master",
"ACE_key_lockpick",
"ACE_key_west",
"ACE_key_east",
"ACE_key_indp",
"ACE_key_civ",

//	Vector
"ACE_Vector",
"ACE_VectorDay",

//	Yardage 450
"ACE_Yardage450"
]; 


			
			
//________________	Exclude list	________________

GF_SCL_east_Exclude_List = [

	//	Ravage zombies
	"zombie_bolter",
	"zombie_runner",
	"zombie_walker",
	
	"B_Pilot_F",
	"B_Fighter_Pilot_F",
	"B_Helipilot_F",
	"B_helicrew_F",
	"B_soldier_PG_F",
	
	"O_Pilot_F",
	"O_Fighter_Pilot_F",
	"O_helipilot_F",
	"O_helicrew_F",
	"O_soldier_PG_F",
	
	"I_pilot_F",
	"I_Fighter_Pilot_F",
	"I_helipilot_F",
	"I_helicrew_F"
	]; 			

	
//________________	Exclude list for Medic , AT etc 	________________
/*
In order to exclude from changing their special Gear , as bagpacks or , AT  , mines , etc
To get automatically the classnames , you can add the units in the editor , link them all togethere 
and add this code in the init of the leader unit.
grpclasses = []; {hint format["%1",(typeOf  _x)]; grpclasses = grpclasses + [(typeOf _x)]; sleep 1} foreach units group this; copyToClipboard format["%1",grpclasses];
*/


GF_SCL_east_Exclude_List_Gear = [
	
	"B_support_AMG_F",
	"B_support_AMort_F",
	"B_soldier_AAA_F",	
	"B_soldier_AAT_F",
	"B_engineer_F",
	"B_soldier_exp_F",
	"B_support_GMG_F",
	"B_support_MG_F",	
	"B_support_Mort_F",
	"B_soldier_mine_F",
	"B_soldier_AA_F",
	"B_soldier_AT_F",
	"B_soldier_LAT_F",	
	"B_soldier_LAT2_F",
	"B_soldier_UAV_F",
	"B_soldier_UAV_06_F",
	"B_soldier_UAV_06_medical_F",	
	"B_Patrol_Soldier_A_F",
	"B_Patrol_Medic_F",
	"B_Patrol_Engineer_F",	
	"B_Patrol_Soldier_AT_F",
	"B_Patrol_Soldier_UAV_F",
	"B_recon_exp_F",
	"B_recon_medic_F",
	"B_recon_LAT_F",
	"B_G_Soldier_A_F",	
	"B_G_medic_F",
	"B_G_engineer_F",
	"B_G_Soldier_exp_F",
	"B_G_Soldier_LAT_F",
	"B_G_Soldier_LAT2_F",
	
	"O_Soldier_A_F",
	"O_support_AMG_F",
	"O_support_AMort_F",
	"O_Soldier_AHAT_F",
	"O_Soldier_AAA_F",
	"O_Soldier_AAT_F",
	"O_medic_F",
	"O_engineer_F",
	"O_soldier_exp_F",
	"O_support_GMG_F",
	"O_support_MG_F",
	"O_support_Mort_F",
	"O_soldier_mine_F",
	"O_Soldier_AA_F",
	"O_Soldier_AT_F",
	"O_soldier_PG_F",
	"O_soldier_repair_F",
	"O_Soldier_LAT_F",
	"O_Soldier_HAT_F",
	"O_soldier_UAV_F",
	"O_soldier_UAV_06_F",
	"O_soldier_UAV_06_medical_F",
	"O_recon_exp_F",
	"O_recon_medic_F",
	"O_recon_LAT_F",
	"O_G_medic_F",
	"O_G_engineer_F",
	"O_G_Soldier_exp_F",
	"O_G_Soldier_LAT_F",
	"O_G_Soldier_LAT2_F",	
	
	"I_support_AMG_F",
	"I_support_AMort_F",
	"I_Soldier_AAA_F",
	"I_Soldier_AAT_F",
	"I_medic_F",
	"I_engineer_F",
	"I_Soldier_exp_F",
	"I_support_GMG_F",
	"I_support_MG_F",
	"I_support_Mort_F",
	"I_soldier_mine_F",
	"I_Soldier_AA_F",
	"I_Soldier_AT_F",
	"I_Soldier_repair_F",
	"I_Soldier_LAT_F",
	"I_Soldier_LAT2_F",
	"I_soldier_UAV_F",
	"I_soldier_UAV_06_F",
	"I_soldier_UAV_06_medical_F",
	"I_G_medic_F",
	"I_G_engineer_F",
	"I_G_Soldier_exp_F",
	"I_G_Soldier_LAT_F",
	"I_G_Soldier_LAT2_F"
	]; 	

	
				
GF_SCL_east = {

	
//________________ Settings ________________
//________________ Set true or false  ________________
	
_Exclude_List_Gear					= true; 	//	exclude from changing their special Gear , as bagpacks or , AT  , mines , etc
	
//________________ Clear Unit's items ________________

_Remove_Everything 					= false;	//	If true  Remove Everything	
	
//________________ or filter ________________

_removeallweapons 					= true;	//	It' s better not in order to keep the certain classes of medics , AT etc
 	
_Remove_primaryWeapon 				= true; 
_Remove_secondaryWeapon				= false;		
_Remove_handgunWeapon 				= true; 
	
_removeAllItems 					= true; 	
_clear_UniformContainer 			= true; 	
_clear_VestContainer 				= true; 
_clear_BackpackContainer 			= true;	
_removeAllAssignedItems 			= true; 

_removeUniform 						= true; 	
_removeVest 						= true; 	
_removeBackpack 					= true; 	
_removeHeadgear 					= true; 
_removeGoggles 						= true; 

//________________ _add ________________

_Link_Items							= true; 		

_AddUniform							= true;             
_addVest							= true;        
_addBackpack						= true;	       
_addHeadgear						= true; 
_addGoggles							= true; 

_Add_primaryWeapon					= true; 
_Add_primaryWeapon_Attachments		= true; 

_Add_secondaryWeapon				= true; 
_Add_secondaryWeapon_Attachments	= true; 

_Add_handgunWeapon					= true; 		
_Add_handgunWeapon_Attachments		= true; 	

_addItemToUniform					= true;  
_addItemToVest						= true; 
_addItemToBackpack					= true;         

_Magazines_in_Backpack				= true; 

_addItems_for_Ravage_mod			= true;
_addItems_for_ACE3_mod				= true;


_Add_Rarity							= floor (random 10) < 4;	
_Random_Amount 						= round (1 + random 2);

_Change_Loadout_on_Respawn			= true; 


//________________	_Change_Loadout_on_Respawn	________________	

if (_Change_Loadout_on_Respawn) then {

_this addEventHandler ["Respawn", {
	params ["_unit", "_corpse"];
	_unit setVariable ["Var_GF_SCL_east",false];
}];
};


//________________	Randomize	________________

_Uniform = selectRandom GF_SCL_east_Uniform_array;	//	For Civilian : GF_SCL_east_Civilian_Uniform_Custom_array
_Headgear = selectRandom GF_SCL_east_Headgear_array; 
_Goggles = selectRandom GF_SCL_east_Goggles_array; 
_Vests = selectRandom GF_SCL_east_Vests_array; 
_Backpacks = selectRandom GF_SCL_east_Backpacks_array;
_primaryWeapon = selectRandom GF_SCL_east_primaryWeapon_array;
_secondaryWeapon = selectRandom GF_SCL_east_secondaryWeapon_array;
_handgunWeapon = selectRandom GF_SCL_east_handgunWeapon_array;


//________________ addItemToVest	________________

_items_array_1_addtoVest = selectRandom GF_SCL_east_items_array_1;
_items_array_2_addtoVest = selectRandom GF_SCL_east_items_array_2;
_items_array_3_addtoVest = selectRandom GF_SCL_east_items_array_3;
_Ravage_items_array_addtoVest = selectRandom GF_SCL_east_Ravage_items_array;
_ACE3_mod_Medical_array_addtoVest = selectRandom GF_SCL_east_ACE3_mod_Medical_array;
_ACE3_mod_items_array_addtoVest = selectRandom GF_SCL_east_ACE3_mod_items_array;

//________________ addItemToBackpack	________________

_items_array_1_addtoBackpack = selectRandom GF_SCL_east_items_array_1;
_items_array_2_addtoBackpack = selectRandom GF_SCL_east_items_array_2;
_items_array_3_addtoBackpack = selectRandom GF_SCL_east_items_array_3;
_Ravage_items_array_addtoBackpack = selectRandom GF_SCL_east_Ravage_items_array;
_ACE3_mod_Medical_array_addtoBackpack = selectRandom GF_SCL_east_ACE3_mod_Medical_array;
_ACE3_mod_items_array_addtoBackpack = selectRandom GF_SCL_east_ACE3_mod_items_array;

//________________	add _primaryWeapon's mags	________________

_primaryWeapon_Magazines = getArray (configFile / "CfgWeapons" / _primaryWeapon / "magazines");
_Spawn_primaryWeapon_magazines = selectRandom _primaryWeapon_Magazines; 

//________________	add _secondaryWeapon's mags	________________

_secondaryWeapon_Magazines = getArray (configFile / "CfgWeapons" / _secondaryWeapon / "magazines");
_Spawn_secondaryWeapon_Magazines = selectRandom _secondaryWeapon_Magazines; 


//________________	add _handgunWeapon's mags	________________

_handgunWeapon_Magazines = getArray (configFile / "CfgWeapons" / _handgunWeapon / "magazines");
_Spawn_handgunWeapon_Magazines = selectRandom _handgunWeapon_Magazines; 


//________________	_Spawn_Magazines	________________

_Magazines = _primaryWeapon_Magazines + _secondaryWeapon_Magazines + _handgunWeapon_Magazines;
_Spawn_Magazines = selectRandom _Magazines;		


	
_UniformContainer =  UniformContainer _this;
_VestContainer = vestContainer _this;
_BackpackContainer = BackpackContainer _this;


//________________ Clear Unit's items ________________
//________________ Remove_Everything ________________

if (_Remove_Everything) then {

	removeallweapons _this;
	removeAllItems _this;
	removeAllAssignedItems _this;
	removeUniform _this;
	removeVest _this;
	removeBackpack _this;
	removeHeadgear _this;
	removeGoggles _this;	
};


//________________ or ________________

if (_removeallweapons) then {
		
	if (_Exclude_List_Gear) then {
	if (!((typeOf _this) in GF_SCL_east_Exclude_List_Gear)) then {
	removeallweapons _this;
	};
	
	} else {
	removeallweapons _this;
	};
};

if (_Remove_primaryWeapon) then {
	_this removeWeapon (primaryWeapon _this);
};

if (_Remove_secondaryWeapon) then {

	if (_Exclude_List_Gear) then {
	if (!((typeOf _this) in GF_SCL_east_Exclude_List_Gear)) then {
	_this removeWeapon (secondaryWeapon _this);
	};
	
	} else {
	_this removeWeapon (secondaryWeapon _this);
	};
};

if (_Remove_handgunWeapon) then {
	_this removeWeapon (handgunWeapon _this);
};

if (_removeAllItems) then {
	removeAllItems _this;
};

if (_clear_UniformContainer) then {
	clearMagazineCargoGlobal _UniformContainer;
	clearItemCargoGlobal _UniformContainer;
};

if (_clear_VestContainer) then {
	clearMagazineCargoGlobal _VestContainer;
	clearItemCargoGlobal _VestContainer;
};

if (_clear_BackpackContainer) then {

	if (_Exclude_List_Gear) then {
	if (!((typeOf _this) in GF_SCL_east_Exclude_List_Gear)) then {
	clearMagazineCargoGlobal _BackpackContainer;
	clearItemCargoGlobal _BackpackContainer;
	};
	
	} else {
	clearMagazineCargoGlobal _BackpackContainer;
	clearItemCargoGlobal _BackpackContainer;
	};
};

if (_removeAllAssignedItems) then {
	removeAllAssignedItems _this;
};

if (_removeUniform) then {
	removeUniform _this;
};

if (_removeVest) then {
	removeVest _this;
};

if (_removeBackpack) then {

	if (_Exclude_List_Gear) then {
	if (!((typeOf _this) in GF_SCL_east_Exclude_List_Gear)) then {
	removeBackpack _this;
	};
	
	} else {
	removeBackpack _this;
	};
};

if (_removeHeadgear) then {
	removeHeadgear _this;
};

if (_removeGoggles) then {
	removeGoggles _this;
};




//________________	Link items to their inventory	________________			

if (_Link_Items) then {
											
	//	link an item
	//	_this linkItem "ItemMap";		
			
	//	or _Add_Rarity 
	
	_this linkItem "SAN_Headlamp_v1";
	
	if (_Add_Rarity) then {_this linkItem "ItemMap"};
	if (_Add_Rarity) then {_this linkItem "ItemCompass"};
	if (_Add_Rarity) then {_this linkItem "ItemWatch"};
	if (_Add_Rarity) then {_this linkItem "ItemRadio"};
	if (_Add_Rarity) then {_this linkItem "ItemGPS"};
	if (_Add_Rarity) then {_this linkItem "O_UavTerminal"};
	if (_Add_Rarity) then {_this linkItem "NVGoggles_OPFOR"};
};			 


//________________	_AddUniform	________________

if (_AddUniform) then {

_this forceAddUniform _Uniform;
};


//________________ _addVest ________________

if (_addVest) then {
			
_this addVest _Vests;			
};


//________________ _addBackpack ________________

if (_addBackpack) then {			

if (_Exclude_List_Gear) then {
	if (!((typeOf _this) in GF_SCL_east_Exclude_List_Gear)) then {			
	//_this addBackpack _Backpacks;	
	//	add rarity 
	if (_Add_Rarity) then {_this addBackpack _Backpacks;};	
	};
	
	} else {
	if (_Add_Rarity) then {_this addBackpack _Backpacks;};
	};
};


//________________ addHeadgear ________________

if (_addHeadgear) then {			
			
_this addHeadgear _Headgear;										
};


//________________ _addGoggles ________________

if (_addGoggles) then {			
			
_this addGoggles _Goggles;					
};


//________________	add _primaryWeapon	________________

if (_Add_primaryWeapon) then {			
	
_this addWeapon _primaryWeapon;
};


//________________	addPrimaryWeaponItem	________________	

if (_Add_primaryWeapon_Attachments) then {

//________________	add _primaryWeapon's compatible attachments	________________

_primaryWeapon_MuzzleSlot = getArray (configFile / "CfgWeapons" >> _primaryWeapon >> "WeaponSlotsInfo" >> "MuzzleSlot" >> "compatibleItems");
if (count _primaryWeapon_MuzzleSlot >= 1) then {_primaryWeapon_Muzzle = selectRandom _primaryWeapon_MuzzleSlot;
if (_Add_Rarity) then {_this addPrimaryWeaponItem _primaryWeapon_Muzzle;};}; 

_primaryWeapon_CowsSlot = getArray (configFile / "CfgWeapons" >> _primaryWeapon >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems");
if (count _primaryWeapon_CowsSlot >= 1) then {_primaryWeapon_Optic = selectRandom _primaryWeapon_CowsSlot;
if (_Add_Rarity) then {_this addPrimaryWeaponItem _primaryWeapon_Optic;};}; 

_primaryWeapon_PointerSlot = getArray (configFile / "CfgWeapons" >> _primaryWeapon >> "WeaponSlotsInfo" >> "PointerSlot" >> "compatibleItems");
if (count _primaryWeapon_PointerSlot >= 1) then {_primaryWeapon_Pointer = selectRandom _primaryWeapon_PointerSlot;
if (_Add_Rarity) then {_this addPrimaryWeaponItem _primaryWeapon_Pointer;};}; 

_primaryWeapon_UnderBarrelSlot = getArray (configFile / "CfgWeapons" >> _primaryWeapon >> "WeaponSlotsInfo" >> "UnderBarrelSlot" >> "compatibleItems");
if (count _primaryWeapon_UnderBarrelSlot >= 1) then {_primaryWeapon_UnderBarrel = selectRandom _primaryWeapon_UnderBarrelSlot;
if (_Add_Rarity) then {_this addPrimaryWeaponItem _primaryWeapon_UnderBarrel;};}; 
};


//________________	_Add_secondaryWeapon	________________

if (_Add_secondaryWeapon) then {			

if (_Exclude_List_Gear) then {
	if (!((typeOf _this) in GF_SCL_east_Exclude_List_Gear)) then {	

	//	add rarity 
	if (_Add_Rarity) then {
	
	_has_Backpack = backpack _this;
	if (_has_Backpack isequalto [])  then {
	_this addBackpack _Backpacks;
	};
	_this addWeapon _secondaryWeapon;
	for "_i" from 0 to 3 do {_this addItemToBackpack _Spawn_secondaryWeapon_Magazines;};
	};	
	};
	} else {
	
	_has_Backpack = backpack _this;
	if (_has_Backpack isequalto [])  then {
	_this addBackpack _Backpacks;
	};
	_this addWeapon _secondaryWeapon;
	for "_i" from 0 to 3 do {_this addItemToBackpack _Spawn_secondaryWeapon_Magazines;};
	};
};


//________________	addSecondaryWeaponItem	________________	

if (_Add_secondaryWeapon_Attachments) then {

//________________	add _secondaryWeapon 's compatible attachments	________________

_secondaryWeapon_CowsSlot = getArray (configFile / "CfgWeapons" >> _secondaryWeapon >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems");
if (count _secondaryWeapon_CowsSlot >= 1) then {_secondaryWeapon_Optic = selectRandom _secondaryWeapon_CowsSlot;
if (_Add_Rarity) then {_this addSecondaryWeaponItem _secondaryWeapon_Optic;};}; 

_secondaryWeapon_PointerSlot = getArray (configFile / "CfgWeapons" >> _secondaryWeapon >> "WeaponSlotsInfo" >> "PointerSlot" >> "compatibleItems");
if (count _secondaryWeapon_PointerSlot >= 1) then {_secondaryWeapon_Pointer = selectRandom _secondaryWeapon_PointerSlot;
if (_Add_Rarity) then {_this addSecondaryWeaponItem _secondaryWeapon_Pointer;};}; 
};

//________________	add _handgunWeapon	________________

if (_Add_handgunWeapon) then {

_this addWeapon _handgunWeapon; 
};


//________________	addHandgunItem	________________

if (_Add_handgunWeapon_Attachments) then {

//________________	add _handgunWeapon's compatible attachments	________________

_handgunWeapon_MuzzleSlot = getArray (configFile / "CfgWeapons" >> _handgunWeapon >> "WeaponSlotsInfo" >> "MuzzleSlot" >> "compatibleItems");
if (count _handgunWeapon_MuzzleSlot >= 1) then {_handgunWeapon_Muzzle = selectRandom _handgunWeapon_MuzzleSlot;
if (_Add_Rarity) then {_this addHandgunItem _handgunWeapon_Muzzle;};}; 

_handgunWeapon_CowsSlot = getArray (configFile / "CfgWeapons" >> _handgunWeapon >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems");
if (count _handgunWeapon_CowsSlot >= 1) then {_handgunWeapon_Optic = selectRandom _handgunWeapon_CowsSlot;
if (_Add_Rarity) then {_this addHandgunItem _handgunWeapon_Optic;};}; 

_handgunWeapon_PointerSlot = getArray (configFile / "CfgWeapons" >> _handgunWeapon >> "WeaponSlotsInfo" >> "PointerSlot" >> "compatibleItems");
if (count _handgunWeapon_PointerSlot >= 1) then {_handgunWeapon_Pointer = selectRandom _handgunWeapon_PointerSlot;
if (_Add_Rarity) then {_this addHandgunItem _handgunWeapon_Pointer;};}; 
};


//________________	addItemToUniform	________________

if (_addItemToUniform) then {

for "_i" from 1 to 1 do {_this addItemToUniform "FirstAidKit";};
for "_i" from 1 to 2 do {_this addItemToUniform _Spawn_handgunWeapon_Magazines;};
};


//________________	addItemToVest	________________

if (_addItemToVest) then {

for "_i" from 1 to 6 do {_this addItemToVest _Spawn_primaryWeapon_magazines;};
for "_i" from 1 to 1 do {_this addItemToVest "FirstAidKit";};
for "_i" from 1 to 1 do {_this addItemToVest "HandGrenade";};
for "_i" from 1 to 1 do {_this addItemToVest "MiniGrenade";};
for "_i" from 1 to 1 do {_this addItemToVest "SmokeShell";};

if (_Add_Rarity) then {_this addItemToVest _items_array_1_addtoVest;};
if (_Add_Rarity) then {_this addItemToVest _items_array_2_addtoVest;};
if (_Add_Rarity) then {_this addItemToVest _items_array_3_addtoVest;};

if (_addItems_for_Ravage_mod) then {
if (_Add_Rarity) then {_this addItemToVest _Ravage_items_array_addtoVest;};
};

if (_addItems_for_ACE3_mod) then {
if (_Add_Rarity) then {_this addItemToVest _ACE3_mod_Medical_array_addtoVest;};
if (_Add_Rarity) then {_this addItemToVest _ACE3_mod_items_array_addtoVest;};
};

//________________	vestContainer	________________
if (_Add_Rarity) then {_VestContainer addItemCargoGlobal [_items_array_3_addtoVest, _Random_Amount];};

if (_addItems_for_Ravage_mod) then {
if (_Add_Rarity) then {_VestContainer addItemCargoGlobal [_Ravage_items_array_addtoVest, _Random_Amount];};
};

if (_addItems_for_ACE3_mod) then {
if (_Add_Rarity) then {_VestContainer addItemCargoGlobal [_ACE3_mod_Medical_array_addtoVest, _Random_Amount];};
if (_Add_Rarity) then {_VestContainer addItemCargoGlobal [_ACE3_mod_items_array_addtoVest, _Random_Amount];};
};
};


//________________	addItemToBackpack	________________

if (_addItemToBackpack) then {

if (_Add_Rarity) then {_this addItemToBackpack _items_array_1_addtoBackpack;};
if (_Add_Rarity) then {_this addItemToBackpack _items_array_2_addtoBackpack;};
if (_Add_Rarity) then {_this addItemToBackpack _items_array_3_addtoBackpack;};

if (_addItems_for_Ravage_mod) then {
if (_Add_Rarity) then {_this addItemToBackpack _Ravage_items_array_addtoBackpack;};
};

if (_addItems_for_ACE3_mod) then {
if (_Add_Rarity) then {_this addItemToBackpack _ACE3_mod_Medical_array_addtoBackpack;};
if (_Add_Rarity) then {_this addItemToBackpack _ACE3_mod_items_array_addtoBackpack;};
};

if (_Add_Rarity) then {_BackpackContainer addItemCargoGlobal [_items_array_3_addtoBackpack, _Random_Amount];};

if (_addItems_for_Ravage_mod) then {
if (_Add_Rarity) then {_BackpackContainer addItemCargoGlobal [_Ravage_items_array_addtoBackpack, _Random_Amount];};
};

if (_addItems_for_ACE3_mod) then {
if (_Add_Rarity) then {_BackpackContainer addItemCargoGlobal [_ACE3_mod_Medical_array_addtoBackpack, _Random_Amount];};
if (_Add_Rarity) then {_BackpackContainer addItemCargoGlobal [_ACE3_mod_items_array_addtoBackpack, _Random_Amount];};
};
};


//________________	_Magazines_in_Backpack	________________	

if (_Magazines_in_Backpack) then {	

_BackpackContainer	= BackpackContainer _this;
//________________	_Spawn_Magazines	________________
_BackpackContainer addMagazineCargoGlobal [_Spawn_Magazines, _Random_Amount];	
};	


//________________	reload handgunWeapon	________________

_this selectweapon handgunWeapon _this;
sleep 3;
reload _this;
sleep 8; 

//________________	reload primaryWeapon	________________

_this selectweapon primaryWeapon _this;
sleep 3;
reload _this;
sleep 8;

//________________	reload secondaryWeapon	________________

_this selectweapon secondaryWeapon _this;
sleep 3;
reload _this;

};
//________________	*** End *** 	________________	
	


//________________	This are extra	________________


GF_SCL_east_Change_Equipment_civilian = {

removeAllWeapons _this;
removeAllItems _this;
removeAllAssignedItems _this;
removeUniform _this;
removeVest _this;
removeBackpack _this;
removeHeadgear _this;
removeGoggles _this;

//________________	Randomize	________________

_Uniform = selectRandom GF_SCL_east_Civilian_Uniform_Custom_array;	//	GF_SCL_east_Uniform_array;
_Headgear = selectRandom GF_SCL_east_Headgear_array; 
_Goggles = selectRandom GF_SCL_east_Goggles_array; 
_Vests = selectRandom GF_SCL_east_Vests_array; 
_Backpacks = selectRandom GF_SCL_east_Backpacks_array;

_this forceAddUniform _Uniform;
_this addHeadgear _Headgear;
_this addGoggles _Goggles;

//	add rarity 
if (floor (random 10) < 4) then {_this addVest _Vests;};
if (floor (random 10) < 3) then {_this addBackpack _Backpacks;};
};






//________________	Informations about exlude or spawn	________________	 
/*
In order to exlude or spawn , you can do it with many ways:

1.	You can  write the classnames in the Exclude lists ,

2.	you can add in the init of the unit :
	this setVariable ["Var_GF_SCL_east", true];

3.	you can also spawn this for a certain unit :
	name this unit  ex : GF_SCL_east_1
	GF_SCL_east_1 spawn GF_SCL_east;
 
4. 	you can also spawn this for a certain unit in the Editor :
	add this in the init of a unit :
	null = this execVM "GF_SCL_east\GF_SCL_east.sqf";

	and add instead of the spawn code in the end :
	_this spawn GF_SCL_east;
	
5.	only for player : 
	player spawn GF_SCL_east;
	
6.	for everyone : 
	null = {_x spawn GF_SCL_east_Spawn_Custom_Equipment;}forEach allUnits;
*/
//________________	End	________________	 



[] spawn {
	while {true} do {		
		{		
		if (
		((alive _x)) 
		&& (!(_x getVariable ["Var_GF_SCL_east",false])) 
		&& (!((typeOf _x) in GF_SCL_east_Exclude_List)) 
		
		/*
		//________________	You can filter the side here	________________	
		&& {((side group _x) == west || 
			(side group _x) == east || 
			(side group _x) == independent || 
			(side group _x) == civilian)}
		*/
						
		//	&& (side group _x == playerSide)
		//	&& (!(side group _x == playerSide))
		
		&& (side group _x == east)
		
		) then {
			
			_x spawn GF_SCL_east;
			
			};						
			_x setVariable ["Var_GF_SCL_east",true];
			{waitUntil {!alive _x};
			_x setVariable ["Var_GF_SCL_east",false];		 
			};
		}forEach allUnits;
		sleep 5;
	};
};		


diag_log "//________________	GF Set Custom Loadout Script Initialized	_____________";
systemchat "GF Set Custom Loadout Script Initialized";

 

Share this post


Link to post
Share on other sites

Hi GF hope you are well. been using custom load outs for a while and no doubt it is one of most essential scripts...couldn't make missions without it! 

 

I need to assign a load out to a named unit class  to represent a poorly equipped civilian and bandit NPC class ("O_HOUSEGUESTS_P2_01"), this makes up the majority of units spawned and for this I use the standard GF_Set_Custom_Loadout.SQF. To represent a much better equipped Military/Police/PMC class I use another load out scheme to another named unit class ("O_HOUSEGUESTS_P3_01"), for this I use the GF_Set_Custom_Loadout_CUP.SQF . The load out cannot be defined by side as this is randomised. The mission is a chaotic environment and I don't want to be able to identify friend or for from their load out.

 

I have followed the instructions and excluded the appropriate units from the appropriate load out but what seems to happen is that only 1 of the named unit class gets a load out. This randomly changes each time it is run. What I cannot do is get both to run simultaneously......so given a different load out from the appropriate Array to each of the named unit class. Can you help?

 

Specifically how do I use this?

 

3.    you can also spawn this for a certain unit :
    name this unit  ex : GF_SCL_1
    GF_SCL_1 spawn GF_Set_Custom_Loadout_CUP;

 

Where does it go? This is for spawned units so I cannot put in the init of the unit.

 

I have tried O_HOUSEGUESTS_P2_01 spawn GF_Set_Custom_Loadout_CUP;

In the space where it says

//________________    7. Change equipment also to spawned units    ________________
 

But that did not work. Any help is appreciated!

 

Edited by Husker-71
Brevity
  • Thanks 1

Share this post


Link to post
Share on other sites
10 hours ago, Husker-71 said:

But that did not work. Any help is appreciated! 

 

Hello there @Husker-71 !

I'm fine and i hope that you are good as well !

 

To be honest i have some scripts made about loadouts and i was trying every time to help generally according the certain occasion.

Maybe this script is not that useful for what you are trying to succeed in.

 

So write down what exacly you want to do and i'll try to help you , just since we are talking for a different code let's move our discussion here :

 

ps: quote my post there.

Thanks !

  • Thanks 1

Share this post


Link to post
Share on other sites

!! SOLVED !!

 

Hello GF

 

I hope that you can help me.

 

Im having trouble adding two types of backpack Rarity

_Add_Rarity							= floor (random 10) < 4;
_Add_Rarity_BackpacksRadio			= floor (random 10) < 1;

 

this works perfect, my problem lies this this :

//________________ _addBackpack ________________

if (_addBackpack) then {

	if (_Exclude_List_Gear) then {
		if (!((typeOf _this) in Czarpol_Exclude_List_Gear)) then {	
		//_this addBackpack _Backpacks;	
		//	add rarity 
		if (_Add_Rarity) then {
		_this addBackpack _Backpacks;
		};
	};
	
	} else {
		if (_Add_Rarity) then {
		_this addBackpack _Backpacks;
		};
	};
};

if (_addBackpacksRadio) then {
	if (_Exclude_List_Gear) then {
		if (!((typeOf _this) in Czarpol_Exclude_List_Gear)) then {
		//_this addBackpack _BackpacksRadio;
		//	add rarity
		if (_Add_Rarity_BackpacksRadio) then {
		_this addBackpack _BackpacksRadio;
		};
	};
	
	} else {
		if (_Add_Rarity_BackpacksRadio) then {
		_this addBackpack _BackpacksRadio;
		};
	};
};

this also works, but sometimes replaces the already existing back and drops that backpack to the floor

 I tried to using unitBackpack to find if the unit has a backpack but gives me an error and script crashes.

 

how can I correctly do this ?

 

! script needs to check:  if unit already has a backpack if not then add the Radio Backpack, if it does then don't add the radio Backpack.

 

Im a novice and this it was syntax error involving lack of ()

 

if ((_addBackpacksRadio) && (isNull (unitBackpack _this))) then {
    if (_Exclude_List_Gear) then {
        if (!((typeOf _this) in Czarpol_Exclude_List_Gear)) then {
        if (_Add_Rarity_BackpacksRadio) then {
        _this addBackpack _BackpacksRadio;
        };
    };
    
    } else {
        if (_Add_Rarity_BackpacksRadio) then {
        _this addBackpack _BackpacksRadio;
        };
    };
};

 

!! SOLVED !!

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

×