Jump to content
  • 0

Need help with Lootboxes


Kimarik

Question

Hi can anyone help me with Skalisty lootboxes  for Epoch 1.0.6.1 so that they don´t  spam my serverlog with permaloot errors?

rpt log;

Spoiler

Error in expression <etVariable ["created",_created];
};
if (!(_x getVariable ["permaLoot",false]) AN>
  Error position: <!(_x getVariable ["permaLoot",false]) AN>
  Error !: Type Number, expected Bool
File z\addons\dayz_server\system\scheduler\sched_lootpiles.sqf, line 27
Error in expression <etVariable ["created",_created];
};
if (!(_x getVariable ["permaLoot",false]) AN>
  Error position: <!(_x getVariable ["permaLoot",false]) AN>
  Error !: Type Number, expected Bool
File z\addons\dayz_server\system\scheduler\sched_lootpiles.sqf, line 27
Error in expression <etVariable ["created",_created];
};
if (!(_x getVariable ["permaLoot",false]) AN>
  Error position: <!(_x getVariable ["permaLoot",false]) AN>
  Error !: Type Number, expected Bool
File z\addons\dayz_server\system\scheduler\sched_lootpiles.sqf, line 27
Error in expression <etVariable ["created",_created];
};
if (!(_x getVariable ["permaLoot",false]) AN>
  Error position: <!(_x getVariable ["permaLoot",false]) AN>
  Error !: Type Number, expected Bool
File z\addons\dayz_server\system\scheduler\sched_lootpiles.sqf, line 27
Error in expression <etVariable ["created",_created];
};
if (!(_x getVariable ["permaLoot",false]) AN>
  Error position: <!(_x getVariable ["permaLoot",false]) AN>
  Error !: Type Number, expected Bool
File z\addons\dayz_server\system\scheduler\sched_lootpiles.sqf, line 27
Error in expression <etVariable ["created",_created];
};
if (!(_x getVariable ["permaLoot",false]) AN>
  Error position: <!(_x getVariable ["permaLoot",false]) AN>
  Error !: Type Number, expected Bool
File z\addons\dayz_server\system\scheduler\sched_lootpiles.sqf, line 27
Error in expression <etVariable ["created",_created];
};
if (!(_x getVariable ["permaLoot",false]) AN>
  Error position: <!(_x getVariable ["permaLoot",false]) AN>
  Error !: Type Number, expected Bool
File z\addons\dayz_server\system\scheduler\sched_lootpiles.sqf, line 27
Error in expression <etVariable ["created",_created];
};
if (!(_x getVariable ["permaLoot",false]) AN>
  Error position: <!(_x getVariable ["permaLoot",false]) AN>
  Error !: Type Number, expected Bool
File z\addons\dayz_server\system\scheduler\sched_lootpiles.sqf, line 27
Error in expression <etVariable ["created",_created];
};
if (!(_x getVariable ["permaLoot",false]) AN>
  Error position: <!(_x getVariable ["permaLoot",false]) AN>
  Error !: Type Number, expected Bool
File z\addons\dayz_server\system\scheduler\sched_lootpiles.sqf, line 27
Error in expression <etVariable ["created",_created];
};
if (!(_x getVariable ["permaLoot",false]) AN>
  Error position: <!(_x getVariable ["permaLoot",false]) AN>
  Error !: Type Number, expected Bool
File z\addons\dayz_server\system\scheduler\sched_lootpiles.sqf, line 27
Error in expression <etVariable ["created",_created];
};
if (!(_x getVariable ["permaLoot",false]) AN>
  Error position: <!(_x getVariable ["permaLoot",false]) AN>
  Error !: Type Number, expected Bool
File z\addons\dayz_server\system\scheduler\sched_lootpiles.sqf, line 27
Error in expression <etVariable ["created",_created];
};
if (!(_x getVariable ["permaLoot",false]) AN>
  Error position: <!(_x getVariable ["permaLoot",false]) AN>
  Error !: Type Number, expected Bool
File z\addons\dayz_server\system\scheduler\sched_lootpiles.sqf, line 27
Error in expression <etVariable ["created",_created];
};
if (!(_x getVariable ["permaLoot",false]) AN>
  Error position: <!(_x getVariable ["permaLoot",false]) AN>
  Error !: Type Number, expected Bool
File z\addons\dayz_server\system\scheduler\sched_lootpiles.sqf, line 27
Error in expression <etVariable ["created",_created];
};
if (!(_x getVariable ["permaLoot",false]) AN>
  Error position: <!(_x getVariable ["permaLoot",false]) AN>
  Error !: Type Number, expected Bool
File z\addons\dayz_server\system\scheduler\sched_lootpiles.sqf, line 27
Error in expression <etVariable ["created",_created];
};
if (!(_x getVariable ["permaLoot",false]) AN>
  Error position: <!(_x getVariable ["permaLoot",false]) AN>
  Error !: Type Number, expected Bool
File z\addons\dayz_server\system\scheduler\sched_lootpiles.sqf, line 27
Error in expression <etVariable ["created",_created];
};
if (!(_x getVariable ["permaLoot",false]) AN>
  Error position: <!(_x getVariable ["permaLoot",false]) AN>
  Error !: Type Number, expected Bool
File z\addons\dayz_server\system\scheduler\sched_lootpiles.sqf, line 27
Error in expression <etVariable ["created",_created];
};
if (!(_x getVariable ["permaLoot",false]) AN>
  Error position: <!(_x getVariable ["permaLoot",false]) AN>
  Error !: Type Number, expected Bool
File z\addons\dayz_server\system\scheduler\sched_lootpiles.sqf, line 27

This error comes only when I activate the Skalisty Lootbox in the Mission init.sqf

 

skalisty_island_lottery.sqf

Spoiler

if (isServer) then {

        
            //skalisty island lottery box behind palace

_vehicle_107 = objNull;
        
        if (true) then
        {
          _this = createVehicle ["BAF_VehicleBox", [13714, 2930.62, 0.00144156], [], 0, "CAN_COLLIDE"];
          _vehicle_107 = _this;
          _this setDir 20;
          _this setVariable ["permaLoot",true];
          
          clearWeaponCargoGlobal _this;
          clearMagazineCargoGlobal _this;

          
          _this addMagazineCargoGlobal ["ItemAmethyst",10];
          _this addMagazineCargoGlobal ["ItemTunaCooked",5];
          _this addMagazineCargoGlobal ["ItemComboLock",2];
          _this addMagazineCargoGlobal ["ItemTinBar",2];
          _this addMagazineCargoGlobal ["ItemWoodStairs",2];
          _this addMagazineCargoGlobal ["cinder_wall_kit",2];
          _this addMagazineCargoGlobal ["CinderBlocks",6];
          _this addMagazineCargoGlobal ["metal_floor_kit",2];
          _this addMagazineCargoGlobal ["MortarBucket",2];
          _this addMagazineCargoGlobal ["PartPlywoodPack",5];
          _this addMagazineCargoGlobal ["PartPlankPack",5];
          _this addMagazineCargoGlobal ["ItemWoodWallLg",2];
          _this addMagazineCargoGlobal ["ItemWoodWallGarageDoor",2];
          _this addMagazineCargoGlobal ["ItemSodaOrangeSherbet",5];
          _this addMagazineCargoGlobal ["Skin_SurvivorWurban_DZ",2];
          _this addMagazineCargoGlobal ["Skin_SurvivorWpink_DZ",2];
          _this addMagazineCargoGlobal ["Skin_Priest_DZ",2];
          _this addMagazineCargoGlobal ["Skin_BanditW2_DZ",2];
          _this addMagazineCargoGlobal ["Skin_Graves_Light_DZ",2];
          _this addMagazineCargoGlobal ["Skin_CZ_Special_Forces_GL_DES_EP1_DZ",2];
          _this addMagazineCargoGlobal ["Bandit2_DZ",2];

};

};

spawn_box_skalisty_island.sqf

Spoiler

/*this is the command line []execVM "\z\addons\dayz_server\addons\spawn_box_skalisty_island.sqf";//random box on Skalisty Island
put it in dayz_server\init\server_functions.sqf
at the bottom of the file
*/

private ["_crate","_crate2"];


DZMSProtectObj = {
    private ["_object","_objectID"];
    _object = _this select 0;
    
    _objectID = str(round(random 999999));
    _object setVariable ["ObjectID", _objectID, true];
    _object setVariable ["ObjectUID", _objectID, true];
    
    if (_object isKindOf "ReammoBox") then {
        // PermaLoot on top of ObjID because that "arma logic"
        _object setVariable ["permaLoot",true];
        _object setVariable ["Mission", "1", true];
    }; 
};

//This is _crate
WeaponBox = {
private ["_object","_crate"];
_crate = _this select 0;
_wpns = ["AKS_74_UN_kobra","AK_107_pso","AK_107_GL_pso","AK_107_GL_kobra","M4A3_CCO_EP1","M4A1_AIM_SD_camo","M16A4_ACG","M8_carbineGL","VSS_vintorez","M8_sharpshooter","M40A3","Mk_48_DZ","M240_DZ","M249_DZ","Pecheneg_DZ","RPK_74","BAF_LRR_scoped","DMR","SVD_CAMO","SCAR_H_LNG_Sniper_SD","M110_NVG_EP1","Sa58V_RCO_EP1","KSVK_DZE","BAF_L86A2_ACOG","M14_EP1","Sa58V_CCO_EP1",
        "AK_47_M","AK_74","AKS_74_kobra","AKS_74_U","BAF_L85A2_RIS_Holo","bizon_silenced","FN_FAL_ANPVS4","FN_FAL","G36A_camo","G36C_camo","G36C","G36K_camo","M1014","M16A2","M16A2GL","M4A1_AIM_SD_camo","M4A1_Aim","M4A1_HWS_GL_camo","M4A1","M4A3_CCO_EP1","Remington870_lamp","Sa58P_EP1","Sa58V_CCO_EP1","Sa58V_EP1","Sa58V_RCO_EP1"];

_pstl = ["Colt1911","glock17_EP1","M9","M9SD","Makarov","MakarovSD","revolver_EP1","UZI_EP1"];

_bld = ["CinderBlocks","MortarBucket","ItemTankTrap","ItemPole","PartGeneric","PartPlywoodPack","PartPlankPack","ItemTentOld","ItemTentDomed","ItemTentDomed2","ItemSandbag",
"ItemWire","workbench_kit","ItemGenerator","forest_net_kit","ItemWoodStairs","ItemWoodStairsSupport","ItemWoodLadder","ItemWoodWall","ItemWoodWallThird","ItemWoodWallDoor",
"ItemWoodWallWithDoor","ItemWoodWallGarageDoor","light_pole_kit","metal_panel_kit","wood_ramp_kit","bulk_ItemSandbag","bulk_ItemTankTrap","bulk_ItemTankTrapHalf","bulk_PartGeneric",
"deer_stand_kit","fuel_pump_kit","sandbag_nest_kit","storage_shed_kit","ItemFuelPump","ItemScaffoldingKit"];

_bld_rare = ["metal_floor_kit","30m_plot_kit","cinder_door_kit","cinder_garage_kit","cinder_wall_kit","ItemRuby",
"ItemPlotDeed","ItemORP","ItemAVE","ItemLRK","ItemTNK","ItemVault"];

_tools = ["ItemToolbox","ItemCrowbar","ItemKnife","ItemEtool","ItemHatchet_DZE","ItemMatchbox_DZE","Binocular_Vector","ItemCompass","ItemFishingPole","ItemFlashlightRed","ItemGPS","NVGoggles"];

// Define lists. Some lists are defined in DZMSWeaponCrateList.sqf in the ExtConfig.

_bpackList = ["DZ_LargeGunBag_EP1","DZ_British_ACU","DZ_CivilBackpack_EP1","DZ_Backpack_EP1"];

_gshellList = ["HandGrenade_west","FlareGreen_M203","FlareWhite_M203","1Rnd_HE_M203","FlareRed_M203","FlareYellow_M203","Skin_GUE_Soldier_MG_DZ","Skin_GUE_Soldier_Sniper_DZ","Skin_GUE_Soldier_Crew_DZ",
"Skin_GUE_Soldier_CO_DZ","Skin_GUE_Soldier_2_DZ","Skin_TK_INS_Warlord_EP1_DZ","Skin_CZ_Special_Forces_GL_DES_EP1_DZ","6Rnd_HE_M203","6Rnd_FlareWhite_M203","6Rnd_FlareGreen_M203","6Rnd_SmokeRed_M203"];

_medical = ["ItemBandage","ItemMorphine","ItemEpinephrine","ItemPainkiller","FoodMRE","ItemAntibiotic","ItemBloodbag","ItemSodaRabbit"];

_money = ["ItemCitrine","ItemGoldBar10oz","ItemBriefcase100oz"];


    _scount = count _gshellList;
    for "_x" from 0 to 8 do {
        _sSelect = floor(random _sCount);
        _item = _gshellList select _sSelect;
        _crate addMagazineCargoGlobal [_item,(round(random 2))];
    };
   
    // load packs
    _scount = count _bpackList;
    for "_x" from 0 to 2 do {
        _sSelect = floor(random _sCount);
        _item = _bpackList select _sSelect;
        _crate addBackpackCargoGlobal [_item,1];
    };
     
    // load pistols
    _scount = count _pstl;
    for "_x" from 0 to 4 do {
        _sSelect = floor(random _sCount);
        _item = _pstl select _sSelect;
        _crate addWeaponCargoGlobal [_item,1];
        _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
        if (count _ammo > 0) then {
            _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 4))];
        };
    };

    //load primary
    _scount = count _wpns;
    for "_x" from 0 to 4 do {
        _sSelect = floor(random _sCount);
        _item = _wpns select _sSelect;
        _crate addWeaponCargoGlobal [_item,1];
        _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
        if (count _ammo > 0) then {
            _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 4))];
        };
    };
    
    _scount = count _money;
    for "_x" from 0 to 4 do {
        _sSelect = floor(random _sCount);
        _item = _money select _sSelect;
        _crate addMagazineCargoGlobal [_item,(round(random 2))];
    };
    _scount = count _medical;
    for "_x" from 0 to 8 do {
        _sSelect = floor(random _sCount);
        _item = _medical select _sSelect;
        _crate addMagazineCargoGlobal [_item,(round(random 2))];
    };
};

//This is _crate2
BuildBox = {
private ["_object","_crate2"];
_crate2 = _this select 0;

_wpns = ["AKS_74_UN_kobra","AK_107_pso","AK_107_GL_pso","AK_107_GL_kobra","M4A3_CCO_EP1","M4A1_AIM_SD_camo","M16A4_ACG","M8_carbineGL","VSS_vintorez","M8_sharpshooter","M40A3","Mk_48_DZ",
         "M240_DZ","M249_DZ","Pecheneg_DZ","RPK_74","BAF_LRR_scoped","DMR","SVD_CAMO","SCAR_H_LNG_Sniper_SD","M110_NVG_EP1","Sa58V_RCO_EP1","KSVK_DZE","BAF_L86A2_ACOG","M14_EP1","Sa58V_CCO_EP1",
         "AK_47_M","AK_74","AKS_74_kobra","AKS_74_U","BAF_L85A2_RIS_Holo","bizon_silenced","FN_FAL_ANPVS4","FN_FAL","G36A_camo","G36C_camo","G36C","G36K_camo","M1014","M16A2","M16A2GL",
         "M4A1_AIM_SD_camo","M4A1_Aim","M4A1_HWS_GL_camo","M4A1","M4A3_CCO_EP1","Remington870_lamp","Sa58P_EP1","Sa58V_CCO_EP1","Sa58V_EP1","Sa58V_RCO_EP1"];

_pstl = ["Colt1911","glock17_EP1","M9","M9SD","Makarov","MakarovSD","revolver_EP1","UZI_EP1",
        "RH_deagle","RH_Deagleg","RH_Deaglem","RH_Deaglemz","RH_Deaglemzb","RH_Deagles","RH_g17","RH_g17sd","RH_g18",
        "RH_g19","RH_g19t","RH_m1911","RH_m1911old","RH_m1911sd","RH_m9","RH_m93r","RH_m9c","RH_m9csd","RH_m9sd","RH_usp",
        "RH_uspm","RH_uspsd"];
        
_bld = ["CinderBlocks","MortarBucket","ItemTankTrap","ItemPole","PartGeneric","PartPlywoodPack","PartPlankPack","ItemTentOld","ItemTentDomed","ItemTentDomed2","ItemSandbag",
"ItemWire","workbench_kit","ItemGenerator","forest_net_kit","ItemWoodStairs","ItemWoodStairsSupport","ItemWoodLadder","ItemWoodWall","ItemWoodWallThird","ItemWoodWallDoor",
"ItemWoodWallWithDoor","ItemWoodWallGarageDoor","light_pole_kit","metal_panel_kit","wood_ramp_kit","bulk_ItemSandbag","bulk_ItemTankTrap","bulk_ItemTankTrapHalf","bulk_PartGeneric",
"deer_stand_kit","fuel_pump_kit","sandbag_nest_kit","storage_shed_kit","ItemFuelPump","ItemScaffoldingKit"];

_bld_rare = ["metal_floor_kit","30m_plot_kit","cinder_door_kit","cinder_garage_kit","cinder_wall_kit","ItemLockbox","ItemRuby","ItemPlotDeed","ItemORP","ItemAVE","ItemLRK","ItemTNK","ItemVault"];

_tools = ["ItemToolbox","ItemCrowbar","ItemKnife","ItemEtool","ItemHatchet_DZE","ItemMatchbox_DZE","Binocular_Vector","ItemCompass","ItemFishingPole","ItemFlashlightRed","ItemGPS","NVGoggles"];

// Define lists. Some lists are defined in DZMSWeaponCrateList.sqf in the ExtConfig.

_bpackList = ["DZ_LargeGunBag_EP1","DZ_British_ACU","DZ_CivilBackpack_EP1","DZ_Backpack_EP1"];

_gshellList = ["HandGrenade_west","FlareGreen_M203","FlareWhite_M203","1Rnd_HE_M203","FlareRed_M203","FlareYellow_M203",
"Skin_GUE_Soldier_MG_DZ","Skin_GUE_Soldier_Sniper_DZ","Skin_GUE_Soldier_Crew_DZ","Skin_GUE_Soldier_CO_DZ","Skin_GUE_Soldier_2_DZ",
"Skin_TK_INS_Warlord_EP1_DZ","Skin_CZ_Special_Forces_GL_DES_EP1_DZ","6Rnd_HE_M203","6Rnd_FlareWhite_M203","6Rnd_FlareGreen_M203","6Rnd_SmokeRed_M203"];

_medical = ["ItemBandage","ItemMorphine","ItemEpinephrine","ItemPainkiller","FoodMRE","ItemAntibiotic","ItemBloodbag","ItemSodaRabbit"];

_money = ["ItemCitrine","ItemGoldBar10oz","ItemBriefcase100oz"];


    // load tools
    _scount = count _tools;
    for "_x" from 0 to 6 do {
        _sSelect = floor(random _sCount);
        _item = _tools select _sSelect;
        _crate2 addWeaponCargoGlobal [_item, 1];
    };
    
    // load construction
    _scount = count _bld_rare;
    for "_x" from 0 to 6 do {
        _sSelect = floor(random _sCount);
        _item = _bld_rare select _sSelect;
        _crate2 addMagazineCargoGlobal [_item,1];
    };
    _scount = count _bld;
    for "_x" from 0 to 20 do {
        _sSelect = floor(random _sCount);
        _item = _bld select _sSelect;
        _crate2 addMagazineCargoGlobal [_item,(round(random 2))];
    };
    _scount = count _money;
    for "_x" from 0 to 4 do {
        _sSelect = floor(random _sCount);
        _item = _money select _sSelect;
        _crate2 addMagazineCargoGlobal [_item,(round(random 2))];
    };
    _scount = count _medical;
    for "_x" from 0 to 8 do {
        _sSelect = floor(random _sCount);
        _item = _medical select _sSelect;
        _crate2 addMagazineCargoGlobal [_item,(round(random 2))];
    };
};    
    


_coords =  [[14072.7, 2824.46, 0], [13602.9, 3141.8, 0], [13413.9, 2761.31, 0], [13696.2, 2991.8, 0], [13267.7, 3235.02, 0]] call BIS_fnc_selectRandom;
_coords2 = [[13788.6, 2950.67, 0], [13310.8, 2734.6, 0], [13920.5, 2918.4, 0], [14067.9, 2770.47, 0], [13456.6, 3327.34, 0]] call BIS_fnc_selectRandom;


// fills the box, DZMSProtectObj prevents it from disappearing
_crate = createVehicle ["RUVehicleBox",[(_coords select 0) + 2.6778,(_coords select 1) - 3.0889,0],[], 0, "CAN_COLLIDE"];
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
[_crate] call WeaponBox;
[_crate] call DZMSProtectObj;
_crate setDir -28.85478;

_crate2 = createVehicle ["RUVehicleBox",[(_coords2 select 0) + 1.4805,(_coords2 select 1) - 3.7432,0],[], 0, "CAN_COLLIDE"];
clearWeaponCargoGlobal _crate2;
clearMagazineCargoGlobal _crate2;
[_crate2] call BuildBox;
[_crate2] call DZMSProtectObj;
_crate2 setDir 62.744293;;

 

I thik if this can be fixed many users will be happy.

 

Thx for help.

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

It´s original. i don´t change anything in this file.

Spoiler

#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"

sched_lootpiles_5m_init = {
    sched_lp_state = 0;
    sched_lp_var1 = 0;
    sched_lp_lootTotal = 0;
    sched_lp_delqty = 0;
    sched_lp_players = [];
    sched_lp_list = [];

    objNull
};

sched_lootpiles_5m = {
    private ["_created","_kind","_x"];
    if (sched_lp_state == 0) then {
        sched_lp_list = [];
        sched_lp_lootTotal = 0;
        {
            _kind = _x;
            {
                _created = _x getVariable ["created",-1];
                if (_created == -1) then {
                    _created = diag_tickTime;
                    _x setVariable ["created",_created];
                };
                if (!(_x getVariable ["permaLoot",false]) AND {(diag_tickTime - _created > 1500)}) then {
                    sched_lp_list set [ count sched_lp_list, _x ];
                };
                sched_lp_lootTotal = sched_lp_lootTotal + 1;
            } forEach allMissionObjects _kind;    
        } forEach [ "Blood_Trail_DZ", "ReammoBox", "Land_Fire_DZ", "flamable_DZ" ];
#ifdef SERVER_DEBUG        
        diag_log ["sched_lootpiles_5mn: reset lootpiles check, total visited:", sched_lp_lootTotal, "listed:", count sched_lp_list];
#endif
        if (count sched_lp_list > 0) then {
            sched_lp_state = 1;
            sched_lp_var1 = 0;
            sched_lp_players = +(playableUnits);
        };
    };
    objNull
};

sched_lootpiles = {
    private ["_plrBatch","_chunkSize","_imax","_plr","_i","_x", "_changed"];
    // EVERY 5 MINUTES, ONE OF THESE TASKS SPACED BY 5 SECONDS:
    // LOOK FOR OLD LOOTPILES -OR- IGNORE LOOTPILES NEAR _plrBatch PLAYERS -OR- REMOVE REMAINING _chunkSize LOOTPILES         
    _chunkSize = 50;
    _plrBatch = 10;
    switch true do {
        case (sched_lp_state == 1): { // forEach players -> ignore nearby loot
                _imax = (count sched_lp_players) min (sched_lp_var1 + _plrBatch);
                //diag_log format ["%1: lootpiles foreach players from:%2 to:%3 players:%4 old:%5 total:%6", __FILE__, sched_lp_var1, _imax, count sched_lp_players, count sched_lp_list, sched_lp_lootTotal ];
                for "_i" from sched_lp_var1 to _imax-1 do {
                    _plr = (sched_lp_players select _i);
                    if (!(isNull _plr) AND {(isPlayer _plr)}) then {
                        _plr = vehicle _plr;
                        {
                            if (_x IN sched_lp_list) then {
                                sched_lp_list = sched_lp_list - [_x];
                            };
                        } forEach ((getPosATL _plr) nearObjects ["ReammoBox",250]);
                    }/*
                    else {
                        diag_log format [ "%1 player left? %2", __FILE__, _x ];
                    }*/;
                };
                sched_lp_var1 = _imax;
                _changed = false;
                if (_imax == count sched_lp_players) then { // catch the few players who entered meanwhile
                    {
                        if !(_x in sched_lp_players) then { 
                            sched_lp_players set [ count sched_lp_players, _x ];
                            _changed = true;
                        };
                    } forEach playableUnits;
                };
                if (!_changed) then {
                    sched_lp_state = 2;
                    sched_lp_var1 = 0;
                    sched_lp_delqty = count sched_lp_list;
#ifdef SERVER_DEBUG        
                    diag_log [ "sched_lootpiles:Will delete",sched_lp_delqty,"lootpiles"];
#endif
                }
                else {
#ifdef SERVER_DEBUG        
                    diag_log [ "sched_lootpiles:Extended loop for new players", _imax, count sched_lp_players];
#endif
                };
            };
        case (sched_lp_state == 2): {  // forEAch remaining lootpiles -> delete 
                _imax = (sched_lp_delqty) min (sched_lp_var1 + _chunkSize);
                //diag_log format ["%1: lootpiles foreach loot to del from:%2 to:%3 old:%4 total:%5", __FILE__, sched_lp_var1, _imax, sched_lp_delqty, sched_lp_lootTotal ];
                for "_i" from sched_lp_var1 to _imax-1 do {
                    _x = sched_lp_list select _i;
                    deleteVehicle _x;
                };
                sched_lp_var1 = _imax;
                if (_imax == sched_lp_delqty) then {
                    sched_lp_state = 0;
                    sched_lp_list = [];
#ifdef SERVER_DEBUG        
                    diag_log format ["%1: deleted %2 lootpiles from %3 total", __FILE__, sched_lp_delqty, sched_lp_lootTotal ];
#endif
                };
            };
    }; // switch

    objNull
};

 

Link to comment
Share on other sites

  • 0
On 5/1/2017 at 8:48 AM, DAmNRelentless said:

The rpt says there is an error:
File z\addons\dayz_server\system\scheduler\sched_lootpiles.sqf, line 27

Please provide that file aswell.

The error is not due to a problem in the file, it's due to an error in custom loot table files. 

@Kimarik double check your custom loot table format is correct, 1.0.5.1 loot tables will not work with 1.0.6 and newer. make sure that there are no missing commas, and the loot arrays are formatted correctly.

also, leave the setVariable for PermaLoot, that is also not the issue

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...