1.7.6.1 Custom helicrash loot

Hoplit

Well-Known Member
Hey Guys! I followed a tutorial on this forum and it says you have to edit a couple things in spawnCrashSite.sqf to have custom loot at your helicrash.
I had to replace this code:
Code:
_num        = round(random _randomizedLoot) + _guaranteedLoot;
 
        _config =        configFile >> "CfgBuildingLoot" >> _lootTable;
        _itemTypes =    [] + getArray (_config >> "itemType");
        _index =        dayz_CBLBase  find "HeliCrash";
        _weights =        dayz_CBLChances select _index;
        _cntWeights = count _weights;

to this:
Code:
_num= round(random 4) + 5;
 
        _config = configFile >> "CfgBuildingLoot" >> _lootTable;
        _itemTypes = [["SCAR_H_LNG_Sniper", "weapon"], ["SCAR_H_LNG_Sniper_SD", "weapon"], ["SCAR_L_STD_Mk4CQT", "weapon"], ["SCAR_L_CQC_EGLM_Holo", "weapon"], ["SCAR_L_STD_EGLM_RCO", "weapon"], ["SCAR_H_Base", "weapon"], ["SCAR_H_STD_EGLM_Spect", "weapon"], ["AKS_74_UN_kobra", "weapon"], ["m8_base", "weapon"], ["m8_carbineGL", "weapon"], ["SCAR_H_CQC_CCO", "weapon"], ["BAF_AS50_TWS", "weapon"], ["PMC_AS50_scoped", "weapon"], ["PMC_AS50_TWS", "weapon"], ["", "military"], ["MedBox0", "object"], ["NVGoggles", "weapon"], ["AmmoBoxSmall_556", "object"], ["AmmoBoxSmall_762", "object"], ["Skin_Camo1_DZ", "magazine"], ["Skin_Soldier1_DZ", "magazine"], ["Skin_Sniper1_DZ", "magazine"]];
        _itemChance = [0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.9, 0.09, 0.05, 0.5, 0.05, 0.05, 0.05, 0.05];
        _weights = [];
        _weights = [_itemType,_itemChance] call fnc_buildWeightedArray;
        _cntWeights = count _weights;
        _index = _weights call BIS_fnc_selectRandom;

It worked perfectly, but when I tried to add more custom weapons, like this:

["M4SPR"]
and a chance:
0.05,

The helicrashes didn't spawned anymore. Also, do I have to insert all the weapon types what are in the original helicrash loot like: M4, backpacks etc.. ?
 
Back
Top