Jump to content
  • 0

Virtual garage partially working, help requested


Th3-Hunter333

Question

After many long hours trying to get virtual garage from overheat working on epoch 106 it is almost fully working just having some strange minor errors trying to fix it and am looking for some help now with it

First error is it is spamming Garage locked in red over and over (nonstop even when walking away from the garage)

This here is the fn_selfactions where i think that error is at

scriptName "Functions\misc\fn_selfActions.sqf";
/***********************************************************
    ADD ACTIONS FOR SELF
    - Function
    - [] call fnc_usec_selfActions;
************************************************************/
if (dayz_actionInProgress) exitWith {};
private ["_canPickLight","_text","_dir","_canDoThis","_w2m","_bb","_waterHoles","_unlock","_lock","_totalKeys","_temp_keys","_temp_keys_names",
"_hasKey","_oldOwner","_hasAttached","_isZombie","_isHarvested","_isMan","_isFuel","_hasRawMeat","_hastinitem","_player_deleteBuild",
"_player_lockUnlock_crtl","_displayName","_hasIgnators","_menu","_menu1","_allowTow","_liftHeli","_found","_posL","_posC","_height","_attached",
"_combi","_findNearestGen","_humanity_logic","_low_high","_cancel","_buy","_buyV","_humanity","_traderMenu","_warn","_typeOfCursorTarget",
"_isVehicle","_isBicycle","_isDestructable","_isGenerator","_ownerID","_isVehicletype","_hasBarrel","_hasFuel20","_hasFuel5","_hasEmptyFuelCan",
"_itemsPlayer","_hasToolbox","_hasbottleitem","_isAlive","_isPlant","_istypeTent","_upgradeItems","_isDisallowRefuel","_isDog",
"_isModular","_isModularDoor","_isHouse","_isGate","_isFence","_isLockableGate","_isUnlocked","_isOpen","_isClosed","_ownerArray","_ownerBuildLock",
"_ownerPID","_speed","_dog","_vehicle","_inVehicle","_cursorTarget","_primaryWeapon","_currentWeapon","_magazinesPlayer","_onLadder","_canDo",
"_nearLight","_vehicleOwnerID","_hasHotwireKit","_isPZombie","_dogHandle","_allowedDistance","_id","_upgrade","_weaponsPlayer","_hasCrowbar",
"_allowed","_hasAccess","_uid"];

_vehicle = vehicle player;
_inVehicle = (_vehicle != player);
_cursorTarget = cursorTarget;
_primaryWeapon = primaryWeapon player;
_currentWeapon = currentWeapon player;
_magazinesPlayer = magazines player;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
//_canDrink = count nearestObjects [getPosATL player, ["Land_pumpa","Land_water_tank"], 2] > 0;
_uid = getPlayerUID player;
_nearLight = nearestObject [player,"LitObject"];
_canPickLight = false;
_vehicleOwnerID = _vehicle getVariable ["CharacterID","0"];
_hasHotwireKit = "ItemHotwireKit" in _magazinesPlayer;
_isPZombie = player isKindOf "PZombie_VB";
_dogHandle = player getVariable ["dogID",0];

if (!isNull _nearLight) then {
    if (_nearLight distance player < 4) then {
        _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
    };
};

//Grab Flare
if (_canPickLight && !dayz_hasLight && !_isPZombie) then {
    if (s_player_grabflare < 0) then {
        _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
        s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true];
        s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, false, true];
    };
} else {
    player removeAction s_player_grabflare;
    player removeAction s_player_removeflare;
    s_player_grabflare = -1;
    s_player_removeflare = -1;
};

if (s_player_equip_carry < 0) then {
    if (dayz_onBack != "" && { !_inVehicle && { !_onLadder && { !r_player_unconscious } } }) then {
        dz_plr_carryActionItem = dayz_onBack;
        _text = getText (configFile >> "CfgWeapons" >> dz_plr_carryActionItem >> "displayName");
        s_player_equip_carry = player addAction [
            format [localize "STR_ACTIONS_WEAPON", _text],
            "\z\addons\dayz_code\actions\player_switchWeapon_action.sqf",
            nil, 0.5, false, true];
    };
} else {
    if (dayz_onBack != dz_plr_carryActionItem || { _inVehicle || { _onLadder || { r_player_unconscious } } } ) then {
        player removeAction s_player_equip_carry;
        s_player_equip_carry = -1;
    };
};

/*if (dayz_onBack != "" /*&& !dayz_onBackActive && !_inVehicle && !_onLadder && !r_player_unconscious) then {
    if (s_player_equip_carry < 0) then {
        _text = getText (configFile >> "CfgWeapons" >> dayz_onBack >> "displayName");
        s_player_equip_carry = player addAction [format[localize "STR_ACTIONS_WEAPON", _text], "\z\addons\dayz_code\actions\player_switchWeapon_action.sqf", nil, 0.5, false, true];
    };
} else {
    player removeAction s_player_equip_carry;
    s_player_equip_carry = -1;
};*/

//fishing
if ((_currentWeapon in Dayz_fishingItems) && {!dayz_fishingInprogress} && {!_inVehicle} && {!dayz_isSwimming}) then {
    if (s_player_fishing < 0) then {
        s_player_fishing = player addAction [localize "STR_ACTION_CAST", "\z\addons\dayz_code\actions\player_goFishing.sqf",player, 0.5, false, true];
    };
} else {
    player removeAction s_player_fishing;
    s_player_fishing = -1;
};
if ((_primaryWeapon in Dayz_fishingItems) && {!dayz_fishingInprogress} && {_inVehicle && (driver _vehicle != player)}) then {
    if (s_player_fishing_veh < 0) then {
        s_player_fishing_veh = _vehicle addAction [localize "STR_ACTION_CAST", "\z\addons\dayz_code\actions\player_goFishing.sqf",_vehicle, 0.5, false, true];
    };
} else {
    _vehicle removeAction s_player_fishing_veh;
    s_player_fishing_veh = -1;
};

_canDoThis=false;
if (_canDo && !_inVehicle && !dayz_isSwimming) then {
    {
        _waterHoles = if (typeOf _x == "waterHoleProxy") then {nearestObjects [_x, [], 1];} else {[_x];};
        {
            _w2m = _x worldToModel (getPosATL player);
            _bb = (boundingbox _x) select 1;
            _dir = [player, _x] call BIS_fnc_relativeDirTo; if (_dir > 180) then {_dir = _dir - 360};
            if (((abs _dir < 45) && {(_x distance player < 2.22)})  // wells, kasna, pumpa
                or {((("" == typeOf _x) && ((_w2m select 2) < 0.05)) && {((abs(_w2m select 0) < (_bb select 0)) && (abs(_w2m select 1) < (_bb select 1)))})}) exitWith { // ponds
                _canDoThis = true;
            };
        } count _waterHoles;
        if (_canDoThis) exitWith {
            if (s_player_Drinkfromhands < 0) then {
                s_player_Drinkfromhands = player addAction [localize "STR_ACTIONS_DRINK2", "\z\addons\dayz_code\actions\player_drinkWater.sqf",player, 0.5, false, true];
            };
        };
    } foreach nearestObjects [player, ["waterHoleProxy", "Land_pumpa"], 50];
};
if (!_canDoThis && s_player_Drinkfromhands >= 0) then {
    player removeAction s_player_Drinkfromhands;
    s_player_Drinkfromhands = -1;
};

if (_inVehicle) then {
    DZE_myVehicle = _vehicle;
    if (_vehicleOwnerID != "0" && _canDo) then {
        if (s_player_lockUnlockInside_ctrl < 0) then {
            _totalKeys = call epoch_tempKeys;
            _temp_keys = _totalKeys select 0;
            _temp_keys_names = _totalKeys select 1;    
            _hasKey = _vehicleOwnerID in _temp_keys;
            _oldOwner = (_vehicleOwnerID == _uid);
            _text = getText (configFile >> "CfgVehicles" >> (typeOf DZE_myVehicle) >> "displayName");
            if (locked DZE_myVehicle) then {
                if (_hasKey || _oldOwner) then {
                    _unlock = DZE_myVehicle addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",[DZE_myVehicle,(_temp_keys_names select (parseNumber _vehicleOwnerID))], 2, false, true];
                    s_player_lockUnlockInside set [count s_player_lockUnlockInside,_unlock];
                    s_player_lockUnlockInside_ctrl = 1;
                } else {
                    if (_hasHotwireKit) then {
                        _unlock = DZE_myVehicle addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",DZE_myVehicle, 2, true, true];
                    } else {
                        _unlock = DZE_myVehicle addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",DZE_myVehicle, 2, true, true];
                    };
                    s_player_lockUnlockInside set [count s_player_lockUnlockInside,_unlock];
                    s_player_lockUnlockInside_ctrl = 1;
                };
            } else {
                if (_hasKey || _oldOwner) then {
                    _lock = DZE_myVehicle addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",DZE_myVehicle, 1, false, true];
                    s_player_lockUnlockInside set [count s_player_lockUnlockInside,_lock];
                    s_player_lockUnlockInside_ctrl = 1;
                };
            };
        };
    } else {
        {DZE_myVehicle removeAction _x} count s_player_lockUnlockInside;s_player_lockUnlockInside = [];
        s_player_lockUnlockInside_ctrl = -1;
    };
} else {
    {DZE_myVehicle removeAction _x} count s_player_lockUnlockInside;s_player_lockUnlockInside = [];
    s_player_lockUnlockInside_ctrl = -1;
};

if (DZE_HeliLift) then {
    _hasAttached = _vehicle getVariable["hasAttached",false];
    if (_inVehicle && {_vehicle isKindOf "Air"} && {(([_vehicle] call FNC_getPos) select 2) < 30} && {speed _vehicle < 5} && {typeName _hasAttached == "OBJECT"}) then {
        if (s_player_heli_detach < 0) then {
            dayz_myLiftVehicle = _vehicle;
            s_player_heli_detach = dayz_myLiftVehicle addAction [localize "STR_EPOCH_ACTIONS_DETACHVEHICLE","\z\addons\dayz_code\actions\player_heliDetach.sqf",[dayz_myLiftVehicle,_hasAttached],2,false,true];
        };
    } else {
        dayz_myLiftVehicle removeAction s_player_heli_detach;
        s_player_heli_detach = -1;
    };
};

if (DZE_HaloJump) then {
    if (_inVehicle && {_vehicle isKindOf "Air"} && {(([_vehicle] call FNC_getPos) select 2) > 400}) then {
        if (s_halo_action < 0) then {
            DZE_myHaloVehicle = _vehicle;
            s_halo_action = DZE_myHaloVehicle addAction [localize "STR_EPOCH_ACTIONS_HALO","\z\addons\dayz_code\actions\halo_jump.sqf",[],2,false,true];
        };
    } else {
        DZE_myHaloVehicle removeAction s_halo_action;
        s_halo_action = -1;
    };
};

if (DZE_NameTags > 0) then {
    if (s_player_showname < 0 && !_isPZombie) then {
        if (DZE_NameTags < 2) then {
            s_player_showname = 1;
            player setVariable["DZE_display_name",true,true];
        } else {
            s_player_showname = player addAction [localize "STR_EPOCH_ACTIONS_NAMEYES", "\z\addons\dayz_code\actions\display_name.sqf",true, 0, true, false];
            s_player_showname1 = player addAction [localize "STR_EPOCH_ACTIONS_NAMENO", "\z\addons\dayz_code\actions\display_name.sqf",false, 0, true, false];
        };
    };
};

if (_isPZombie) then {
    if (s_player_attack < 0) then {
        s_player_attack = player addAction [localize "STR_EPOCH_ACTIONS_ATTACK", "\z\addons\dayz_code\actions\pzombie\pz_attack.sqf", _cursorTarget, 6, false, true];
    };
    if (s_player_callzombies < 0) then {
        s_player_callzombies = player addAction [localize "STR_EPOCH_ACTIONS_RAISEHORDE", "\z\addons\dayz_code\actions\pzombie\call_zombies.sqf",player, 5, true, false];
    };
    if (s_player_pzombiesvision < 0) then {
        s_player_pzombiesvision = player addAction [localize "STR_EPOCH_ACTIONS_NIGHTVIS", "\z\addons\dayz_code\actions\pzombie\pz_vision.sqf", [], 4, false, true, "nightVision", "_this == _target"];
    };
    if (!isNull _cursorTarget && (player distance _cursorTarget < 3)) then {
        _isZombie = _cursorTarget isKindOf "zZombie_base";
        _isHarvested = _cursorTarget getVariable["meatHarvested",false];
        _isMan = _cursorTarget isKindOf "Man"; //includes animals and zombies
        if (!alive _cursorTarget && _isMan && !_isZombie && !_isHarvested) then {
            if (s_player_pzombiesfeed < 0) then {
                s_player_pzombiesfeed = player addAction [localize "STR_EPOCH_ACTIONS_FEED", "\z\addons\dayz_code\actions\pzombie\pz_feed.sqf",_cursorTarget, 3, true, false];
            };
        } else {
            player removeAction s_player_pzombiesfeed;
            s_player_pzombiesfeed = -1;
        };
    } else {
        player removeAction s_player_pzombiesfeed;
        s_player_pzombiesfeed = -1;
    };
};

// Increase distance only if AIR or SHIP
_allowedDistance = if ((_cursorTarget isKindOf "Air") or (_cursorTarget isKindOf "Ship")) then {8} else {4};

if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cursorTarget < _allowedDistance) && _canDo) then {
//Has some kind of target
    _typeOfCursorTarget = typeOf _cursorTarget;
    _isVehicle = _cursorTarget isKindOf "AllVehicles";
    _isBicycle = _cursorTarget isKindOf "Bicycle";
    _isMan = _cursorTarget isKindOf "Man"; //includes animals and zombies
    _isDestructable = _cursorTarget isKindOf "BuiltItems";
    _isGenerator = _cursorTarget isKindOf "Generator_DZ";
    //_isVehicletype = _typeOfCursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"]; //Checked in player_flipvehicle
    _isFuel = false;
    _hasBarrel = "ItemFuelBarrel" in _magazinesPlayer;
    _hasFuel20 = "ItemJerrycan" in _magazinesPlayer;
    _hasFuel5 = "ItemFuelcan" in _magazinesPlayer;
    _hasEmptyFuelCan = (("ItemJerrycanEmpty" in _magazinesPlayer) || ("ItemFuelcanEmpty" in _magazinesPlayer) || ("ItemFuelBarrelEmpty" in _magazinesPlayer));
    _itemsPlayer = items player;
    _weaponsPlayer = weapons player;
    _hasCrowbar = "ItemCrowbar" in _itemsPlayer or "MeleeCrowbar" in _weaponsPlayer or dayz_onBack == "MeleeCrowbar";
    _hasToolbox = "ItemToolbox" in _itemsPlayer;
    _hasbottleitem = (("ItemWaterBottle" in _magazinesPlayer) || ("ItemWaterBottleInfected" in _magazinesPlayer) || ("ItemWaterBottleSafe" in _magazinesPlayer));
    _isAlive = alive _cursorTarget;
    _text = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName");
    _isPlant = _typeOfCursorTarget in Dayz_plants;
    _istypeTent = (_cursorTarget isKindOf "TentStorage_base") or (_cursorTarget isKindOf "IC_Tent");
    _upgradeItems = ["TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","StashSmall","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3","DomeTentStorage","DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DomeTentStorage4"];
    _characterID = _cursorTarget getVariable ["CharacterID","0"];
    
    if (DZE_permanentPlot) then {
        _id = _uid;
        _ownerID = _cursorTarget getVariable ["ownerPUID","0"];
    } else {
        _id = dayz_characterID;
        _ownerID = _characterID;
    };

    _isDisallowRefuel = _typeOfCursorTarget in ["M240Nest_DZ","MMT_Civ","MMT_USMC","Old_bike_TK_CIV_EP1","Old_bike_TK_INS_EP1"];    
    _isDog = (_cursorTarget isKindOf "Pastor" || _cursorTarget isKindOf "Fin");
    _isModular = _cursorTarget isKindOf "ModularItems";
    _isModularDoor = _typeOfCursorTarget in ["Land_DZE_WoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_GarageWoodDoor","CinderWallDoor_DZ","CinderWallDoorSmall_DZ"];
    _player_deleteBuild = false;
    _player_lockUnlock_crtl = false;
    
    //fuel tanks
    if (_hasEmptyFuelCan) then {
        {
            if (_cursorTarget isKindOf _x) exitWith {_isFuel = true;};
        } count dayz_fuelsources;
    };

    //remove gathered plant if empty
    if (_isPlant) then {
        _cursorTarget call player_gather;
    };

    //flip vehicle
    if (_isVehicle && {!_isMan} && {!(canMove _cursorTarget)} && {_isAlive} && {player distance _cursorTarget >= 2} && {(count (crew _cursorTarget))== 0} && {((vectorUp _cursorTarget) select 2) < 0.5}) then {
        if (s_player_flipveh < 0) then {
            s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, true, true];
        };
    } else {
        player removeAction s_player_flipveh;
        s_player_flipveh = -1;
    };
    
    //Allow player to fill Fuel can
    if (_hasEmptyFuelCan && {_isFuel} && {!a_player_jerryfilling} && {_isAlive}) then {
        if (s_player_fillfuel < 0) then {
            s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",_cursorTarget, 1, false, true];
        };
    } else {
        player removeAction s_player_fillfuel;
        s_player_fillfuel = -1;
    };
    
    if (damage _cursorTarget < 1) then {
        //Allow player to fill vehicle 210L
        if (_hasBarrel && {!_isMan} && {_isVehicle} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
            if (s_player_fillfuel210 < 0) then {
                s_player_fillfuel210 = player addAction [format[localize "str_actions_medical_10",_text,"210"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemFuelBarrel",_cursorTarget], 0, true, true, "", "'ItemFuelBarrel' in magazines player"];
            };
        } else {
            player removeAction s_player_fillfuel210;
            s_player_fillfuel210 = -1;
        };
        
        //Allow player to fill vehicle 20L
        if (_hasFuel20 && {!_isMan} && {_isVehicle} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
            if (s_player_fillfuel20 < 0) then {
                s_player_fillfuel20 = player addAction [format[localize "str_actions_medical_10",_text,"20"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemJerrycan",_cursorTarget], 0, true, true, "", "'ItemJerrycan' in magazines player"];
            };
        } else {
            player removeAction s_player_fillfuel20;
            s_player_fillfuel20 = -1;
        };

        //Allow player to fill vehicle 5L
        if (_hasFuel5 && {!_isMan} && {_isVehicle} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
            if (s_player_fillfuel5 < 0) then {
                s_player_fillfuel5 = player addAction [format[localize "str_actions_medical_10",_text,"5"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemFuelcan",_cursorTarget], 0, true, true, "", "'ItemFuelcan' in magazines player"];
            };
        } else {
            player removeAction s_player_fillfuel5;
            s_player_fillfuel5 = -1;
        };
        /*
            Vanilla generator is currently not functional.
            Vanilla generator refuel actions removed for now.
            Epoch generator fill action is below.
        */
        //Allow player to siphon vehicles
        if (_hasEmptyFuelCan && {!_isMan} && {_isVehicle} && {!_isBicycle} && {!a_player_jerryfilling} && {fuel _cursorTarget > 0}) then {
            if (s_player_siphonfuel < 0) then {
                s_player_siphonfuel = player addAction [format[localize "str_siphon_start"], "\z\addons\dayz_code\actions\siphonFuel.sqf",_cursorTarget, 0, true, true];
            };
        } else {
            player removeAction s_player_siphonfuel;
            s_player_siphonfuel = -1;
        };
    } else {
        player removeAction s_player_fillfuel210;
        s_player_fillfuel210 = -1;
        player removeAction s_player_fillfuel20;
        s_player_fillfuel20 = -1;
        player removeAction s_player_fillfuel5;
        s_player_fillfuel5 = -1;
        player removeAction s_player_siphonfuel;
        s_player_siphonfuel = -1;
    };
    
    //Fireplace Actions check
    if ((_cursorTarget call isInflamed) or (inflamed _cursorTarget)) then {
        _hasRawMeat = {_x in Dayz_meatraw} count _magazinesPlayer > 0;
        _hastinitem = {_x in boil_tin_cans} count _magazinesPlayer > 0;
        
    //Cook Meat    
        if (_hasRawMeat && !a_player_cooking) then {
            if (s_player_cook < 0) then {
                s_player_cook = player addAction [localize "str_actions_self_05", "\z\addons\dayz_code\actions\cook.sqf",_cursorTarget, 3, true, true];
            };
        }; 
    //Boil Water
        if (_hastinitem && _hasbottleitem && !a_player_boil) then {
            if (s_player_boil < 0) then {
                s_player_boil = player addAction [localize "str_actions_boilwater", "\z\addons\dayz_code\actions\boil.sqf",_cursorTarget, 3, true, true];
            };
        };
    } else {
        if (a_player_cooking) then {
            player removeAction s_player_cook;
            s_player_cook = -1;
        };
        if (a_player_boil) then {
            player removeAction s_player_boil;
            s_player_boil = -1;
        };
    };
    
//    Not needed.
/*
    if(_cursorTarget == dayz_hasFire) then {
        if ((s_player_fireout < 0) && !(_cursorTarget call isInflamed) && (player distance _cursorTarget < 3)) then {
            s_player_fireout = player addAction [localize "str_actions_self_06", "\z\addons\dayz_code\actions\fire_pack.sqf",_cursorTarget, 0, false, true];
        };
    } else {
        player removeAction s_player_fireout;
        s_player_fireout = -1;
    };
*/
    if (_isAlive) then {
        //Allow player to delete objects
        if (_isDestructable || {((_typeOfCursorTarget in DZE_isWreck) or (_typeOfCursorTarget in DZE_isWreckBuilding))} || {(_typeOfCursorTarget in DZE_isRemovable)}) then {
            if (_hasToolbox && _hasCrowbar) then {
                _player_deleteBuild = true;
            };
        };    

        if (_isModular || _isModularDoor || _isGenerator || {_typeOfCursorTarget in DZE_isDestroyableStorage}) then {
            if (_hasToolbox && _hasCrowbar) then {
                _hasAccess = [player, _cursorTarget] call FNC_check_access;
                if ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) then {
                    _player_deleteBuild = true;
                };
            };
        };
        
        if (_isVehicle) then {
            if ((_characterID != "0") && {!_isMan}) then {
                _player_lockUnlock_crtl = true;
            };
        };
    };
    
    if (_player_deleteBuild) then {
        if (s_player_deleteBuild < 0) then {
            s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, false, true];
        };
    } else {
        player removeAction s_player_deleteBuild;
        s_player_deleteBuild = -1;
    };

    //remove Own objects
    if (_ownerID == _id) then {
        //upgrade items
        if (_typeOfCursorTarget in _upgradeItems) then {
            if (s_player_upgradestorage < 0) then {
                if (isText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "Upgrade" >> "create")) then {
                    _displayName = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName");
                    s_player_upgradestorage = player addAction [format[localize "str_upgrade",_displayName], "\z\addons\dayz_code\actions\object_upgradeStorage.sqf",_cursorTarget, 0, false, true];
                };
            };
        } else {
            player removeAction s_player_upgradestorage;
            s_player_upgradestorage = -1
        };
        if (_istypeTent) then {
            //Packing my tent
            if (s_player_packtent < 0) then {
                s_player_packtent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, false, true];
            };
        } else {
            player removeAction s_player_packtent;
            s_player_packtent = -1;
        };
    } else {
        player removeAction s_player_upgradestorage;
        s_player_upgradestorage = -1;
        player removeAction s_player_packtent;
        s_player_packtent = -1;
    };
    //other tents
    if (_istypeTent) then {
        //destroy tents
        //Located in variables Dayz_Ignators = ["ItemMatchbox","Item5Matchbox","Item4Matchbox","Item3Matchbox","Item2Matchbox","Item1Matchbox"];
        _hasIgnators = {_x in Dayz_Ignators} count _itemsPlayer > 0;
        if ((_hasFuel20 or _hasFuel5 or _hasBarrel) && _hasIgnators) then {
            if (s_player_destorytent < 0) then {
                s_player_destorytent = player addAction [localize "str_actions_self_destorytent", "\z\addons\dayz_code\actions\player_destroyTent.sqf",_cursorTarget, 0, false, true];
            };
        } else {
            player removeAction s_player_destorytent;
            s_player_destorytent = -1;
        };    
        if (_typeOfCursorTarget in ["IC_DomeTent","IC_Tent"]) then {
            if (s_player_packtentinfected < 0) then {
                s_player_packtentinfected = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, false, true];
            };
        } else {
            player removeAction s_player_packtentinfected;
            s_player_packtentinfected = -1;
        };
        //sleep
        if (s_player_sleep < 0) then {
            s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",_cursorTarget, 0, false, true];
        };
    } else {
        player removeAction s_player_sleep;
        s_player_sleep = -1;
    };
/*    
    //Carbomb
    _hasCarBomb = "ItemCarBomb" in _magazinesPlayer;
    if (((_cursorTarget isKindOf "Car") || (_cursorTarget isKindOf "Air") || (_cursorTarget isKindOf "Motorcycle")) && _hasCarBomb) then {
        if (s_player_attach_bomb < 0) then {
            s_player_attach_bomb = player addAction [localize "str_bombAttach", "\z\addons\dayz_code\actions\player_attach_bomb.sqf",_cursorTarget, 3, true, true];
        };
    } else {
            player removeAction s_player_attach_bomb;
            s_player_attach_bomb = -1;
    };
*/
    //Repairing Vehicles
    if (_isVehicle && {!_isMan} && {dayz_myCursorTarget != _cursorTarget} && {_hasToolbox} && {damage _cursorTarget < 1} && {_typeOfCursorTarget != "M240Nest_DZ"}) then {
        if (s_player_repair_crtl < 0) then {
            dayz_myCursorTarget = _cursorTarget;
            _menu = dayz_myCursorTarget addAction [localize "str_actions_repairveh", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false];
            if (!_isBicycle) then { //Bike wheels should not give full size tires. Also model does not update to show removed wheels.
                if (!DZE_salvageLocked) then {
                    if (!locked _cursorTarget) then {
                        _menu1 = dayz_myCursorTarget addAction [localize "str_actions_salvageveh", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false];
                        s_player_repairActions set [count s_player_repairActions,_menu1];
                    };
                } else {
                    _menu1 = dayz_myCursorTarget addAction [localize "str_actions_salvageveh", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false];
                    s_player_repairActions set [count s_player_repairActions,_menu1];
                };
            };
            s_player_repairActions set [count s_player_repairActions,_menu];
            s_player_repair_crtl = 1;
        } else {
            {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;
            s_player_repairActions = [];
            s_player_repair_crtl = -1;
        };
    };
    /* //Vanilla base building currently not used in Epoch
    // House locking and unlocking
    _isHouse = _typeOfCursorTarget in ["SurvivorWorkshopAStage5", "SurvivorWorkshopBStage5", "SurvivorWorkshopCStage5"];
    _isGate = _typeOfCursorTarget in ["WoodenGate_1","WoodenGate_2","WoodenGate_3","WoodenGate_4","MetalGate_1","MetalGate_2","MetalGate_3","MetalGate_4"];
    _isFence = _typeOfCursorTarget in ["WoodenFence_1","WoodenFence_2","WoodenFence_3","WoodenFence_4","WoodenFence_5","WoodenFence_6","MetalFence_1","MetalFence_2","MetalFence_3","MetalFence_4","MetalFence_5","MetalFence_6","MetalFence_7"];

    //Only the owners can lock the gates
    _isLockableGate = _typeOfCursorTarget in ["WoodenGate_2","WoodenGate_3","WoodenGate_4","MetalGate_2","MetalGate_3","MetalGate_4"];
    _isUnlocked = _cursorTarget getVariable ["isOpen","0"] == "1";

    //Allow the gates to be opened when not locked by anyone
    _isOpen = ((_cursorTarget animationPhase "DoorL") == 1) || ((_cursorTarget animationPhase "DoorR") == 1);
    _isClosed = ((_cursorTarget animationPhase "DoorL") == 0) || ((_cursorTarget animationPhase "DoorR") == 0);
    
    //[["ownerArray",["PID"]]]
    _ownerArray = _cursorTarget getVariable ["ownerArray",["0"]];
    _ownerBuildLock = _cursorTarget getVariable ["BuildLock",false];    
    _ownerPID = (_ownerArray select 0);
    
    // open Gate
    if (_isGate && _isClosed && _isUnlocked) then {
        if (s_player_openGate < 0) then {
            s_player_openGate = player addAction [localize "STR_DN_OUT_O_GATE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Open"], 1, true, true];
        };
    } else {
        player removeAction s_player_openGate;
        s_player_openGate = -1;
    };
    // Close Gate
    if (_isGate && _isOpen && _isUnlocked) then {
        if (s_player_CloseGate < 0) then {
            s_player_CloseGate = player addAction [localize "STR_DN_OUT_C_GATE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Close"], 1, true, true];
        };
    } else {
        player removeAction s_player_CloseGate;
        s_player_CloseGate = -1;
    };
    // Set
    if ((_isHouse or _isLockableGate) && (_ownerPID == _uid) && !_isUnlocked && _isClosed) then {
        if (s_player_setCode < 0) then {
            s_player_setCode = player addAction [localize "STR_BLD_ACTIONS_SETLOCKCODE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Set"], 1, true, true];
        };
    } else {
        player removeAction s_player_setCode;
        s_player_setCode = -1;
    };
    //Lock Build point
    if ((_isFence or _isGate) && (_ownerPID == _uid) && !_ownerBuildLock) then {
        if (s_player_BuildLock < 0) then {
            s_player_BuildLock = player addAction [localize "STR_BLD_ACTIONS_LOCKBUILD", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"BuildLock"], 1, true, true];
        };
    } else {
        player removeAction s_player_BuildLock;
        s_player_BuildLock = -1;
    };
    //UnLock Build point
    if ((_isFence or _isGate) && (_ownerPID == _uid) && _ownerBuildLock) then {
        if (s_player_BuildUnLock < 0) then {
            s_player_BuildUnLock = player addAction [localize "STR_BLD_ACTIONS_UNLOCKBUILD", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"BuildUnLock"], 1, true, true];
        };
    } else {
        player removeAction s_player_BuildUnLock;
        s_player_BuildUnLock = -1;
    };
    // Unlock Gate/House
    if ((_isHouse or _isLockableGate) && !_isUnlocked && _isClosed) then {
        if (s_player_unlockhouse < 0) then {
            s_player_unlockhouse = player addAction [localize "STR_BLD_ACTIONS_UNLOCKGATE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Unlock"], 1, true, true];
        };
    } else {
        player removeAction s_player_unlockhouse;
        s_player_unlockhouse = -1;
    };
    // Lock Gate/House
    if ((_isHouse or _isLockableGate) && _isUnlocked && _isClosed) then {
        if (s_player_lockhouse < 0) then {
            s_player_lockhouse = player addAction [localize "STR_BLD_ACTIONS_LOCKGATE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Lock"], 1, true, true];
        };
    } else {
        player removeAction s_player_lockhouse;
        s_player_lockhouse = -1;
    };
    //Break In
    if ((_isHouse or _isLockableGate) && (_ownerPID != _uid) && !_isUnlocked) then {
        if (s_player_breakinhouse < 0) then {
            s_player_breakinhouse = player addAction [localize "STR_BLD_ACTIONS_BREAKIN", "\z\addons\dayz_code\actions\player_breakin.sqf",_cursorTarget, 1, true, true];
        };
    } else {
        player removeAction s_player_breakinhouse;
        s_player_breakinhouse = -1;
    };*/
    
    // garage
    if (_typeOfCursorTarget in DZE_Garage && {speed player <= 1}) then {
        _hasAccess = [player, _cursorTarget] call FNC_check_access;
        _allowed = ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3) or (_hasAccess select 4));
        if ((s_player_garage < 0) && (_allowed or (_hasAccess select 1))) then {
            s_player_garage =  player addAction ["<t color='#FFAA00'>Garage Menu</t>", "custom\Garage\player_virtualgarage.sqf", _cursorTarget, 2, false];
        } else {
            s_player_garage = player addAction ["<t color='#FF0000'>Garage Locked</t>", "",_cursorTarget, 2, true, true, "", ""];   
        };
    } else {
        player removeAction s_player_garage;
        s_player_garage = -1;       
    };
    
    
    if ((_cursorTarget isKindOf "Plastic_Pole_EP1_DZ") && {speed player <= 1}) then {
        _hasAccess = [player, _cursorTarget] call FNC_check_access;
        _allowed = ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3) or (_hasAccess select 4));
        if (DZE_permanentPlot) then {
            if (s_player_plotManagement < 0 && _allowed) then {
                s_player_plotManagement = player addAction [format["<t color='#0059FF'>%1</t>",localize "STR_EPOCH_ACTIONS_MANAGEPLOT"], "\z\addons\dayz_code\actions\plotManagement\initPlotManagement.sqf", [], 5, false];
            };
        } else {
            if (s_player_maintain_area < 0) then {
                s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", "maintain", 5, false];
                s_player_maintain_area_force = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_FORCE_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", "force", 5, false];
                s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\maintain_area.sqf", "preview", 5, false];
            };
        };
        if (s_player_plot_boundary < 0 && (_allowed or (_hasAccess select 1))) then {
            s_player_plot_boundary = player addAction [localize "STR_EPOCH_PLOTMANAGEMENT_SHOW_BOUNDARY", "\z\addons\dayz_code\actions\plotManagement\plotToggleMarkers.sqf", "", 1, false];
        };
        if (DZE_permanentPlot && DZE_PlotOwnership) then {
            if (s_player_plot_take_ownership < 0 && (_hasAccess select 0)) then {
                s_player_plot_take_ownership = player addAction [localize "STR_EPOCH_APLOTFORLIFE_TAKE_PLOT_OWNERSHIP", "\z\addons\dayz_code\actions\plot_take_ownership.sqf", "", 1, false];
            };
        };
    } else {
        player removeAction s_player_plotManagement;
        s_player_plotManagement = -1;
        player removeAction s_player_maintain_area;
        s_player_maintain_area = -1;
        player removeAction s_player_maintain_area_force;
        s_player_maintain_area_force = -1;
        player removeAction s_player_maintain_area_preview;
        s_player_maintain_area_preview = -1;
        player removeAction s_player_plot_boundary;
        s_player_plot_boundary = -1;
        player removeAction s_player_plot_take_ownership;
        s_player_plot_take_ownership = -1;
    };
    
    if (DZE_HeliLift) then {
        _liftHeli = objNull;
        _found = false;    
        _allowTow = false;
        if ((count (crew _cursorTarget)) == 0) then {
            {
                if (!_allowTow) then {
                    _allowTow = _cursorTarget isKindOf _x;
                };
            } count DZE_HeliAllowToTow;
        };

        if (_allowTow) then {
            {
                if (!_found) then {
                    _posL = [_x] call FNC_getPos;
                    _posC = [_cursorTarget] call FNC_getPos;
                    _height = (_posL select 2) - (_posC select 2);
                    _hasAttached = _x getVariable["hasAttached",false];
                    if ((_height < 15) && {_height > 5} && {typeName _hasAttached != "OBJECT"}) then {
                        if (((abs((_posL select 0) - (_posC select 0))) < 10) && {(abs((_posL select 1) - (_posC select 1))) < 10}) then {
                            _liftHeli = _x;
                            _found = true;
                        };
                    };
                };
            } count (player nearEntities [DZE_HeliAllowTowFrom,15]);
        };

        _attached = _cursorTarget getVariable["attached",false];
        if (_found && {_allowTow} && {!locked _cursorTarget} && {!_isPZombie} && {typeName _attached != "OBJECT"}) then {
            if (s_player_heli_lift < 0) then {
                s_player_heli_lift = player addAction [localize "STR_EPOCH_ACTIONS_ATTACHTOHELI", "\z\addons\dayz_code\actions\player_heliLift.sqf",[_liftHeli,_cursorTarget], -10, false, true];
            };
        } else {
            player removeAction s_player_heli_lift;
            s_player_heli_lift = -1;
        };
    };
    
    // Allow Owner to lock and unlock vehicle  
    if (_player_lockUnlock_crtl) then {
        if (s_player_lockUnlock_crtl < 0) then {
            _totalKeys = call epoch_tempKeys;
            _temp_keys = _totalKeys select 0;
            _temp_keys_names = _totalKeys select 1;
            _hasKey = _characterID in _temp_keys;
            _oldOwner = (_characterID == _uid);
            if (locked _cursorTarget) then {
                if (_hasKey || _oldOwner) then {
                    _unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",[_cursorTarget,(_temp_keys_names select (parseNumber _characterID))], 2, true, true];
                    s_player_lockunlock set [count s_player_lockunlock,_unlock];
                    s_player_lockUnlock_crtl = 1;
                } else {
                    if (_hasHotwireKit) then {
                        _unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",_cursorTarget, 2, true, true];
                    } else {
                        _unlock = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",_cursorTarget, 2, false, true];
                    };
                    s_player_lockunlock set [count s_player_lockunlock,_unlock];
                    s_player_lockUnlock_crtl = 1;
                };
            } else {
                if (_hasKey || _oldOwner) then {
                    _lock = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true];
                    s_player_lockunlock set [count s_player_lockunlock,_lock];
                    s_player_lockUnlock_crtl = 1;
                };
            };
        };     
    } else {
        {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
        s_player_lockUnlock_crtl = -1;
    };
    
    // gear access on surrendered player
    if (isPlayer _cursorTarget && {_isAlive} && {_cursorTarget getVariable ["DZE_Surrendered",false]}) then {
        if (s_player_SurrenderedGear < 0) then {
            s_player_SurrenderedGear = player addAction [localize "STR_UI_GEAR", "\z\addons\dayz_code\actions\surrender_gear.sqf",_cursorTarget, 1, true, true];
        };
    } else {
        player removeAction s_player_SurrenderedGear;
        s_player_SurrenderedGear = -1;
    };

    // Allow manage door
    if (DZE_doorManagement && (_typeOfCursorTarget in DZE_DoorsLocked)) then {
        // Check player access
        _hasAccess = [player, _cursorTarget] call FNC_check_access;
        if (s_player_manageDoor < 0 && ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3) or (_hasAccess select 4) or (_hasAccess select 5) or (_hasAccess select 6))) then {
            s_player_manageDoor = player addAction [format["<t color='#0059FF'>%1</t>", localize "STR_EPOCH_ACTIONS_MANAGEDOOR"], "\z\addons\dayz_code\actions\doorManagement\initDoorManagement.sqf", _cursorTarget, 5, false];
        };
    } else {
        player removeAction s_player_manageDoor;
        s_player_manageDoor = -1;
    };

    //Allow owner to unlock vault
    if ((_typeOfCursorTarget in DZE_LockableStorage) && {_characterID != "0"} && {player distance _cursorTarget < 3} && {!keypadCancel}) then {
        if (s_player_unlockvault < 0) then {
            if (_typeOfCursorTarget in DZE_LockedStorage) then {
                if (_characterID == dayz_combination || _ownerID == _uid) then {
                    _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_OPEN",_text], "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, false, true];
                    s_player_combi set [count s_player_combi,_combi];
                } else {
                    _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true];
                    s_player_combi set [count s_player_combi,_combi];
                };
                s_player_unlockvault = 1;
            } else {
                if (_characterID != dayz_combination && _ownerID != _uid) then {
                    _combi = player addAction [localize "STR_EPOCH_ACTIONS_RECOMBO", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true];
                    s_player_combi set [count s_player_combi,_combi];
                    s_player_unlockvault = 1;
                };
            };
        };
    } else {
        {player removeAction _x} count s_player_combi;s_player_combi = [];
        s_player_unlockvault = -1;
    };

    //Allow owner to pack vault
    if ((_typeOfCursorTarget in DZE_UnLockedStorage) && {_characterID != "0"} && {player distance _cursorTarget < 3}  && {!keypadCancel}) then {
        if (s_player_lockvault < 0) then {
            if (_characterID == dayz_combination || _ownerID == _uid) then {
                s_player_lockvault = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\vault_lock.sqf",_cursorTarget, 0, false, true];
            };
        };
        if (s_player_packvault < 0 && (_characterID == dayz_combination || _ownerID == _uid)) then {
            s_player_packvault = player addAction [format["<t color='#ff0000'>%1</t>",(format[localize "STR_EPOCH_ACTIONS_PACK",_text])], "\z\addons\dayz_code\actions\vault_pack.sqf",_cursorTarget, 0, false, true];
        };
    } else {
        player removeAction s_player_packvault;
        s_player_packvault = -1;
        player removeAction s_player_lockvault;
        s_player_lockvault = -1;
    };

    //Player Deaths
    if (_typeOfCursorTarget == "Info_Board_EP1") then {
        if (s_player_information < 0) then {
            s_player_information = player addAction [localize "STR_EPOCH_ACTIONS_MURDERS", "\z\addons\dayz_code\actions\list_playerDeaths.sqf",[], 7, false, true];
        };
    } else {
        player removeAction s_player_information;
        s_player_information = -1;
    };
    
    //Fuel Pump
    if (_typeOfCursorTarget in dayz_fuelpumparray) then {
        if (s_player_fuelauto < 0) then {        
            // check if Generator_DZ is running within 30 meters
            _findNearestGen = [];
            {
                if ((alive _x) && (_x getVariable ["GeneratorRunning", false])) then {
                    _findNearestGen set [count _findNearestGen,_x];
                };
            } count (nearestObjects [([player] call FNC_getPos), ["Generator_DZ"], 30]);
            
            // show that pump needs power if no generator nearby.
            if ((count _findNearestGen) > 0) then {
                s_player_fuelauto = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",objNull, 0, false, true];
            } else {
                s_player_fuelauto = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true];
            };
        };
    } else {
        player removeAction s_player_fuelauto;
        s_player_fuelauto = -1;
    };

    //Fuel Pump on truck
    if (_typeOfCursorTarget in DZE_fueltruckarray && _isAlive) then {
        if (s_player_fuelauto2 < 0) then {
            // show that fuel truck pump needs power.
            if (isEngineOn _cursorTarget) then {
                s_player_fuelauto2 = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",_cursorTarget, 0, false, true];
            } else {
                s_player_fuelauto2 = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true];
            };
        };
    } else {
        player removeAction s_player_fuelauto2;
        s_player_fuelauto2 = -1;
    };

    // inplace upgrade tool
    if ((_cursorTarget isKindOf "ModularItems") || (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") || (_cursorTarget isKindOf "CinderWallDoor_DZ_Base")) then {
        if ((s_player_lastTarget select 0) != _cursorTarget) then {
            if (s_player_upgrade_build > 0) then {
                player removeAction s_player_upgrade_build;
                s_player_upgrade_build = -1;
            };
        };
        if (s_player_upgrade_build < 0) then {
            _hasAccess = [player, _cursorTarget] call FNC_check_access;
            _upgrade = getArray (configFile >> "CfgVehicles" >> (typeOf _cursorTarget) >> "upgradeBuilding");
            if (((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) && (count _upgrade) > 0) then {
                s_player_lastTarget set [0,_cursorTarget];
                s_player_upgrade_build = player addAction [format[localize "str_upgrade",_text], "\z\addons\dayz_code\actions\player_upgrade.sqf",_cursorTarget, -1, false, true];
            };
        };
    } else {
        player removeAction s_player_upgrade_build;
        s_player_upgrade_build = -1;
    };
    
    // downgrade system
    if ((DZE_Lock_Door == _characterID)  && {!keypadCancel} && {_isDestructable || _cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" || _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base"}) then {
        if ((s_player_lastTarget select 1) != _cursorTarget) then {
            if (s_player_downgrade_build > 0) then {    
                player removeAction s_player_downgrade_build;
                s_player_downgrade_build = -1;
            };
        };
        if (s_player_downgrade_build < 0) then {
            _hasAccess = [player, _cursorTarget] call FNC_check_access;
            if ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) then {
                s_player_lastTarget set [1,_cursorTarget];
                s_player_downgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_REMLOCK",_text], "\z\addons\dayz_code\actions\player_buildingDowngrade.sqf",_cursorTarget, -2, false, true];
            };
        };
    } else {
        player removeAction s_player_downgrade_build;
        s_player_downgrade_build = -1;
    };

    // inplace maintenance tool
    if ((damage _cursorTarget >= DZE_DamageBeforeMaint) && {_cursorTarget isKindOf "ModularItems" || _cursorTarget isKindOf "DZE_Housebase" || _typeOfCursorTarget == "LightPole_DZ"}) then {
        if ((s_player_lastTarget select 2) != _cursorTarget) then {
            if (s_player_maint_build > 0) then {
                player removeAction s_player_maint_build;
                s_player_maint_build = -1;
            };
        };
        if (s_player_maint_build < 0) then {
            _hasAccess = [player, _cursorTarget] call FNC_check_access;
            if ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) then {
                _text2 = _text + " (" + str(round ((damage _cursorTarget) * 100)) + "% damaged)";
                s_player_lastTarget set [2,_cursorTarget];
                s_player_maint_build = player addAction [format["%1 %2",localize "STR_EPOCH_ACTIONS_MAINTAIN",_text2], "\z\addons\dayz_code\actions\player_buildingMaint.sqf",_cursorTarget, -2, false, true];
            };
        };
    } else {
        player removeAction s_player_maint_build;
        s_player_maint_build = -1;
    };

    //Start Generator
    if (_isGenerator) then {
        if (s_player_fillgen < 0) then {    
            // check if not running 
            if (_cursorTarget getVariable ["GeneratorRunning", false]) then {
                s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR1", "\z\addons\dayz_code\actions\stopGenerator.sqf",_cursorTarget, 0, false, true];                
            } else {
                // check if not filled and player has jerry.
                if (_cursorTarget getVariable ["GeneratorFilled", false]) then {
                    s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR2", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true];
                } else {
                    if (_hasFuel20 or _hasFuel5 or _hasBarrel) then {
                        s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR3", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true];
                    };
                };
            };
        };
    } else {
        player removeAction s_player_fillgen;
        s_player_fillgen = -1;
    };

    //Towing with tow truck
    /*
    if(_typeOfCursorTarget == "TOW_DZE") then {
        if (s_player_towing < 0) then {
            if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
                s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_ATTACH" "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true];                
            } else {
                s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_DETACH", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true];                
            };
        };
    } else {
        player removeAction s_player_towing;
        s_player_towing = -1;
    };
    */

    // All Traders
    if (_isMan && {!(isPlayer _cursorTarget)} && {_typeOfCursorTarget in serverTraders} && {!_isPZombie}) then {
        if (s_player_parts_crtl < 0) then {
            _humanity = player getVariable ["humanity",0];
            _traderMenu = call compile format["menu_%1;",_typeOfCursorTarget];        
            _low_high = localize "STR_EPOCH_ACTIONS_HUMANITY_LOW";
            _humanity_logic = false;
            if ((_traderMenu select 2) == "friendly") then {
                _humanity_logic = (_humanity < -5000);
            };
            if ((_traderMenu select 2) == "hostile") then {
                _low_high = localize "STR_EPOCH_ACTIONS_HUMANITY_HIGH";
                _humanity_logic = (_humanity > -5000);
            };
            if ((_traderMenu select 2) == "hero") then {
                _humanity_logic = (_humanity < 5000);
            };
            if (_humanity_logic) then {
                _cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false];
                s_player_parts set [count s_player_parts,_cancel];
            } else {
                // Static Menu
                {
                    _buy = player addAction [format["Trade %1 %2 for %3 %4",(_x select 3),(_x select 5),(_x select 2),(_x select 6)], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4),(_x select 5),(_x select 6)], (_x select 7), true, true];
                    s_player_parts set [count s_player_parts,_buy];        
                } count (_traderMenu select 1);
                if (DZE_ConfigTrader) then {
                    _buyV = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\AdvancedTrading\init.sqf",(_traderMenu select 0), 999, true, false];
                    s_player_parts set [count s_player_parts,_buyV];
                } else {
                    // Database menu
                    _buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu select 0), 999, true, false];
                    s_player_parts set [count s_player_parts,_buy];
                };
            };
            s_player_parts_crtl = 1;    
        };
    } else {
        {player removeAction _x} count s_player_parts;s_player_parts = [];
        s_player_parts_crtl = -1;
    };
    
    if (dayz_tameDogs) then {
        //Dog
        _hasRawMeat = {_x in Dayz_meatraw} count _magazinesPlayer > 0;
        if (_isDog && {_hasRawMeat} && {_isAlive} && {_ownerID == "0"} && {player getVariable ["dogID",0] == 0}) then {
            if (s_player_tamedog < 0) then {
                s_player_tamedog = player addAction [localize "str_actions_tamedog", "\z\addons\dayz_code\actions\dog\tame_dog.sqf", _cursorTarget, 1, false, true];
            };
        } else {
            player removeAction s_player_tamedog;
            s_player_tamedog = -1;
        };
        if (_isDog && {_ownerID == _id} && {_isAlive}) then {
            if (s_player_feeddog < 0 && _hasRawMeat) then {
                s_player_feeddog = player addAction [localize "str_actions_feeddog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,0], 0, false, true];
            };
            if (s_player_waterdog < 0 && _hasbottleitem) then {
                s_player_waterdog = player addAction [localize "str_actions_waterdog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,1], 0, false, true];
            };
            if (s_player_staydog < 0) then {
                if (_dogHandle getFSMVariable "_actionLieDown") then { _text = "str_actions_liedog"; } else { _text = "str_actions_sitdog"; };
                s_player_staydog = player addAction [localize _text,"\z\addons\dayz_code\actions\dog\stay.sqf", _dogHandle, 5, false, true];
            };
            if (s_player_trackdog < 0) then {
                s_player_trackdog = player addAction [localize "str_actions_trackdog","\z\addons\dayz_code\actions\dog\track.sqf", _dogHandle, 4, false, true];
            };
            if (s_player_barkdog < 0) then {
                s_player_barkdog = player addAction [localize "str_actions_barkdog","\z\addons\dayz_code\actions\dog\speak.sqf", _cursorTarget, 3, false, true];
            };
            if (s_player_warndog < 0) then {
                _warn = _dogHandle getFSMVariable "_watchDog";
                if (_warn) then { _text = localize "str_epoch_player_247"; _warn = false; } else { _text = localize "str_epoch_player_248"; _warn = true; };
                s_player_warndog = player addAction [format[localize "str_actions_warndog",_text],"\z\addons\dayz_code\actions\dog\warn.sqf",[_dogHandle, _warn], 2, false, true];        
            };
            if (s_player_followdog < 0) then {
                s_player_followdog = player addAction [localize "str_actions_followdog","\z\addons\dayz_code\actions\dog\follow.sqf",[_dogHandle,true], 6, false, true];
            };
        } else {
            player removeAction s_player_feeddog;
            s_player_feeddog = -1;
            player removeAction s_player_waterdog;
            s_player_waterdog = -1;
            player removeAction s_player_staydog;
            s_player_staydog = -1;
            player removeAction s_player_trackdog;
            s_player_trackdog = -1;
            player removeAction s_player_barkdog;
            s_player_barkdog = -1;
            player removeAction s_player_warndog;
            s_player_warndog = -1;
            player removeAction s_player_followdog;
            s_player_followdog = -1;
        };
    };
} else {
    //Engineering
    player removeAction s_player_plot_boundary;
    s_player_plot_boundary = -1;
    player removeAction s_player_plot_take_ownership;
    s_player_plot_take_ownership = -1;
    player removeAction s_player_plotManagement;
    s_player_plotManagement = -1;
    {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
    player removeAction s_player_repair_crtl;
    s_player_repair_crtl = -1;
    dayz_myCursorTarget = objNull;
    player removeAction s_player_flipveh;
    s_player_flipveh = -1;
    player removeAction s_player_sleep;
    s_player_sleep = -1;
    player removeAction s_player_deleteBuild;
    s_player_deleteBuild = -1;
    player removeAction s_player_cook;
    s_player_cook = -1;
    player removeAction s_player_boil;
    s_player_boil = -1;
    player removeAction s_player_fireout;
    s_player_fireout = -1;
    player removeAction s_player_packtent;
    s_player_packtent = -1;
    player removeAction s_player_packtentinfected;
    s_player_packtentinfected = -1;
    player removeAction s_player_fillfuel;
    s_player_fillfuel = -1;
    //fuel
    
    // garage
    player removeAction s_player_garage;
    s_player_garage = -1;
    
    player removeAction s_player_fillfuel210;
    s_player_fillfuel210 = -1;
    player removeAction s_player_fillfuel20;
    s_player_fillfuel20 = -1;
    player removeAction s_player_fillfuel5;
    s_player_fillfuel5 = -1;
    //Allow player to siphon vehicle fuel
    player removeAction s_player_siphonfuel;
    s_player_siphonfuel = -1;
    //Allow player to gather
    player removeAction s_player_gather;
    s_player_gather = -1;
    player removeAction s_player_destorytent;
    s_player_destorytent = -1;
    // player removeAction s_player_attach_bomb;
    //  s_player_attach_bomb = -1;
    //debug
    //player removeAction s_player_debugCheck;
    //s_player_debugCheck = -1;
    player removeAction s_player_upgradestorage;
    s_player_upgradestorage = -1;
    /* //Unlock,Lock // Vanilla base building currently not used in Epoch
    player removeAction s_player_setCode;
    s_player_setCode = -1;
    player removeAction s_player_lockhouse;
    s_player_lockhouse = -1;
    player removeAction s_player_unlockhouse;
    s_player_unlockhouse = -1;
    player removeAction s_player_openGate;
    s_player_openGate = -1;
    player removeAction s_player_CloseGate;
    s_player_CloseGate = -1;
    player removeAction s_player_breakinhouse;
    s_player_breakinhouse = -1;
    player removeAction s_player_BuildUnLock;
    s_player_BuildUnLock = -1;
    player removeAction s_player_BuildLock;
    s_player_BuildLock = -1;*/
    {player removeAction _x} count s_player_combi;s_player_combi = [];    
    s_player_lastTarget = [objNull,objNull,objNull,objNull,objNull];
    {player removeAction _x} count s_player_parts;s_player_parts = [];
    s_player_parts_crtl = -1;
    {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
    s_player_lockUnlock_crtl = -1;
    player removeAction s_player_SurrenderedGear;
    s_player_SurrenderedGear = -1;
    player removeAction s_player_maintain_area;
    s_player_maintain_area = -1;
    player removeAction s_player_maintain_area_force;
    s_player_maintain_area_force = -1;
    player removeAction s_player_maintain_area_preview;
    s_player_maintain_area_preview = -1;    
    player removeAction s_player_tamedog;
    s_player_tamedog = -1;
    player removeAction s_player_feeddog;
    s_player_feeddog = -1;
    player removeAction s_player_waterdog;
    s_player_waterdog = -1;
    player removeAction s_player_staydog;
    s_player_staydog = -1;
    player removeAction s_player_trackdog;
    s_player_trackdog = -1;
    player removeAction s_player_barkdog;
    s_player_barkdog = -1;
    player removeAction s_player_warndog;
    s_player_warndog = -1;
    player removeAction s_player_followdog;
    s_player_followdog = -1;
    player removeAction s_player_unlockvault;
    s_player_unlockvault = -1;
    player removeAction s_player_packvault;
    s_player_packvault = -1;
    player removeAction s_player_lockvault;
    s_player_lockvault = -1;
    player removeAction s_player_information;
    s_player_information = -1;
    player removeAction s_player_fillgen;
    s_player_fillgen = -1;
    player removeAction s_player_upgrade_build;
    s_player_upgrade_build = -1;
    player removeAction s_player_maint_build;
    s_player_maint_build = -1;
    player removeAction s_player_downgrade_build;
    s_player_downgrade_build = -1;
    player removeAction s_player_towing;
    s_player_towing = -1;
    player removeAction s_player_fuelauto;
    s_player_fuelauto = -1;
    player removeAction s_player_fuelauto2;
    s_player_fuelauto2 = -1;
    player removeAction s_player_manageDoor;
    s_player_manageDoor = -1;
};

//Dog actions on player self
if (_dogHandle > 0) then {
    _dog = _dogHandle getFSMVariable "_dog";
    if (isNil "_dog") exitWith {};
    if (isNil "_ownerID") then {_ownerID = "0"};
    if (_canDo && !_inVehicle && alive _dog && !(_ownerID in [dayz_characterID,_uid])) then {
        if (s_player_movedog < 0) then {
            s_player_movedog = player addAction [localize "str_actions_movedog", "\z\addons\dayz_code\actions\dog\move.sqf", player getVariable ["dogID",0], 1, false, true];
        };
        if (s_player_speeddog < 0) then {
            _text = localize "str_epoch_player_249";
            _speed = 0;
            if (_dog getVariable ["currentSpeed",1] == 0) then { _speed = 1; _text = localize "str_epoch_player_250"; };
            s_player_speeddog = player addAction [format[localize "str_actions_speeddog", _text], "\z\addons\dayz_code\actions\dog\speed.sqf",[player getVariable ["dogID",0],_speed], 0, false, true];
        };
        if (s_player_calldog < 0) then {
            s_player_calldog = player addAction [localize "str_actions_calldog", "\z\addons\dayz_code\actions\dog\follow.sqf", [player getVariable ["dogID",0], true], 2, false, true];
        };
    };
} else {
    player removeAction s_player_movedog;        
    s_player_movedog = -1;
    player removeAction s_player_speeddog;
    s_player_speeddog = -1;
    player removeAction s_player_calldog;
    s_player_calldog = -1;
};

//Monitor
player setVariable ["selfActions", diag_ticktime, false];


 



Now i can confirm that it is perfectly saving vehicles in the database (in the garage) just fine and pulling them back out just fine and sticking on restarts. 
Here lies the problem when you click manage and add yourself to the garage list it is not saving in the database 
I think i know where this error is but i cant seem to figure out what is wrong with the snippet of code i modified to attempt to get this working

Below is line 135 that i modified for this in server updateobject


_object_damage = {
    //Allow dmg process
    private ["_hitpoints","_array","_hit","_selection","_key","_damage","_allFixed"];
    
    // garage
    if ((typeOf _object) in DZE_Garage) then {
            _damage = damage _object;
            _array = _object getVariable ["GarageFriends",[]];
    } else {
    
    _hitpoints = _object call vehicle_getHitpoints;
    _damage = damage _object;
    _array = [];
    _allFixed = true;
    
    {
        _hit = [_object,_x] call object_getHit;
        _selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");
        if (_hit > 0) then {
            _allFixed = false;
            _array set [count _array,[_selection,_hit]];
            //diag_log format ["Section Part: %1, Dmg: %2",_selection,_hit]; 
        } else {
            _array set [count _array,[_selection,0]]; 
        };
        } forEach _hitpoints;
    };
    if (_allFixed && !_totalDmg) then {_object setDamage 0;};
    
    if (_forced) then {        
        if (_object in needUpdate_objects) then {needUpdate_objects = needUpdate_objects - [_object];};
        _recorddmg = true;           
    } else {
        //Prevent damage events for the first 10 seconds of the servers live.
        if (diag_ticktime - _lastUpdate > 10) then {
            if !(_object in needUpdate_objects) then {
                //diag_log format["DEBUG: Monitoring: %1",_object];
                needUpdate_objects set [count needUpdate_objects, _object];
                _recorddmg = true;
            };
        };
    };
    



Any help would be greatly appreciated thanks guys

Link to comment
Share on other sites

Recommended Posts

  • 0

I could only get my garage friends to work by doing this:

in updateObject change your:

if ((typeOf _object) in DZE_Garage) then {
            _damage = damage _object;
            _array = _object getVariable ["GarageFriends",[]];
    } else {

to:

if ((typeOf _object) in DZE_Garage) then {
            _damage = damage _object;
            _array = _object getVariable ["GarageFriends",[]];
            _key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];
            _key call server_hiveWrite;
    } else {

-----------------------------------------------------------------------------------------------------------------------------------------------------

About your addaction problem, not sure but i have just modified yours to match mine with the removeaction, no idea if it works, there wasnt anything wrong with yours tbh.

http://pastebin.com/hLf53fCX

I would recomend check your client RPT if the _hasAccess and _allowed aren't throwing errors.

also add: s_player_garage = -1;

in to the dayz_resetselfactions section in your variables.sqf

Link to comment
Share on other sites

  • 0
15 hours ago, juandayz said:

and you already define your DZE_Garage in custom variables.sqf ?

Garageobjects = ["All items ids for this mod",""];

DayZ_SafeObjects = Garageobjects + ["default objects id"];

DZE_Garage = Garageobjects;

 

 

 

 

 

 

Thanks guys for the replies but nothing im trying is getting me anywhere at all

variables.sqf


disableSerialization;

// garage
DZE_Garage = ["Garbage_container"];

//Model Variables
Bandit1_DZ = "Bandit1_DZ";
BanditW1_DZ = "BanditW1_DZ";
Survivor1_DZ = "Survivor1_DZ";
Survivor2_DZ = "Survivor2_DZ";
SurvivorW2_DZ = "SurvivorW2_DZ";
Sniper1_DZ = "Sniper1_DZ";
Camo1_DZ = "Camo1_DZ";
Soldier1_DZ = "Soldier1_DZ";
Rocket_DZ = "Rocket_DZ";
// EPOCH ADDITIONS
Bandit2_DZ = "Bandit2_DZ";
BanditW2_DZ = "BanditW2_DZ";
SurvivorW3_DZ = "SurvivorW2_DZ";

//Rolling Msg system
Message_1 = "";
Message_2 = "";
Message_3 = "";
Message_1_time = 0;
Message_2_time = 0;
Message_3_time = 0;
//Kill Feed
death_1 = "";
death_2 = "";
death_3 = "";
death_4 = "";
death_1_time = 0;
death_2_time = 0;
death_3_time = 0;
death_4_time = 0;

//OpenTarget timer
OpenTarget_Time = 0;

///Player classes
AllPlayers = ["Survivor_DZ","Survivor1_DZ","SurvivorW2_DZ","Survivor2_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","BanditW1_DZ","Bandit1_DZ","Survivor3_DZ","SurvivorWcombat_DZ","SurvivorWdesert_DZ","SurvivorWurban_DZ","SurvivorWsequishaD_DZ","SurvivorWsequisha_DZ","SurvivorWpink_DZ","SurvivorW3_DZ","Bandit2_DZ","BanditW2_DZ","Soldier_Crew_PMC","Rocket_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","Priest_DZ","Functionary1_EP1_DZ","GUE_Commander_DZ","Ins_Soldier_GL_DZ","Haris_Press_EP1_DZ","Pilot_EP1_DZ","RU_Policeman_DZ","pz_policeman","pz_suit1","pz_suit2","pz_worker1","pz_worker2","pz_worker3","pz_doctor","pz_teacher","pz_hunter","pz_villager1","pz_villager2","pz_villager3","pz_priest","Soldier_TL_PMC_DZ","Soldier_Sniper_PMC_DZ","Soldier_Bodyguard_AA12_PMC_DZ","Drake_Light_DZ","CZ_Special_Forces_GL_DES_EP1_DZ","TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ","FR_OHara_DZ","FR_Rodriguez_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","GUE_Soldier_MG_DZ","GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_CO_DZ","GUE_Soldier_2_DZ","TK_Special_Forces_MG_EP1_DZ","TK_Soldier_Sniper_EP1_DZ","TK_Commander_EP1_DZ","RU_Soldier_Crew_DZ","INS_Lopotev_DZ","INS_Soldier_AR_DZ","INS_Soldier_CO_DZ","INS_Bardak_DZ","INS_Worker2_DZ","USMC_Soldier_Officer_DZ","USMC_Soldier_MG_DZ","USMC_Soldier_Pilot_DZ","FR_TL_DZ","FR_R_DZ","FR_Marksman_DZ","FR_Assault_R_DZ","RU_Soldier_DZ","RU_Soldier_Officer_DZ","RUS_Soldier1_DZ","RUS_Commander_DZ","MVD_Soldier_DZ","Ins_Soldier_2_DZ","Ins_Commander_DZ","Ins_Soldier_Crew_DZ","CDF_Soldier_DZ","Doctor_DZ","Assistant_DZ","Worker1_DZ","Worker3_DZ","Worker4_DZ","TK_CIV_Takistani01_EP1_DZ","TK_CIV_Takistani03_EP1_DZ","TK_CIV_Takistani04_EP1_DZ","TK_CIV_Takistani06_EP1_DZ","TK_INS_Soldier_AR_EP1_DZ","TK_GUE_Soldier_EP1_DZ","CZ_Soldier_SL_DES_EP1_DZ","US_Soldier_EP1_DZ","UN_CDF_Soldier_Guard_EP1_DZ","UN_CDF_Soldier_EP1_DZ","GER_Soldier_TL_EP1_DZ","BAF_Soldier_Officer_MTP_DZ","BAF_Soldier_N_MTP_DZ","FR_Sapper_DZ"];
DayZ_Male = ["Survivor_DZ","Survivor1_DZ","Survivor2_DZ","Survivor3_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","Bandit1_DZ","Bandit2_DZ","Soldier_Crew_PMC","Rocket_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","Priest_DZ","Functionary1_EP1_DZ","GUE_Commander_DZ","Ins_Soldier_GL_DZ","Haris_Press_EP1_DZ","Pilot_EP1_DZ","RU_Policeman_DZ","pz_policeman","pz_suit1","pz_suit2","pz_worker1","pz_worker2","pz_worker3","pz_doctor","pz_teacher","pz_hunter","pz_villager1","pz_villager2","pz_villager3","pz_priest","Soldier_TL_PMC_DZ","Soldier_Sniper_PMC_DZ","Soldier_Bodyguard_AA12_PMC_DZ","Drake_Light_DZ","CZ_Special_Forces_GL_DES_EP1_DZ","TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ","FR_OHara_DZ","FR_Rodriguez_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","GUE_Soldier_MG_DZ","GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_CO_DZ","GUE_Soldier_2_DZ","TK_Special_Forces_MG_EP1_DZ","TK_Soldier_Sniper_EP1_DZ","TK_Commander_EP1_DZ","RU_Soldier_Crew_DZ","INS_Lopotev_DZ","INS_Soldier_AR_DZ","INS_Soldier_CO_DZ","INS_Bardak_DZ","INS_Worker2_DZ","USMC_Soldier_Officer_DZ","USMC_Soldier_MG_DZ","USMC_Soldier_Pilot_DZ","FR_TL_DZ","FR_R_DZ","FR_Marksman_DZ","FR_Assault_R_DZ","RU_Soldier_DZ","RU_Soldier_Officer_DZ","RUS_Soldier1_DZ","RUS_Commander_DZ","MVD_Soldier_DZ","Ins_Soldier_2_DZ","Ins_Commander_DZ","Ins_Soldier_Crew_DZ","CDF_Soldier_DZ","Doctor_DZ","Assistant_DZ","Worker1_DZ","Worker3_DZ","Worker4_DZ","TK_CIV_Takistani01_EP1_DZ","TK_CIV_Takistani03_EP1_DZ","TK_CIV_Takistani04_EP1_DZ","TK_CIV_Takistani06_EP1_DZ","TK_INS_Soldier_AR_EP1_DZ","TK_GUE_Soldier_EP1_DZ","CZ_Soldier_SL_DES_EP1_DZ","US_Soldier_EP1_DZ","UN_CDF_Soldier_Guard_EP1_DZ","UN_CDF_Soldier_EP1_DZ","GER_Soldier_TL_EP1_DZ","BAF_Soldier_Officer_MTP_DZ","BAF_Soldier_N_MTP_DZ","FR_Sapper_DZ"];
DayZ_Female = ["SurvivorW2_DZ","BanditW1_DZ","BanditW2_DZ","SurvivorWcombat_DZ","SurvivorWurban_DZ","SurvivorWdesert_DZ","SurvivorWsequishaD_DZ","SurvivorWsequisha_DZ","SurvivorWpink_DZ","SurvivorW3_DZ"];

//Classnames for specific items
MeleeWeapons = ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeBaseball","MeleeBaseBallBat","MeleeBaseBallBatBarbed","MeleeBaseBallBatNails","MeleeFishingPole","MeleeSledge"];
MeleeMagazines = ["Hatchet_Swing","Crowbar_Swing","Machete_Swing","Bat_Swing","BatBarbed_Swing","BatNails_Swing","Fishing_Swing","Sledge_Swing"];
MeleeAmmo = ["Hatchet_Swing_Ammo","Crowbar_Swing_Ammo","Machete_Swing_Ammo","Bat_Swing_Ammo","BatBarbed_Swing_Ammo","BatNailed_Swing_Ammo","Fishing_Swing_Ammo","Sledge_Swing_Ammo","Chainsaw_Swing_Ammo"];
Dayz_fishingItems = ["MeleeFishingPole"];
Dayz_plants = ["Dayz_Plant1","Dayz_Plant2","Dayz_Plant3"];
Dayz_attachment_array = ["Attachment_ACG","Attachment_AIM"];
//DayZ_Tents = ["TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4","DomeTentStorage","DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DomeTentStorage4"]
//DayZ_Stashs = ["StashSmall","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3","StashMedium4"]
//DayZ_cutter = ["Wire_cat1","Sandbag1_DZ","Fence_DZ","Generator_DZ","Hedgehog_DZ","CamoNet_DZ"]
DayZ_Backpacks = ["DZ_Patrol_Pack_EP1","DZ_Assault_Pack_EP1","DZ_Czech_Vest_Pouch","DZ_ALICE_Pack_EP1","DZ_TK_Assault_Pack_EP1","DZ_British_ACU","DZ_CivilBackpack_EP1","DZ_Backpack_EP1","DZ_TerminalPack_EP1","DZ_CompactPack_EP1","DZ_GunBag_EP1","DZ_LargeGunBag_EP1"];
Dayz_Gutting = ["ItemKnife","ItemKnife5","ItemKnife4","ItemKnife3","ItemKnife2","ItemKnife1","ItemKnifeBlunt"];
Dayz_Ignators = ["ItemMatchbox","Item5Matchbox","Item4Matchbox","Item3Matchbox","Item2Matchbox","Item1Matchbox"];
DayZ_fuelCans = ["ItemJerrycan","ItemFuelcan","ItemFuelBarrel"];
DayZ_fuelCansEmpty = ["ItemJerrycanEmpty","ItemFuelcanEmpty","ItemFuelBarrelEmpty"];
DayZ_traps = ["Trap_Cans","TrapTripwireFlare","TrapBearTrapSmoke","TrapTripwireGrenade","TrapTripwireSmoke","TrapBearTrapFlare"];
DayZ_ViralZeds = ["z_new_villager2","z_new_villager3","z_new_villager4","z_new_worker2","z_new_worker3","z_new_worker4"];
DayZ_SafeObjects = ["Base_Fire_DZ","WoodenGate_1","WoodenGate_2","WoodenGate_3","WoodenGate_4","Land_Fire_DZ","TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4","StashSmall","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3","StashMedium4","Wire_cat1","Sandbag1_DZ","Fence_DZ","Generator_DZ","Hedgehog_DZ","BearTrap_DZ","DomeTentStorage","DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DomeTentStorage4","CamoNet_DZ","Trap_Cans","TrapTripwireFlare","TrapBearTrapSmoke","TrapTripwireGrenade","TrapTripwireSmoke","TrapBearTrapFlare","TentStorageDomed","VaultStorageLocked","BagFenceRound_DZ","TrapBear","Fort_RazorWire","WoodGate_DZ","Land_HBarrier1_DZ","Land_HBarrier3_DZ","Land_HBarrier5_DZ","Fence_corrugated_DZ","M240Nest_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","Plastic_Pole_EP1_DZ","StickFence_DZ","LightPole_DZ","FuelPump_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","SandNest_DZ","DeerStand_DZ","MetalPanel_DZ","WorkBench_DZ","WoodFloor_DZ","WoodLargeWall_DZ","WoodLargeWallDoor_DZ","WoodLargeWallWin_DZ","WoodSmallWall_DZ","WoodSmallWallWin_DZ","WoodSmallWallDoor_DZ","LockboxStorageLocked","WoodFloorHalf_DZ","WoodFloorQuarter_DZ","WoodStairs_DZ","WoodStairsSans_DZ","WoodStairsRails_DZ","WoodSmallWallThird_DZ","WoodLadder_DZ","Land_DZE_GarageWoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_WoodDoor","Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoorLocked","CinderWallHalf_DZ","CinderWall_DZ","CinderWallDoorway_DZ","CinderWallDoor_DZ","CinderWallDoorLocked_DZ","CinderWallSmallDoorway_DZ","CinderWallDoorSmall_DZ","CinderWallDoorSmallLocked_DZ","MetalFloor_DZ","WoodRamp_DZ","GunRack_DZ","FireBarrel_DZ","WoodCrate_DZ","Scaffolding_DZ","DesertTentStorage","DesertTentStorage0","DesertTentStorage1","DesertTentStorage2","DesertTentStorage3","DesertTentStorage4"];
DayZ_DropDrageeObjects = ["WoodenGate_1","WoodenGate_2","WoodenGate_3","WoodenGate_4","TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4","Wire_cat1","Sandbag1_DZ","Fence_DZ","Generator_DZ","Hedgehog_DZ","DomeTentStorage","DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DomeTentStorage4","TentStorageDomed","VaultStorageLocked","BagFenceRound_DZ","Fort_RazorWire","WoodGate_DZ","Land_HBarrier1_DZ","Land_HBarrier3_DZ","Land_HBarrier5_DZ","Fence_corrugated_DZ","M240Nest_DZ","ParkBench_DZ","MetalGate_DZ","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","StickFence_DZ","SandNest_DZ","MetalPanel_DZ","WorkBench_DZ","WoodLargeWall_DZ","WoodLargeWallDoor_DZ","WoodLargeWallWin_DZ","WoodSmallWall_DZ","WoodSmallWallWin_DZ","WoodSmallWallDoor_DZ","LockboxStorageLocked","WoodSmallWallThird_DZ","WoodLadder_DZ","Land_DZE_GarageWoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_WoodDoor","Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoorLocked","CinderWallHalf_DZ","CinderWall_DZ","CinderWallDoorway_DZ","CinderWallDoor_DZ","CinderWallDoorLocked_DZ","CinderWallSmallDoorway_DZ","CinderWallDoorSmall_DZ","CinderWallDoorSmallLocked_DZ","DesertTentStorage","DesertTentStorage0","DesertTentStorage1","DesertTentStorage2","DesertTentStorage3","DesertTentStorage4","WoodFloorHalf_DZ","WoodFloor_DZ","WoodFloorQuarter_DZ","WoodStairs_DZ","WoodStairsSans_DZ","WoodStairsRails_DZ","MetalFloor_DZ","WoodRamp_DZ"];
DayZ_GearedObjects = ["Car","Helicopter","Motorcycle","Ship","TentStorage_base","StashSmall_base","StashMedium_base","Plane","Tank","VaultStorage","LockboxStorage","TentStorage","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","GunRack_DZ","WoodCrate_DZ","Scaffolding_DZ"];
DayZ_RestingAnims = ["amovpsitmstpsnonwpstdnon_ground","amovpsitmstpsnonwpstdnon_smoking","amovpsitmstpsraswrfldnon_weaponcheck1","amovpsitmstpsraswrfldnon"];
dayz_typedBags = ["bloodTester","bloodBagANEG","bloodBagAPOS","bloodBagBNEG","bloodBagBPOS","bloodBagABNEG","bloodBagABPOS","bloodBagONEG","bloodBagOPOS","wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"];
dayz_playerAchievements = []; //[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
dayz_trees = ["ind_timbers.p3d","t_picea2s_snow.p3d","b_corylus.p3d","t_quercus3s.p3d","t_larix3s.p3d","t_pyrus2s.p3d","str_briza_kriva.p3d","dd_borovice.p3d","les_singlestrom_b.p3d","les_singlestrom.p3d","smrk_velky.p3d","smrk_siroky.p3d","smrk_maly.p3d","les_buk.p3d","str krovisko vysoke.p3d","str_fikovnik_ker.p3d","str_fikovnik.p3d","str vrba.p3d","hrusen2.p3d","str dub jiny.p3d","str lipa.p3d","str briza.p3d","p_akat02s.p3d","jablon.p3d","p_buk.p3d","str_topol.p3d","str_topol2.p3d","p_osika.p3d","t_picea3f.p3d","t_picea2s.p3d","t_picea1s.p3d","t_fagus2w.p3d","t_fagus2s.p3d","t_fagus2f.p3d","t_betula1f.p3d","t_betula2f.p3d","t_betula2s.p3d","t_betula2w.p3d","t_alnus2s.p3d","t_acer2s.p3d","t_populus3s.p3d","t_quercus2f.p3d","t_sorbus2s.p3d","t_malus1s.p3d","t_salix2s.p3d","t_picea1s_w.p3d","t_picea2s_w.p3d","t_ficusb2s_ep1.p3d","t_populusb2s_ep1.p3d","t_populusf2s_ep1.p3d","t_amygdalusc2s_ep1.p3d","t_pistacial2s_ep1.p3d","t_pinuse2s_ep1.p3d","t_pinuss3s_ep1.p3d","t_prunuss2s_ep1.p3d","t_pinusn2s.p3d","t_pinusn1s.p3d","t_pinuss2f.p3d","t_poplar2f_dead_pmc.p3d","misc_torzotree_pmc.p3d","misc_burnspruce_pmc.p3d","brg_cocunutpalm8.p3d","brg_umbrella_acacia01b.p3d","brg_jungle_tree_canopy_1.p3d","brg_jungle_tree_canopy_2.p3d","brg_cocunutpalm4.p3d","brg_cocunutpalm3.p3d","palm_01.p3d","palm_02.p3d","palm_03.p3d","palm_04.p3d","palm_09.p3d","palm_10.p3d","brg_cocunutpalm2.p3d","brg_jungle_tree_antiaris.p3d","brg_cocunutpalm1.p3d","str habr.p3d","brg_bird_1.p3d","brg_bird_2.p3d","brg_bird_3.p3d","brg_umbrella_acacia02b.p3d","brg_africandoumpalm_1.p3d","brg_umbrella_acacia04b.p3d","brg_datepalm_4.p3d","brg_datepalm_1.p3d","brg_umbrella_acacia03b.p3d","brg_bottle_4.p3d","brg_aloe1.p3d","brg_umbrella_acacia03.p3d","brg_umbrella_acacia01.p3d","brg_umbrella_acacia04.p3d","brg_aloe2.p3d","brg_umbrella_acacia02.p3d","brg_aloe3.p3d","brg_bottle_1.p3d","brg_datepalm_3.p3d","brg_datepalm_2.p3d","brg_baobab_1.p3d","brg_bottle_2.p3d","brg_bottle_3.p3d","t_fraxinus2s.p3d","t_carpinus2s.p3d"];

Dayz_meatraw =
[
    "FoodBeefRaw",
    "FoodMuttonRaw",
    "FoodChickenRaw",
    "FoodRabbitRaw",
    "FoodBaconRaw",
    "FoodGoatRaw",
    "FoodDogRaw",
    "FishRawTrout",
    "FishRawSeaBass",
    "FishRawTuna"
];

Dayz_meatcooked =
[
    "FoodBeefCooked",
    "FoodMuttonCooked",
    "FoodChickenCooked",
    "FoodRabbitCooked",
    "FoodBaconCooked",
    "FoodGoatCooked",
    "FoodDogCooked",
    "FishCookedTrout",
    "FishCookedSeaBass",
    "FishCookedTuna"
];

boil_tin_cans =
[
    "TrashTinCan",
    "FoodCanGriffEmpty",
    "FoodCanBadguyEmpty",
    "FoodCanBoneboyEmpty",
    "FoodCanCornEmpty",
    "FoodCanCurgonEmpty",
    "FoodCanDemonEmpty",
    "FoodCanFraggleosEmpty",
    "FoodCanHerpyEmpty",
    "FoodCanDerpyEmpty",
    "FoodCanOrlokEmpty",
    "FoodCanPowellEmpty",
    "FoodCanTylersEmpty",
    "FoodCanUnlabeledEmpty",
    "FoodCanRusUnlabeledEmpty",
    "FoodCanRusStewEmpty",
    "FoodCanRusPorkEmpty",
    "FoodCanRusPeasEmpty",
    "FoodCanRusMilkEmpty",
    "FoodCanRusCornEmpty",
    "ItemSodaEmpty",
    "ItemSodaClaysEmpty",
    "ItemSodaDrwasteEmpty",
    "ItemSodaFrankaEmpty",
    "ItemSodaGrapeDrinkEmpty",
    "ItemSodaLemonadeEmpty",
    "ItemSodaLirikEmpty",
    "ItemSodaLvgEmpty",
    "ItemSodaMtngreenEmpty",
    "ItemSodaMzlyEmpty",
    "ItemSodaPeppsyEmpty",
    "ItemSodaR4z0rEmpty",
    "ItemSodaRabbitEmpty",
    "ItemSodaRocketFuelEmpty",
    "ItemSodaSacriteEmpty",
    //"ItemSodaSherbetEmpty",
    "ItemSodaSmashtEmpty",
    "FoodCanPotatoesEmpty",
    "FoodCanBeefEmpty"
];

canPickup = false;
pickupInit = false;
mouseOverCarry = false; //for carry slot since determining mouse pos doesn't work right
dayZ_partClasses = ["PartFueltank","PartWheel","PartEngine"]; //No need to add PartGeneric, it is default for everything
dayZ_explosiveParts = ["palivo","motor"];
if (isNil "infectedWaterHoles") then {infectedWaterHoles = [];}; //Needed for non-cherno maps

//Survival Variables
SleepFood = 2160; //minutes (48 hours)
SleepWater = 1440; //minutes (24 hours)
SleepTemperatur = 90 / 100;    //First value = Minutes until player reaches the coldest point at night (without other effects! night factor expected to be -1) //TeeChange

//Server Variables
allowConnection = false;
dayz_serverObjectMonitor = [];

//GUI
Dayz_GUI_R = 0.38; // 0.7 .38
Dayz_GUI_G = 0.63; // -0.63
Dayz_GUI_B = 0.26; // -0.26

//actions blockers
a_player_cooking = false;
a_player_boil = false;
a_player_jerryfilling = false;
a_player_repairing = false;

//Player self-action handles
dayz_resetSelfActions = {
    s_player_equip_carry = -1;
    s_player_dragbody = -1;
    s_player_fire = -1;
    s_player_cook = -1;
    s_player_boil = -1;
    s_player_fireout = -1;
    s_player_packtent = -1;
    s_player_packtentinfected = -1;
    s_player_fillwater = -1;
    s_player_fillwater2 = -1;
    s_player_fillfuel = -1;
    s_player_grabflare = -1;
    s_player_removeflare = -1;
    s_player_painkiller = -1;
    s_build_Sandbag1_DZ = -1;
    s_build_Hedgehog_DZ = -1;
    s_build_Wire_cat1 = -1;
    s_player_deleteBuild = -1;
    s_player_flipveh = -1;
    s_player_stats = -1;
    s_player_sleep = -1;
    s_player_fillfuel210 = -1;
    s_player_fillfuel20 = -1;
    s_player_fillfuel5 = -1;
    s_player_siphonfuel = -1;
    s_player_repair_crtl = -1;
    s_player_fishing = -1;
    s_player_fishing_veh = -1;
    s_player_gather = -1;
    s_player_debugCheck = -1;
    s_player_destorytent = -1;
    s_player_attach_bomb = -1;
    s_player_upgradestorage = -1;
    s_player_Drinkfromhands = -1;
    /*s_player_lockhouse = -1; //Vanilla base building currently not used in Epoch
    s_player_unlockhouse = -1;
    s_player_openGate = -1;
    s_player_CloseGate = -1;
    s_player_breakinhouse = -1;
    s_player_setCode = -1;
    s_player_BuildUnLock = -1;
    s_player_BuildLock = -1;*/
    s_player_packvault = -1;
    s_player_lockvault = -1;
    s_player_unlockvault = -1;
    s_player_attack = -1;
    s_player_callzombies = -1;
    s_player_showname = -1;
    s_player_pzombiesattack = -1;
    s_player_pzombiesvision = -1;
    s_player_pzombiesfeed = -1;
    s_player_tamedog = -1;
    s_player_parts_crtl = -1;
    s_player_movedog = -1;
    s_player_speeddog = -1;
    s_player_calldog = -1;
    s_player_feeddog = -1;
    s_player_waterdog = -1;
    s_player_staydog = -1;
    s_player_trackdog = -1;
    s_player_barkdog = -1;
    s_player_warndog = -1;
    s_player_followdog = -1;
    s_player_information = -1;    
    s_player_fuelauto = -1;
    s_player_fuelauto2 = -1;
    s_player_fillgen = -1;
    s_player_upgrade_build = -1;
    s_player_maint_build = -1;
    s_player_downgrade_build = -1;
    s_player_towing = -1;
    s_halo_action = -1;
    s_player_SurrenderedGear = -1;
    s_player_maintain_area = -1;
    s_player_maintain_area_force = -1;
    s_player_maintain_area_preview = -1;
    s_player_heli_lift = -1;
    s_player_heli_detach = -1;
    s_player_clothes = -1;
    s_player_lockUnlock_crtl = -1;
    s_player_lockUnlockInside_ctrl = -1;
    s_player_toggleSnap = -1;
    s_player_toggleSnapSelect = -1;
    s_player_toggleSnapSelectPoint = [];
    snapActions = -1;
    s_player_plot_boundary = -1;
    s_player_plot_take_ownership = -1;
    s_player_plotManagement = -1;
    s_player_toggleDegree = -1;
    s_player_toggleDegrees=[];
    degreeActions = -1;
    s_player_toggleVector = -1;
    s_player_toggleVectors=[];
    vectorActions = -1;
    s_player_manageDoor = -1;
    // garage
    s_player_garage = -1;
};
call dayz_resetSelfActions;

dayz_resetUpgradeActions = {
    s_player_disassembly = -1;
    s_player_building = -1;
    s_player_maintenance = -1;
};
call dayz_resetUpgradeActions;

//Engineering variables
s_player_lastTarget = objNull;
s_player_repairActions = [];

//Initialize Medical Variables
force_dropBody = false;
r_interrupt = false;
r_doLoop = false;
r_self = false;
r_self_actions = [];
r_drag_sqf = false;
r_action = false;
r_action_unload = false;
r_player_handler = false;
r_player_unconsciousInProgress = false;
r_player_unconsciousInputDisabled = false;
r_player_dead = false;
r_player_unconscious = false;
r_player_infected = false;
//infection from hits
r_player_Sepsis = [false, 0];
r_player_injured = false;
r_player_inpain = false;
r_player_loaded = false;
r_player_cardiac = false;
r_fracture_legs = false;
r_fracture_arms = false;
r_player_vehicle = player;
r_player_blood = 12000;
r_player_bloodregen = 0;
r_player_bloodgainpersec = 0;
r_player_bloodlosspersec = 0;
r_player_bloodpersec = 0; //Blood Per Sec (gain - loss)
r_player_foodstack = 1;
//player skill
r_player_lowblood = false;
r_player_timeout = 0;
r_player_bloodTotal = r_player_blood;
r_public_blood = r_player_blood;
r_player_bloodDanger = r_player_bloodTotal * 0.2;
r_player_actions = [];
r_handlerCount = 0;
r_action_targets = [];
r_pitchWhine = false;
r_isBandit = false;
dayz_DisplayGenderSelect = true;
//blood test vars
r_A_watered = false;
r_B_watered = false;
r_D_watered = false;
r_control_watered = false;
r_canClick_resultsCard = false;
r_resultsCard_Clicked = false;
r_water_clicked = false;
r_needleclicked = 0;
r_needleReset = false;
r_control_done = false;
r_antiA_done = false;
r_antiB_done = false;
r_antiD_done = false;
carryClick = false;
dayz_actionInProgress = false;
dayz_workingInprogress = false;
gear_done = false;

//player warming up vars
//heatpack
r_player_warming_heatpack = [false, 0];
r_player_warming_heatpack_time = 600; 

//displays temp progress
r_player_temp_factor = 0; //to be used for temp(up/down) indicators
r_player_temp_min_factor = -0.04; //(lvl3 down arrow)
r_player_temp_max_factor = 0.04; //(lvl3 up arrow)
 
//INT Nutrition Info
r_player_Nutrition = 0; // Calories
r_player_nutritionMuilpty = 2;

//ammo routine
r_player_actions2 = [];
r_action2 = false;
r_player_lastVehicle = objNull;
r_player_lastSeat = [];
r_player_removeActions2 = {
    if (!isNull r_player_lastVehicle) then {
        {
            r_player_lastVehicle removeAction _x;
        } count r_player_actions2;
        r_player_actions2 = [];
        r_action2 = false;
    };
};

USEC_woundHit = ["","body","hands","legs","head_hit"]; // limbs hit given by arma engine when fnc_usec_damageHandler is called
DAYZ_woundHit = [["body","hands","legs","head_hit"],[0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,3]];
DAYZ_woundHit_ok = [["body","hands","legs"],[0,0,0,0,0,1,1,1,2,2]];
USEC_MinorWounds = ["hands","legs"];
USEC_woundPoint = [ // translation table USEC_woundHit -> SV suffixes
    ["Pelvis","aimpoint"],
    ["aimpoint"], //,"RightShoulder","LeftShoulder"
    ["lelbow","relbow"],
    ["RightFoot","LeftFoot"],
    ["neck","pilot"]
];
USEC_typeOfWounds = [ // used by player_sumMedical, should contains all limbs described in USEC_woundPoint. These limbs statuses are saved by server_playerSync in HIVE if they are bleeding (medical select 8)
    "Pelvis",
    "aimpoint",
    "lelbow","relbow",
    "RightFoot","LeftFoot",
    "neck","pilot"
];

//Initialize Zombie Variables
dayz_zombieTargetList = [["SoldierWB",50],["Air",500],["LandVehicle",200]];
PVDZ_obj_Publish = []; // Used for eventhandler to spawn a mirror of players tent
PVCDZ_obj_HideBody = objNull;

//DayZ settings
dayz_lastHumanityChange = diag_tickTime;
dayz_maxAnimals = 5;
dayz_maxPlants = 3;
dayz_animalDistance = 600;
dayz_plantDistance = 600;

dayz_maxMaxModels = 80; // max quantity of Man models (player or Z, dead or alive) around players. Below this limit we can spawn Z // max quantity of loot piles around players. Below this limit we can spawn some loot
dayz_cantseeDist = 150; // distance from which we can spawn a Z in front of any player without ray-tracing and angle checks
dayz_cantseefov = 70; // half player field-of-view. Visible Z won't be spawned in front of any near players
dayz_canDelete = 350; // Z, further than this distance from its "owner", will be deleted
dayz_traps = [];
dayz_traps_active = [];
dayz_traps_trigger = [];

//Settings Not under dayz_settings
if(isNil "dayz_attackRange") then { 
    dayz_attackRange = 3;
};
if(isNil "dayz_DamageMultiplier") then { 
    dayz_DamageMultiplier = 1;
};
if(isNil "dayz_quickSwitch") then {
    dayz_quickSwitch = false; //Enable quick weapon switch,
};
//Will be moved to map
if(isNil "dayz_infectiouswaterholes") then {
    dayz_infectiouswaterholes = true; //Enable infected waterholes
};
if(isNil "dayz_POIs") then {
    dayz_POIs = true; //Enable POI's
};
if(isNil "dayz_ForcefullmoonNights") then {
    dayz_ForcefullmoonNights = false; // Forces night time to be full moon.
};
if(isNil "dayz_randomMaxFuelAmount") then {
    dayz_randomMaxFuelAmount = 500; //Puts a random amount of fuel in all fuel stations.
};
if(isNil "dayz_townGenerator") then {
    dayz_townGenerator = true; // Spawn map junk. Currently only compatible with Chernarus. Need to add coordinates for other maps.
};
if(isNil "dayz_townGeneratorBlackList") then {
    dayz_townGeneratorBlackList = []; // Town generator will not spawn junk within 150m of these positions.
};

//Replace server individual settings with ranked settings
if(isNil "dayz_presets") then { dayz_presets = "Vanilla"; };

switch (dayz_presets) do {
    case "Custom": { //Custom 
        if(isNil "dayz_enableGhosting") then { dayz_enableGhosting = false; };
        if(isNil "dayz_ghostTimer") then { dayz_ghostTimer = 120; };
        if(isNil "dayz_spawnselection") then { dayz_spawnselection = 0; };
        if(isNil "dayz_spawncarepkgs_clutterCutter") then { dayz_spawncarepkgs_clutterCutter = 0; };
        if(isNil "dayz_spawnCrashSite_clutterCutter") then { dayz_spawnCrashSite_clutterCutter = 0; };
        if(isNil "dayz_spawnInfectedSite_clutterCutter") then { dayz_spawnInfectedSite_clutterCutter = 0; };
        if(isNil "dayz_bleedingeffect") then { dayz_bleedingeffect = 2; };
        if(isNil "dayz_OpenTarget_TimerTicks") then { dayz_OpenTarget_TimerTicks = 60 * 10; };
        if(isNil "dayz_temperature_override") then { dayz_temperature_override = true; };
        if(isNil "dayz_nutritionValuesSystem") then { dayz_nutritionValuesSystem = false; };
        if(isNil "dayz_classicBloodBagSystem") then { dayz_classicBloodBagSystem = false; };
    };
    case "Classic": { //Classic
        dayz_enableGhosting = false; //Enable disable the ghosting system.
        dayz_ghostTimer = 120; //Sets how long in seconds a player must be dissconnected before being able to login again.
        dayz_spawnselection = 0; //Turn on spawn selection 0 = random only spawns, 1 = Spawn choice based on limits
        dayz_spawncarepkgs_clutterCutter = 0; //0 =  loot hidden in grass, 1 = loot lifted and 2 = no grass
        dayz_spawnCrashSite_clutterCutter = 0;    // heli crash options 0 =  loot hidden in grass, 1 = loot lifted and 2 = no grass
        dayz_spawnInfectedSite_clutterCutter = 0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass 
        dayz_bleedingeffect = 2; //1= blood on the ground, 2= partical effect, 3 = both.
        dayz_OpenTarget_TimerTicks = 60 * 10; //how long can a player be freely attacked for after attacking someone unprovoked.
        dayz_temperature_override = true; // Set to true to disable all temperature changes.
        dayz_nutritionValuesSystem = false; //Enables nutrition system
        dayz_classicBloodBagSystem = true; //Enables one type of bloodbag
    };
    case "Elite": { //Elite
        dayz_enableGhosting = true; //Enable disable the ghosting system.
        dayz_ghostTimer = 90; //Sets how long in seconds a player must be dissconnected before being able to login again.
        dayz_spawnselection = 0; //Turn on spawn selection 0 = random only spawns, 1 = Spawn choice based on limits
        dayz_spawncarepkgs_clutterCutter = 0; //0 =  loot hidden in grass, 1 = loot lifted and 2 = no grass
        dayz_spawnCrashSite_clutterCutter = 0;    // heli crash options 0 =  loot hidden in grass, 1 = loot lifted and 2 = no grass
        dayz_spawnInfectedSite_clutterCutter = 0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass 
        dayz_bleedingeffect = 3; //1= blood on the ground, 2= partical effect, 3 = both.
        dayz_OpenTarget_TimerTicks = 60 * 25; //how long can a player be freely attacked for after attacking someone unprovoked.
        dayz_temperature_override = false; // Set to true to disable all temperature changes.
        dayz_nutritionValuesSystem = true; //Enables nutrition system
        dayz_classicBloodBagSystem = false; //Enables one type of bloodbag
    };
    default { //Vanilla
        dayz_enableGhosting = true; //Enable disable the ghosting system.
        dayz_ghostTimer = 60; //Sets how long in seconds a player must be disconnected before being able to login again.
        dayz_spawnselection = 1; //Turn on spawn selection 0 = random only spawns, 1 = Spawn choice based on limits
        dayz_spawncarepkgs_clutterCutter = 0; //0 =  loot hidden in grass, 1 = loot lifted and 2 = no grass
        dayz_spawnCrashSite_clutterCutter = 0;    // heli crash options 0 =  loot hidden in grass, 1 = loot lifted and 2 = no grass
        dayz_spawnInfectedSite_clutterCutter = 0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass 
        dayz_bleedingeffect = 3; //1= blood on the ground, 2= partical effect, 3 = both.
        dayz_OpenTarget_TimerTicks = 60 * 10; //how long can a player be freely attacked for after attacking someone unprovoked.
        dayz_temperature_override = false; // Set to true to disable all temperature changes.
        dayz_nutritionValuesSystem = true; //Enables nutrition system
        dayz_classicBloodBagSystem = false; //Enables one type of bloodbag
    };
};

switch (toLower worldName) do {
    case "napf";
    case "sauerland" : {dayz_minpos = -1000; dayz_maxpos = 26000;};
    case "tavi" : {dayz_minpos = -26000; dayz_maxpos = 26000;};
    case "chernarus" : {dayz_minpos = -1; dayz_maxpos = 16000;};
    case default {dayz_minpos = -20000; dayz_maxpos = 20000;};
};

//start achievements_init
//call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\achievements_init.sqf";

// EPOCH ADDITIONS
keypadCancel = false; //Brute force fix
keyPadReset = {uiSleep 2; keypadCancel = false;};
canbuild = true;
dayz_activeInvites = [];
dayz_combination = "";
dayz_disallowedVault = ["TentStorage","BuiltItems","ModularItems","DZE_Base_Object","Generator_DZ"];
// These work with just a running generator
dayz_fuelpumparray = ["FuelPump_DZ","Land_A_FuelStation_Feed","Land_Ind_FuelStation_Feed_EP1","Land_FuelStation_Feed_PMC","FuelStation","Land_ibr_FuelStation_Feed","Land_fuelstation_army","Land_fuelstation","land_fuelstation_w","Land_benzina_schnell"];
// Standard Fuel sources
dayz_fuelsources = ["Land_Ind_TankSmall","Land_fuel_tank_big","Land_fuel_tank_stairs","Land_fuel_tank_stairs_ep1","Land_wagon_tanker","Land_fuelstation","Land_fuelstation_army","land_fuelstation_w","Land_benzina_schnell"];
dayz_humanitytarget = "";
dayz_selectedVault = objNull;
dayz_selectedDoor = objNull;
DAYZ_woundHit_dog = [["body","hands","legs"],[0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2]];
DZE_fueltruckarray = ["KamazRefuel_DZ","UralRefuel_TK_EP1_DZ","MtvrRefuel_DES_EP1_DZ","V3S_Refuel_TK_GUE_EP1_DZ","MtvrRefuel_DZ","KamazRefuel_DZE","KamazRefuel_DZE1","KamazRefuel_DZE2","KamazRefuel_DZE3","KamazRefuel_DZE4","UralRefuel_TK_EP1_DZE","MtvrRefuel_DES_EP1_DZE","V3S_Refuel_TK_GUE_EP1_DZE","MtvrRefuel_DZE"];
DZE_Lock_Door = "";
DZE_HeliAllowTowFrom = ["CH_47F_EP1_DZE","CH_47F_EP1_DZ","CH_47F_BAF","CH_47F_EP1","BAF_Merlin_DZE","CH53_DZE"];
DZE_HeliAllowToTow = ["hilux1_civil_1_open","HMMWV_Base","Lada_base","Offroad_DSHKM_base","Pickup_PK_base","SkodaBase","tractor","VWGolf","Volha_TK_CIV_Base_EP1","S1203_TK_CIV_EP1","SUV_Base_EP1","ArmoredSUV_Base_PMC","UAZ_Base","LandRover_Base","Ship"];
DZE_REPLACE_WEAPONS = [["Crossbow","DMR","M14_EP1","SVD","SVD_CAMO"],["Crossbow_DZ","DMR_DZ","M14_CCO_DZ","SVD_DZ","SVD_Gh_DZ"]];
DZE_LockableStorage = ["VaultStorage","VaultStorageLocked","LockboxStorageLocked","LockboxStorage"];
DZE_LockedStorage = ["VaultStorageLocked","LockboxStorageLocked"];
DZE_UnLockedStorage = ["VaultStorage","LockboxStorage"];
DZE_maintainClasses = ["ModularItems","DZE_Housebase","LightPole_DZ","BuiltItems","Generator_DZ","DZ_buildables","Plastic_Pole_EP1_DZ","Fence_corrugated_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","StickFence_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","DeerStand_DZ","Scaffolding_DZ","FireBarrel_DZ","M240Nest_DZ"];
DZE_DoorsLocked = ["Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoorLocked","CinderWallDoorLocked_DZ","CinderWallDoorSmallLocked_DZ"];
// List of removable items that require crowbar
DZE_isRemovable = ["Fence_corrugated_DZ","M240Nest_DZ","ParkBench_DZ","Plastic_Pole_EP1_DZ","FireBarrel_DZ","Scaffolding_DZ","CanvasHut_DZ"];
DZE_isWreck = ["SKODAWreck","HMMWVWreck","UralWreck","datsun01Wreck","hiluxWreck","datsun02Wreck","UAZWreck","Land_Misc_Garb_Heap_EP1","Fort_Barricade_EP1","Rubbish2"];
DZE_isWreckBuilding = ["Land_wreck_cinder","Land_wood_wreck_quarter","Land_wood_wreck_floor","Land_wood_wreck_third","Land_wood_wreck_frame","Land_iron_vein_wreck","Land_silver_vein_wreck","Land_gold_vein_wreck","Land_ammo_supply_wreck"];
DZE_isNewStorage = ["VaultStorage","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","GunRack_DZ","WoodCrate_DZ"];
DZE_isDestroyableStorage = ["OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","GunRack_DZ","WoodCrate_DZ"];
helperDetach = false;
DZE_snapExtraRange = 0;
DZE_tradeVehicle = ["trade_any_vehicle","trade_any_vehicle_free","trade_any_vehicle_old","trade_any_bicycle","trade_any_bicycle_old","trade_any_boat","trade_any_boat_old"];
DZE_tradeVehicleKeyless = ["trade_any_bicycle","trade_any_bicycle_old","trade_any_vehicle_free"];
DZE_tradeObject = DZE_tradeVehicle + ["trade_backpacks"];
if (isNil "DZE_plotOwnershipExclusions") then {
    DZE_plotTakeOwnershipItems = DayZ_SafeObjects - (DZE_LockableStorage + ["Plastic_Pole_EP1_DZ","DZ_storage_base"]);
};

DZE_GearCheckBypass = false;
isInTraderCity = false;
inTraderCity = "Unknown Trader";
PlayerDeaths = [];
PVDZE_obj_Trade = []; // For all traders increment qty
PVDZE_plr_DeathB = [];
PVDZE_plr_TradeMenu = []; // For all traders
snapGizmos = [];
snapGizmosNearby = [];
s_player_combi = [];
s_player_lockunlock = [];
s_player_lockUnlockInside = [];
s_player_parts = [];
if (isNil "DZE_GodModeBase") then {DZE_GodModeBase = false;};
if (isNil "dayz_paraSpawn") then {dayz_paraSpawn = false;};
if (isNil "DZE_BuildingLimit") then {DZE_BuildingLimit = 150;};
if (isNil "DZE_BuildOnRoads") then {DZE_BuildOnRoads = false;};
if (isNil "DZE_SelfTransfuse") then {DZE_SelfTransfuse = false;};
if (isNil "DZE_selfTransfuse_Values") then {DZE_selfTransfuse_Values = [12000,15,120];};
if (isNil "DZE_PlotPole") then {DZE_PlotPole = [30,45];};
DZE_maintainRange = ((DZE_PlotPole select 0)+20);
if (isNil "DZE_slowZombies") then {DZE_slowZombies = false;};
TimeOutDisplayed = false;

if (isServer) then {
    dead_bodyCleanup = [];
    needUpdate_objects = [];
    needUpdate_FenceObjects = [];
    //dayz_spawnCrashSite_clutterCutter=0; // helicrash spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass 
    //dayz_spawnInfectedSite_clutterCutter=0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass 
    //Objects to remove when killed.
    DayZ_nonCollide = ["TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4","StashSmall","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3", "StashMedium4", "DomeTentStorage", "DomeTentStorage0", "DomeTentStorage1", "DomeTentStorage2", "DomeTentStorage3", "DomeTentStorage4", "CamoNet_DZ", "DesertTentStorage", "DesertTentStorage0", "DesertTentStorage1", "DesertTentStorage2", "DomeTentStorage3", "DesertTentStorage4"];
    DayZ_WoodenFence = ["WoodenFence_1","WoodenFence_2","WoodenFence_3","WoodenFence_4","WoodenFence_5","WoodenFence_6","WoodenFence_7"];
    DayZ_WoodenGates = ["WoodenGate_1","WoodenGate_2","WoodenGate_3","WoodenGate_4"];
    DayZ_removableObjects = ["Wire_cat1","Sandbag1_DZ","Hedgehog_DZ","CamoNet_DZ","Trap_Cans","TrapTripwireFlare","TrapBearTrapSmoke","TrapTripwireGrenade","TrapTripwireSmoke","TrapBearTrapFlare"];
    //[10416.695, 4198.4634],[7982.2563, 1419.8256],[10795.93, 1419.8263],[7966.083, 4088.7463],[9259.7266, 2746.1985],[5200.5234, 3915.3274],[6494.1665, 2572.7798],[5216.6968, 1246.407],[2564.7244, 3915.3296],[3858.3674, 2572.782],[2580.8977, 1246.4092],[13398.995, 4400.5874],[12242.025, 2948.3196],[13551.842, 1832.2257],[14870.512, 3009.5117],[-178.19415, 1062.4478],[1099.2754, 2388.8206],[-194.36755, 3731.3679],[10394.215, 8322.1719],[7959.7759, 5543.5342],[10773.449, 5543.5342],
    dayz_grid =[[7943.6025, 8212.4551],[9237.2461, 6869.9063],[5178.043, 8039.0361],[6471.686, 6696.4883],[5194.2163, 5370.1152],[2542.2439, 8039.0381],[3835.887, 6696.4902],[2558.4172, 5370.1172],[13376.514, 8524.2969],[12219.544, 7072.0273],[13529.361, 5955.9336],[14848.032, 7133.2197],[-200.67474, 5186.1563],[1076.7949, 6512.5283],[-216.84814, 7855.0771],[10293.751, 12197.736],[7859.312, 9419.0996],[10672.988, 9419.0996],[7843.1387, 12088.021],[9136.7822, 10745.474],[5077.5791, 11914.601],[6371.2222, 10572.052],[5093.7524, 9245.6816],[2441.78, 11914.604],[3735.4231, 10572.055],[2457.9534, 9245.6816],[13276.053, 12399.861],[12119.08, 10947.596],[13428.897, 9831.501],[14747.566, 11008.786],[-301.13867, 9061.7207],[976.33112, 10388.096],[-317.31201, 11730.642],[10271.271, 16321.429],[7836.8315, 13542.813],[10650.506, 13542.813],[7820.6582, 16211.718],[9114.3018, 14869.175],[5055.0986, 16038.3],[6348.7417, 14695.758],[5071.272, 13369.392],[2419.2996, 16038.305],[3712.9426, 14695.76],[2435.4729, 13369.392],[13253.568, 16523.553],[12096.6, 15071.295],[13406.416, 13955.209],[14725.089, 15132.486],[-323.61914, 13185.43],[953.85059, 14511.8],[-339.79248, 15854.346]];
    dayz_choppedTrees = [];
    dayz_ghostPlayers = [];
    dayz_activePlayers = [];
    dayz_died = [];

    // EPOCH ADDITIONS
    DZE_safeVehicle = ["ParachuteWest","ParachuteC"];
//    if (isNil "EpochUseEvents") then {EpochUseEvents = true;};
//    if (isNil "EpochEvents") then {EpochEvents = [
EpochUseEvents = true; //Enable event scheduler. Define custom scripts in dayz_server\modules to run on a schedule.
EpochEvents = [
["any","any","any","any",2,"Construction"],  
//["any","any","any","any",5,"Construction"],
["any","any","any","any",15,"Military"],
["any","any","any","any",25,"Treasure"],
["any","any","any","any",35,"crash_spawner"],
["any","any","any","any",45,"Building"],
["any","any","any","any",55,"Military"],
["any","any","any","any",65,"Treasure"],
["any","any","any","any",75,"Construction"]
//["any","any","any","any",85,"SupplyItems"]
//["any","any","any","any",95,"Vault"]
    ];//};
    if (isNil "MaxDynamicDebris") then {MaxDynamicDebris = 100;};
    if (isNil "MaxVehicleLimit") then {MaxVehicleLimit = 50;};
    if (isNil "spawnArea") then {spawnArea = 1400;};
    if (isNil "spawnShoremode") then {spawnShoremode = 1;};
};

if (!isDedicated) then {
    dayz_buildingBubbleMonitor = [];

    //temperature variables
    dayz_temperatur = 36; //TeeChange
    dayz_temperaturnormal = 36; //TeeChange
    dayz_temperaturmax = 42; //TeeChange
    dayz_temperaturmin = 27; //TeeChange

    //player special variables
    dayz_bloodBagHumanity = 300;
    dayz_lastDamageSourceNull = false;
    dayz_lastDamageSource = "none";
    dayz_lastDamageTime = 0;
    dayz_lastMedicalSource = "none";
    dayz_lastMedicalTime = 0;
    dayz_lastClothesChange = 0;
    dayZ_lastPlayerUpdate = 0;
    dayz_lastSelfTransfusion = -(DZE_selfTransfuse_Values select 2);
    dayz_lastTransfusion = 0;
    dayz_playerName = "unknown";
    dayz_hunger = 0;
    dayz_thirst = 0;
    dayz_nutrition = 0;
    dayz_preloadFinished = true;
    dayz_soundMuted = false;
    dayz_statusArray = [1,1];
    dayz_disAudial = 0;
    dayz_disVisual = 0;
    dayz_firedCooldown = 0;
    dayz_damageCounter = time;
    dayz_lastSave = time;
    dayz_isSwimming = true;
    dayz_currentDay = 0;
    dayz_hasLight = false;
    dayz_surfaceNoise = 0;
    dayz_surfaceType = "None";
    dayz_noPenalty = [];
    dayz_heavenCooldown = 0;
    deathHandled = false;
    dayz_firstGroup = group player;
    dayz_originalPlayer = player;
    dayz_sourceBleeding = objNull;
    dayz_clientPreload = false;
    dayz_authed = false;
    dayz_panicCooldown = 0;
    dayz_areaAffect = 3.5;
    dayz_monitorPeriod = 0.6; // number of seconds between each player_zombieCheck calls
    dayz_heartBeat = false;
    dayz_spawnZombies = 0; // Current local
    dayz_swarmSpawnZombies = 0;
    dayz_maxLocalZombies = 15; // max quantity of Z controlled by local gameclient, used by player_spawnCheck. Below this limit we can spawn Z
    dayz_CurrentNearByZombies = 0;
    dayz_maxNearByZombies = 30; // max quantity of Z controlled by local gameclient, used by player_spawnCheck. Below this limit we can spawn Z
    dayz_currentGlobalZombies = 0; // Current total
    if(isNil "dayz_maxGlobalZeds") then {
        dayz_maxGlobalZeds = 1000;
    };
    //Animals
    dayz_currentGlobalAnimals =    0;
    dayz_maxGlobalAnimals =    50;
    //Plants    
    dayz_currentGlobalPlants = 0;
    dayz_maxGlobalPlants = 500;
    //Loot
    r_player_divideinvehicle = 0;
    dayz_currentWeaponHolders = 0;
    dayz_maxMaxWeaponHolders = 80;
    dayz_inVehicle = false;
    dayz_unsaved = false;
    dayz_scaleLight = 0;
    dayzDebug = false;
    dayzState = -1;
    dayz_onBack = "";
    dayz_fishingInprogress = false;
    dayz_siphonFuelInProgress = false;
    dayz_salvageInProgress = false;
    lastSpawned = diag_tickTime;
    lastSepsis = 0;
    NORRN_dropAction = -1;
    //uiNamespace setVariable ['DAYZ_GUI_display',displayNull];
    //if (uiNamespace getVariable ['DZ_displayUI', 0] == 2) then {
    //    dayzDebug = true;
    //};
    dayz_dodge = false;
    Dayz_constructionContext = [];
    Dayz_freefall = [ time, 0, 0.1 ];
    dayz_getout = objNull;
    dayz_getoutTime = 0;
    dayz_HitBy = objNull;
    voice_actions = ["voiceOverNet","PushToTalk","PushToTalkAll","PushToTalkCommand","PushToTalkDirect","PushToTalkGroup","PushToTalkSide","PushToTalkVehicle"];

    // EPOCH ADDITIONS
    if (isNil "DZE_BackpackAntiTheft") then {DZE_BackpackAntiTheft = false;};
    if (isNil "DZE_requireplot") then {DZE_requireplot = 1;};
    if (isNil "DZE_StaticConstructionCount") then {DZE_StaticConstructionCount = 0;};
    if (toLower DZE_DeathMsgChat in ["global","side"]) then {enableRadio true;}; //Needed for scripted global chat to show, doesn't seem to have any adverse effects
    autoRunActive = false;
    DZE_AntiWallCounter = 0;
    DZE_myHaloVehicle = objNull;
    dayz_myLiftVehicle = objNull;
    DZE_Friends = [];
    DZE_Q = false;
    DZE_Z = false;
    DZE_Q_alt = false;
    DZE_Z_alt = false;
    DZE_Q_ctrl = false;
    DZE_Z_ctrl = false;
    DZE_4 = false;
    DZE_5 = false;
    DZE_6 = false;
    DZE_F = false;
    DZE_cancelBuilding = false;
    DZE_TEMP_treedmg = 1;
    DZE_Surrender = false;
    DZE_Quarantine = false;
    DZE_InRadiationZone = false;
    DZE_myVehicle = objNull;
    dayz_groupNameTags = true;
};

fn self actions

scriptName "Functions\misc\fn_selfActions.sqf";
/***********************************************************
    ADD ACTIONS FOR SELF
    - Function
    - [] call fnc_usec_selfActions;
************************************************************/
if (dayz_actionInProgress) exitWith {};
private ["_canPickLight","_text","_dir","_canDoThis","_w2m","_bb","_waterHoles","_unlock","_lock","_totalKeys","_temp_keys","_temp_keys_names",
"_hasKey","_oldOwner","_hasAttached","_isZombie","_isHarvested","_isMan","_isFuel","_hasRawMeat","_hastinitem","_player_deleteBuild",
"_player_lockUnlock_crtl","_displayName","_hasIgnators","_menu","_menu1","_allowTow","_liftHeli","_found","_posL","_posC","_height","_attached",
"_combi","_findNearestGen","_humanity_logic","_low_high","_cancel","_buy","_buyV","_humanity","_traderMenu","_warn","_typeOfCursorTarget",
"_isVehicle","_isBicycle","_isDestructable","_isGenerator","_ownerID","_isVehicletype","_hasBarrel","_hasFuel20","_hasFuel5","_hasEmptyFuelCan",
"_itemsPlayer","_hasToolbox","_hasbottleitem","_isAlive","_isPlant","_istypeTent","_upgradeItems","_isDisallowRefuel","_isDog",
"_isModular","_isModularDoor","_isHouse","_isGate","_isFence","_isLockableGate","_isUnlocked","_isOpen","_isClosed","_ownerArray","_ownerBuildLock",
"_ownerPID","_speed","_dog","_vehicle","_inVehicle","_cursorTarget","_primaryWeapon","_currentWeapon","_magazinesPlayer","_onLadder","_canDo",
"_nearLight","_vehicleOwnerID","_hasHotwireKit","_isPZombie","_dogHandle","_allowedDistance","_id","_upgrade","_weaponsPlayer","_hasCrowbar",
"_allowed","_hasAccess","_uid"];

_vehicle = vehicle player;
_inVehicle = (_vehicle != player);
_cursorTarget = cursorTarget;
_primaryWeapon = primaryWeapon player;
_currentWeapon = currentWeapon player;
_magazinesPlayer = magazines player;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
//_canDrink = count nearestObjects [getPosATL player, ["Land_pumpa","Land_water_tank"], 2] > 0;
_uid = getPlayerUID player;
_nearLight = nearestObject [player,"LitObject"];
_canPickLight = false;
_vehicleOwnerID = _vehicle getVariable ["CharacterID","0"];
_hasHotwireKit = "ItemHotwireKit" in _magazinesPlayer;
_isPZombie = player isKindOf "PZombie_VB";
_dogHandle = player getVariable ["dogID",0];

if (!isNull _nearLight) then {
    if (_nearLight distance player < 4) then {
        _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
    };
};

//Grab Flare
if (_canPickLight && !dayz_hasLight && !_isPZombie) then {
    if (s_player_grabflare < 0) then {
        _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
        s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true];
        s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, false, true];
    };
} else {
    player removeAction s_player_grabflare;
    player removeAction s_player_removeflare;
    s_player_grabflare = -1;
    s_player_removeflare = -1;
};

if (s_player_equip_carry < 0) then {
    if (dayz_onBack != "" && { !_inVehicle && { !_onLadder && { !r_player_unconscious } } }) then {
        dz_plr_carryActionItem = dayz_onBack;
        _text = getText (configFile >> "CfgWeapons" >> dz_plr_carryActionItem >> "displayName");
        s_player_equip_carry = player addAction [
            format [localize "STR_ACTIONS_WEAPON", _text],
            "\z\addons\dayz_code\actions\player_switchWeapon_action.sqf",
            nil, 0.5, false, true];
    };
} else {
    if (dayz_onBack != dz_plr_carryActionItem || { _inVehicle || { _onLadder || { r_player_unconscious } } } ) then {
        player removeAction s_player_equip_carry;
        s_player_equip_carry = -1;
    };
};

/*if (dayz_onBack != "" /*&& !dayz_onBackActive && !_inVehicle && !_onLadder && !r_player_unconscious) then {
    if (s_player_equip_carry < 0) then {
        _text = getText (configFile >> "CfgWeapons" >> dayz_onBack >> "displayName");
        s_player_equip_carry = player addAction [format[localize "STR_ACTIONS_WEAPON", _text], "\z\addons\dayz_code\actions\player_switchWeapon_action.sqf", nil, 0.5, false, true];
    };
} else {
    player removeAction s_player_equip_carry;
    s_player_equip_carry = -1;
};*/

//fishing
if ((_currentWeapon in Dayz_fishingItems) && {!dayz_fishingInprogress} && {!_inVehicle} && {!dayz_isSwimming}) then {
    if (s_player_fishing < 0) then {
        s_player_fishing = player addAction [localize "STR_ACTION_CAST", "\z\addons\dayz_code\actions\player_goFishing.sqf",player, 0.5, false, true];
    };
} else {
    player removeAction s_player_fishing;
    s_player_fishing = -1;
};
if ((_primaryWeapon in Dayz_fishingItems) && {!dayz_fishingInprogress} && {_inVehicle && (driver _vehicle != player)}) then {
    if (s_player_fishing_veh < 0) then {
        s_player_fishing_veh = _vehicle addAction [localize "STR_ACTION_CAST", "\z\addons\dayz_code\actions\player_goFishing.sqf",_vehicle, 0.5, false, true];
    };
} else {
    _vehicle removeAction s_player_fishing_veh;
    s_player_fishing_veh = -1;
};

_canDoThis=false;
if (_canDo && !_inVehicle && !dayz_isSwimming) then {
    {
        _waterHoles = if (typeOf _x == "waterHoleProxy") then {nearestObjects [_x, [], 1];} else {[_x];};
        {
            _w2m = _x worldToModel (getPosATL player);
            _bb = (boundingbox _x) select 1;
            _dir = [player, _x] call BIS_fnc_relativeDirTo; if (_dir > 180) then {_dir = _dir - 360};
            if (((abs _dir < 45) && {(_x distance player < 2.22)})  // wells, kasna, pumpa
                or {((("" == typeOf _x) && ((_w2m select 2) < 0.05)) && {((abs(_w2m select 0) < (_bb select 0)) && (abs(_w2m select 1) < (_bb select 1)))})}) exitWith { // ponds
                _canDoThis = true;
            };
        } count _waterHoles;
        if (_canDoThis) exitWith {
            if (s_player_Drinkfromhands < 0) then {
                s_player_Drinkfromhands = player addAction [localize "STR_ACTIONS_DRINK2", "\z\addons\dayz_code\actions\player_drinkWater.sqf",player, 0.5, false, true];
            };
        };
    } foreach nearestObjects [player, ["waterHoleProxy", "Land_pumpa"], 50];
};
if (!_canDoThis && s_player_Drinkfromhands >= 0) then {
    player removeAction s_player_Drinkfromhands;
    s_player_Drinkfromhands = -1;
};

if (_inVehicle) then {
    DZE_myVehicle = _vehicle;
    if (_vehicleOwnerID != "0" && _canDo) then {
        if (s_player_lockUnlockInside_ctrl < 0) then {
            _totalKeys = call epoch_tempKeys;
            _temp_keys = _totalKeys select 0;
            _temp_keys_names = _totalKeys select 1;    
            _hasKey = _vehicleOwnerID in _temp_keys;
            _oldOwner = (_vehicleOwnerID == _uid);
            _text = getText (configFile >> "CfgVehicles" >> (typeOf DZE_myVehicle) >> "displayName");
            if (locked DZE_myVehicle) then {
                if (_hasKey || _oldOwner) then {
                    _unlock = DZE_myVehicle addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",[DZE_myVehicle,(_temp_keys_names select (parseNumber _vehicleOwnerID))], 2, false, true];
                    s_player_lockUnlockInside set [count s_player_lockUnlockInside,_unlock];
                    s_player_lockUnlockInside_ctrl = 1;
                } else {
                    if (_hasHotwireKit) then {
                        _unlock = DZE_myVehicle addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",DZE_myVehicle, 2, true, true];
                    } else {
                        _unlock = DZE_myVehicle addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",DZE_myVehicle, 2, true, true];
                    };
                    s_player_lockUnlockInside set [count s_player_lockUnlockInside,_unlock];
                    s_player_lockUnlockInside_ctrl = 1;
                };
            } else {
                if (_hasKey || _oldOwner) then {
                    _lock = DZE_myVehicle addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",DZE_myVehicle, 1, false, true];
                    s_player_lockUnlockInside set [count s_player_lockUnlockInside,_lock];
                    s_player_lockUnlockInside_ctrl = 1;
                };
            };
        };
    } else {
        {DZE_myVehicle removeAction _x} count s_player_lockUnlockInside;s_player_lockUnlockInside = [];
        s_player_lockUnlockInside_ctrl = -1;
    };
} else {
    {DZE_myVehicle removeAction _x} count s_player_lockUnlockInside;s_player_lockUnlockInside = [];
    s_player_lockUnlockInside_ctrl = -1;
};

if (DZE_HeliLift) then {
    _hasAttached = _vehicle getVariable["hasAttached",false];
    if (_inVehicle && {_vehicle isKindOf "Air"} && {(([_vehicle] call FNC_getPos) select 2) < 30} && {speed _vehicle < 5} && {typeName _hasAttached == "OBJECT"}) then {
        if (s_player_heli_detach < 0) then {
            dayz_myLiftVehicle = _vehicle;
            s_player_heli_detach = dayz_myLiftVehicle addAction [localize "STR_EPOCH_ACTIONS_DETACHVEHICLE","\z\addons\dayz_code\actions\player_heliDetach.sqf",[dayz_myLiftVehicle,_hasAttached],2,false,true];
        };
    } else {
        dayz_myLiftVehicle removeAction s_player_heli_detach;
        s_player_heli_detach = -1;
    };
};

if (DZE_HaloJump) then {
    if (_inVehicle && {_vehicle isKindOf "Air"} && {(([_vehicle] call FNC_getPos) select 2) > 400}) then {
        if (s_halo_action < 0) then {
            DZE_myHaloVehicle = _vehicle;
            s_halo_action = DZE_myHaloVehicle addAction [localize "STR_EPOCH_ACTIONS_HALO","\z\addons\dayz_code\actions\halo_jump.sqf",[],2,false,true];
        };
    } else {
        DZE_myHaloVehicle removeAction s_halo_action;
        s_halo_action = -1;
    };
};

if (DZE_NameTags > 0) then {
    if (s_player_showname < 0 && !_isPZombie) then {
        if (DZE_NameTags < 2) then {
            s_player_showname = 1;
            player setVariable["DZE_display_name",true,true];
        } else {
            s_player_showname = player addAction [localize "STR_EPOCH_ACTIONS_NAMEYES", "\z\addons\dayz_code\actions\display_name.sqf",true, 0, true, false];
            s_player_showname1 = player addAction [localize "STR_EPOCH_ACTIONS_NAMENO", "\z\addons\dayz_code\actions\display_name.sqf",false, 0, true, false];
        };
    };
};

if (_isPZombie) then {
    if (s_player_attack < 0) then {
        s_player_attack = player addAction [localize "STR_EPOCH_ACTIONS_ATTACK", "\z\addons\dayz_code\actions\pzombie\pz_attack.sqf", _cursorTarget, 6, false, true];
    };
    if (s_player_callzombies < 0) then {
        s_player_callzombies = player addAction [localize "STR_EPOCH_ACTIONS_RAISEHORDE", "\z\addons\dayz_code\actions\pzombie\call_zombies.sqf",player, 5, true, false];
    };
    if (s_player_pzombiesvision < 0) then {
        s_player_pzombiesvision = player addAction [localize "STR_EPOCH_ACTIONS_NIGHTVIS", "\z\addons\dayz_code\actions\pzombie\pz_vision.sqf", [], 4, false, true, "nightVision", "_this == _target"];
    };
    if (!isNull _cursorTarget && (player distance _cursorTarget < 3)) then {
        _isZombie = _cursorTarget isKindOf "zZombie_base";
        _isHarvested = _cursorTarget getVariable["meatHarvested",false];
        _isMan = _cursorTarget isKindOf "Man"; //includes animals and zombies
        if (!alive _cursorTarget && _isMan && !_isZombie && !_isHarvested) then {
            if (s_player_pzombiesfeed < 0) then {
                s_player_pzombiesfeed = player addAction [localize "STR_EPOCH_ACTIONS_FEED", "\z\addons\dayz_code\actions\pzombie\pz_feed.sqf",_cursorTarget, 3, true, false];
            };
        } else {
            player removeAction s_player_pzombiesfeed;
            s_player_pzombiesfeed = -1;
        };
    } else {
        player removeAction s_player_pzombiesfeed;
        s_player_pzombiesfeed = -1;
    };
};

// Increase distance only if AIR or SHIP
_allowedDistance = if ((_cursorTarget isKindOf "Air") or (_cursorTarget isKindOf "Ship")) then {8} else {4};

if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cursorTarget < _allowedDistance) && _canDo) then {
//Has some kind of target
    _typeOfCursorTarget = typeOf _cursorTarget;
    _isVehicle = _cursorTarget isKindOf "AllVehicles";
    _isBicycle = _cursorTarget isKindOf "Bicycle";
    _isMan = _cursorTarget isKindOf "Man"; //includes animals and zombies
    _isDestructable = _cursorTarget isKindOf "BuiltItems";
    _isGenerator = _cursorTarget isKindOf "Generator_DZ";
    //_isVehicletype = _typeOfCursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"]; //Checked in player_flipvehicle
    _isFuel = false;
    _hasBarrel = "ItemFuelBarrel" in _magazinesPlayer;
    _hasFuel20 = "ItemJerrycan" in _magazinesPlayer;
    _hasFuel5 = "ItemFuelcan" in _magazinesPlayer;
    _hasEmptyFuelCan = (("ItemJerrycanEmpty" in _magazinesPlayer) || ("ItemFuelcanEmpty" in _magazinesPlayer) || ("ItemFuelBarrelEmpty" in _magazinesPlayer));
    _itemsPlayer = items player;
    _weaponsPlayer = weapons player;
    _hasCrowbar = "ItemCrowbar" in _itemsPlayer or "MeleeCrowbar" in _weaponsPlayer or dayz_onBack == "MeleeCrowbar";
    _hasToolbox = "ItemToolbox" in _itemsPlayer;
    _hasbottleitem = (("ItemWaterBottle" in _magazinesPlayer) || ("ItemWaterBottleInfected" in _magazinesPlayer) || ("ItemWaterBottleSafe" in _magazinesPlayer));
    _isAlive = alive _cursorTarget;
    _text = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName");
    _isPlant = _typeOfCursorTarget in Dayz_plants;
    _istypeTent = (_cursorTarget isKindOf "TentStorage_base") or (_cursorTarget isKindOf "IC_Tent");
    _upgradeItems = ["TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","StashSmall","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3","DomeTentStorage","DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DomeTentStorage4"];
    _characterID = _cursorTarget getVariable ["CharacterID","0"];
    
    if (DZE_permanentPlot) then {
        _id = _uid;
        _ownerID = _cursorTarget getVariable ["ownerPUID","0"];
    } else {
        _id = dayz_characterID;
        _ownerID = _characterID;
    };

    _isDisallowRefuel = _typeOfCursorTarget in ["M240Nest_DZ","MMT_Civ","MMT_USMC","Old_bike_TK_CIV_EP1","Old_bike_TK_INS_EP1"];    
    _isDog = (_cursorTarget isKindOf "Pastor" || _cursorTarget isKindOf "Fin");
    _isModular = _cursorTarget isKindOf "ModularItems";
    _isModularDoor = _typeOfCursorTarget in ["Land_DZE_WoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_GarageWoodDoor","CinderWallDoor_DZ","CinderWallDoorSmall_DZ"];
    _player_deleteBuild = false;
    _player_lockUnlock_crtl = false;
    
    //fuel tanks
    if (_hasEmptyFuelCan) then {
        {
            if (_cursorTarget isKindOf _x) exitWith {_isFuel = true;};
        } count dayz_fuelsources;
    };

    //remove gathered plant if empty
    if (_isPlant) then {
        _cursorTarget call player_gather;
    };

    //flip vehicle
    if (_isVehicle && {!_isMan} && {!(canMove _cursorTarget)} && {_isAlive} && {player distance _cursorTarget >= 2} && {(count (crew _cursorTarget))== 0} && {((vectorUp _cursorTarget) select 2) < 0.5}) then {
        if (s_player_flipveh < 0) then {
            s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, true, true];
        };
    } else {
        player removeAction s_player_flipveh;
        s_player_flipveh = -1;
    };
    
    //Allow player to fill Fuel can
    if (_hasEmptyFuelCan && {_isFuel} && {!a_player_jerryfilling} && {_isAlive}) then {
        if (s_player_fillfuel < 0) then {
            s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",_cursorTarget, 1, false, true];
        };
    } else {
        player removeAction s_player_fillfuel;
        s_player_fillfuel = -1;
    };
    
    if (damage _cursorTarget < 1) then {
        //Allow player to fill vehicle 210L
        if (_hasBarrel && {!_isMan} && {_isVehicle} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
            if (s_player_fillfuel210 < 0) then {
                s_player_fillfuel210 = player addAction [format[localize "str_actions_medical_10",_text,"210"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemFuelBarrel",_cursorTarget], 0, true, true, "", "'ItemFuelBarrel' in magazines player"];
            };
        } else {
            player removeAction s_player_fillfuel210;
            s_player_fillfuel210 = -1;
        };
        
        //Allow player to fill vehicle 20L
        if (_hasFuel20 && {!_isMan} && {_isVehicle} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
            if (s_player_fillfuel20 < 0) then {
                s_player_fillfuel20 = player addAction [format[localize "str_actions_medical_10",_text,"20"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemJerrycan",_cursorTarget], 0, true, true, "", "'ItemJerrycan' in magazines player"];
            };
        } else {
            player removeAction s_player_fillfuel20;
            s_player_fillfuel20 = -1;
        };

        //Allow player to fill vehicle 5L
        if (_hasFuel5 && {!_isMan} && {_isVehicle} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
            if (s_player_fillfuel5 < 0) then {
                s_player_fillfuel5 = player addAction [format[localize "str_actions_medical_10",_text,"5"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemFuelcan",_cursorTarget], 0, true, true, "", "'ItemFuelcan' in magazines player"];
            };
        } else {
            player removeAction s_player_fillfuel5;
            s_player_fillfuel5 = -1;
        };
        /*
            Vanilla generator is currently not functional.
            Vanilla generator refuel actions removed for now.
            Epoch generator fill action is below.
        */
        //Allow player to siphon vehicles
        if (_hasEmptyFuelCan && {!_isMan} && {_isVehicle} && {!_isBicycle} && {!a_player_jerryfilling} && {fuel _cursorTarget > 0}) then {
            if (s_player_siphonfuel < 0) then {
                s_player_siphonfuel = player addAction [format[localize "str_siphon_start"], "\z\addons\dayz_code\actions\siphonFuel.sqf",_cursorTarget, 0, true, true];
            };
        } else {
            player removeAction s_player_siphonfuel;
            s_player_siphonfuel = -1;
        };
    } else {
        player removeAction s_player_fillfuel210;
        s_player_fillfuel210 = -1;
        player removeAction s_player_fillfuel20;
        s_player_fillfuel20 = -1;
        player removeAction s_player_fillfuel5;
        s_player_fillfuel5 = -1;
        player removeAction s_player_siphonfuel;
        s_player_siphonfuel = -1;
    };
    
    //Fireplace Actions check
    if ((_cursorTarget call isInflamed) or (inflamed _cursorTarget)) then {
        _hasRawMeat = {_x in Dayz_meatraw} count _magazinesPlayer > 0;
        _hastinitem = {_x in boil_tin_cans} count _magazinesPlayer > 0;
        
    //Cook Meat    
        if (_hasRawMeat && !a_player_cooking) then {
            if (s_player_cook < 0) then {
                s_player_cook = player addAction [localize "str_actions_self_05", "\z\addons\dayz_code\actions\cook.sqf",_cursorTarget, 3, true, true];
            };
        }; 
    //Boil Water
        if (_hastinitem && _hasbottleitem && !a_player_boil) then {
            if (s_player_boil < 0) then {
                s_player_boil = player addAction [localize "str_actions_boilwater", "\z\addons\dayz_code\actions\boil.sqf",_cursorTarget, 3, true, true];
            };
        };
    } else {
        if (a_player_cooking) then {
            player removeAction s_player_cook;
            s_player_cook = -1;
        };
        if (a_player_boil) then {
            player removeAction s_player_boil;
            s_player_boil = -1;
        };
    };
    
//    Not needed.
/*
    if(_cursorTarget == dayz_hasFire) then {
        if ((s_player_fireout < 0) && !(_cursorTarget call isInflamed) && (player distance _cursorTarget < 3)) then {
            s_player_fireout = player addAction [localize "str_actions_self_06", "\z\addons\dayz_code\actions\fire_pack.sqf",_cursorTarget, 0, false, true];
        };
    } else {
        player removeAction s_player_fireout;
        s_player_fireout = -1;
    };
*/
    if (_isAlive) then {
        //Allow player to delete objects
        if (_isDestructable || {((_typeOfCursorTarget in DZE_isWreck) or (_typeOfCursorTarget in DZE_isWreckBuilding))} || {(_typeOfCursorTarget in DZE_isRemovable)}) then {
            if (_hasToolbox && _hasCrowbar) then {
                _player_deleteBuild = true;
            };
        };    

        if (_isModular || _isModularDoor || _isGenerator || {_typeOfCursorTarget in DZE_isDestroyableStorage}) then {
            if (_hasToolbox && _hasCrowbar) then {
                _hasAccess = [player, _cursorTarget] call FNC_check_access;
                if ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) then {
                    _player_deleteBuild = true;
                };
            };
        };
        
        if (_isVehicle) then {
            if ((_characterID != "0") && {!_isMan}) then {
                _player_lockUnlock_crtl = true;
            };
        };
    };
    
    if (_player_deleteBuild) then {
        if (s_player_deleteBuild < 0) then {
            s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, false, true];
        };
    } else {
        player removeAction s_player_deleteBuild;
        s_player_deleteBuild = -1;
    };

    //remove Own objects
    if (_ownerID == _id) then {
        //upgrade items
        if (_typeOfCursorTarget in _upgradeItems) then {
            if (s_player_upgradestorage < 0) then {
                if (isText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "Upgrade" >> "create")) then {
                    _displayName = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName");
                    s_player_upgradestorage = player addAction [format[localize "str_upgrade",_displayName], "\z\addons\dayz_code\actions\object_upgradeStorage.sqf",_cursorTarget, 0, false, true];
                };
            };
        } else {
            player removeAction s_player_upgradestorage;
            s_player_upgradestorage = -1
        };
        if (_istypeTent) then {
            //Packing my tent
            if (s_player_packtent < 0) then {
                s_player_packtent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, false, true];
            };
        } else {
            player removeAction s_player_packtent;
            s_player_packtent = -1;
        };
    } else {
        player removeAction s_player_upgradestorage;
        s_player_upgradestorage = -1;
        player removeAction s_player_packtent;
        s_player_packtent = -1;
    };
    //other tents
    if (_istypeTent) then {
        //destroy tents
        //Located in variables Dayz_Ignators = ["ItemMatchbox","Item5Matchbox","Item4Matchbox","Item3Matchbox","Item2Matchbox","Item1Matchbox"];
        _hasIgnators = {_x in Dayz_Ignators} count _itemsPlayer > 0;
        if ((_hasFuel20 or _hasFuel5 or _hasBarrel) && _hasIgnators) then {
            if (s_player_destorytent < 0) then {
                s_player_destorytent = player addAction [localize "str_actions_self_destorytent", "\z\addons\dayz_code\actions\player_destroyTent.sqf",_cursorTarget, 0, false, true];
            };
        } else {
            player removeAction s_player_destorytent;
            s_player_destorytent = -1;
        };    
        if (_typeOfCursorTarget in ["IC_DomeTent","IC_Tent"]) then {
            if (s_player_packtentinfected < 0) then {
                s_player_packtentinfected = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, false, true];
            };
        } else {
            player removeAction s_player_packtentinfected;
            s_player_packtentinfected = -1;
        };
        //sleep
        if (s_player_sleep < 0) then {
            s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",_cursorTarget, 0, false, true];
        };
    } else {
        player removeAction s_player_sleep;
        s_player_sleep = -1;
    };
/*    
    //Carbomb
    _hasCarBomb = "ItemCarBomb" in _magazinesPlayer;
    if (((_cursorTarget isKindOf "Car") || (_cursorTarget isKindOf "Air") || (_cursorTarget isKindOf "Motorcycle")) && _hasCarBomb) then {
        if (s_player_attach_bomb < 0) then {
            s_player_attach_bomb = player addAction [localize "str_bombAttach", "\z\addons\dayz_code\actions\player_attach_bomb.sqf",_cursorTarget, 3, true, true];
        };
    } else {
            player removeAction s_player_attach_bomb;
            s_player_attach_bomb = -1;
    };
*/
    //Repairing Vehicles
    if (_isVehicle && {!_isMan} && {dayz_myCursorTarget != _cursorTarget} && {_hasToolbox} && {damage _cursorTarget < 1} && {_typeOfCursorTarget != "M240Nest_DZ"}) then {
        if (s_player_repair_crtl < 0) then {
            dayz_myCursorTarget = _cursorTarget;
            _menu = dayz_myCursorTarget addAction [localize "str_actions_repairveh", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false];
            if (!_isBicycle) then { //Bike wheels should not give full size tires. Also model does not update to show removed wheels.
                if (!DZE_salvageLocked) then {
                    if (!locked _cursorTarget) then {
                        _menu1 = dayz_myCursorTarget addAction [localize "str_actions_salvageveh", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false];
                        s_player_repairActions set [count s_player_repairActions,_menu1];
                    };
                } else {
                    _menu1 = dayz_myCursorTarget addAction [localize "str_actions_salvageveh", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false];
                    s_player_repairActions set [count s_player_repairActions,_menu1];
                };
            };
            s_player_repairActions set [count s_player_repairActions,_menu];
            s_player_repair_crtl = 1;
        } else {
            {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;
            s_player_repairActions = [];
            s_player_repair_crtl = -1;
        };
    };
    /* //Vanilla base building currently not used in Epoch
    // House locking and unlocking
    _isHouse = _typeOfCursorTarget in ["SurvivorWorkshopAStage5", "SurvivorWorkshopBStage5", "SurvivorWorkshopCStage5"];
    _isGate = _typeOfCursorTarget in ["WoodenGate_1","WoodenGate_2","WoodenGate_3","WoodenGate_4","MetalGate_1","MetalGate_2","MetalGate_3","MetalGate_4"];
    _isFence = _typeOfCursorTarget in ["WoodenFence_1","WoodenFence_2","WoodenFence_3","WoodenFence_4","WoodenFence_5","WoodenFence_6","MetalFence_1","MetalFence_2","MetalFence_3","MetalFence_4","MetalFence_5","MetalFence_6","MetalFence_7"];

    //Only the owners can lock the gates
    _isLockableGate = _typeOfCursorTarget in ["WoodenGate_2","WoodenGate_3","WoodenGate_4","MetalGate_2","MetalGate_3","MetalGate_4"];
    _isUnlocked = _cursorTarget getVariable ["isOpen","0"] == "1";

    //Allow the gates to be opened when not locked by anyone
    _isOpen = ((_cursorTarget animationPhase "DoorL") == 1) || ((_cursorTarget animationPhase "DoorR") == 1);
    _isClosed = ((_cursorTarget animationPhase "DoorL") == 0) || ((_cursorTarget animationPhase "DoorR") == 0);
    
    //[["ownerArray",["PID"]]]
    _ownerArray = _cursorTarget getVariable ["ownerArray",["0"]];
    _ownerBuildLock = _cursorTarget getVariable ["BuildLock",false];    
    _ownerPID = (_ownerArray select 0);
    
    // open Gate
    if (_isGate && _isClosed && _isUnlocked) then {
        if (s_player_openGate < 0) then {
            s_player_openGate = player addAction [localize "STR_DN_OUT_O_GATE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Open"], 1, true, true];
        };
    } else {
        player removeAction s_player_openGate;
        s_player_openGate = -1;
    };
    // Close Gate
    if (_isGate && _isOpen && _isUnlocked) then {
        if (s_player_CloseGate < 0) then {
            s_player_CloseGate = player addAction [localize "STR_DN_OUT_C_GATE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Close"], 1, true, true];
        };
    } else {
        player removeAction s_player_CloseGate;
        s_player_CloseGate = -1;
    };
    // Set
    if ((_isHouse or _isLockableGate) && (_ownerPID == _uid) && !_isUnlocked && _isClosed) then {
        if (s_player_setCode < 0) then {
            s_player_setCode = player addAction [localize "STR_BLD_ACTIONS_SETLOCKCODE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Set"], 1, true, true];
        };
    } else {
        player removeAction s_player_setCode;
        s_player_setCode = -1;
    };
    //Lock Build point
    if ((_isFence or _isGate) && (_ownerPID == _uid) && !_ownerBuildLock) then {
        if (s_player_BuildLock < 0) then {
            s_player_BuildLock = player addAction [localize "STR_BLD_ACTIONS_LOCKBUILD", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"BuildLock"], 1, true, true];
        };
    } else {
        player removeAction s_player_BuildLock;
        s_player_BuildLock = -1;
    };
    //UnLock Build point
    if ((_isFence or _isGate) && (_ownerPID == _uid) && _ownerBuildLock) then {
        if (s_player_BuildUnLock < 0) then {
            s_player_BuildUnLock = player addAction [localize "STR_BLD_ACTIONS_UNLOCKBUILD", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"BuildUnLock"], 1, true, true];
        };
    } else {
        player removeAction s_player_BuildUnLock;
        s_player_BuildUnLock = -1;
    };
    // Unlock Gate/House
    if ((_isHouse or _isLockableGate) && !_isUnlocked && _isClosed) then {
        if (s_player_unlockhouse < 0) then {
            s_player_unlockhouse = player addAction [localize "STR_BLD_ACTIONS_UNLOCKGATE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Unlock"], 1, true, true];
        };
    } else {
        player removeAction s_player_unlockhouse;
        s_player_unlockhouse = -1;
    };
    // Lock Gate/House
    if ((_isHouse or _isLockableGate) && _isUnlocked && _isClosed) then {
        if (s_player_lockhouse < 0) then {
            s_player_lockhouse = player addAction [localize "STR_BLD_ACTIONS_LOCKGATE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Lock"], 1, true, true];
        };
    } else {
        player removeAction s_player_lockhouse;
        s_player_lockhouse = -1;
    };
    //Break In
    if ((_isHouse or _isLockableGate) && (_ownerPID != _uid) && !_isUnlocked) then {
        if (s_player_breakinhouse < 0) then {
            s_player_breakinhouse = player addAction [localize "STR_BLD_ACTIONS_BREAKIN", "\z\addons\dayz_code\actions\player_breakin.sqf",_cursorTarget, 1, true, true];
        };
    } else {
        player removeAction s_player_breakinhouse;
        s_player_breakinhouse = -1;
    };*/
    //          if (s_player_garage < 0) then {        //if ((s_player_garage < 0) && (_allowed or (_hasAccess select 1))) then {
    
    if (_typeOfCursorTarget in DZE_Garage && {speed player <= 1}) then {
        _hasAccess = [player, _cursorTarget] call FNC_check_access;
        _allowed = ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3) or (_hasAccess select 4));
        if ((s_player_garage < 0) && (_allowed or (_hasAccess select 1))) then {
            s_player_garage =  player addAction ["<t color='#FFAA00'>Garage Menu</t>", "custom\Garage\player_virtualgarage.sqf", _cursorTarget, 2, false];
        } else {
            s_player_garage = player addAction ["<t color='#FF0000'>Garage Locked</t>", "",_cursorTarget, 2, true, true, "", ""];  
        };
    } else {
        player removeAction s_player_garage;
        s_player_garage = -1;      
    };
    
    if ((_cursorTarget isKindOf "Plastic_Pole_EP1_DZ") && {speed player <= 1}) then {
        _hasAccess = [player, _cursorTarget] call FNC_check_access;
        _allowed = ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3) or (_hasAccess select 4));
        if (DZE_permanentPlot) then {
            if (s_player_plotManagement < 0 && _allowed) then {
                s_player_plotManagement = player addAction [format["<t color='#0059FF'>%1</t>",localize "STR_EPOCH_ACTIONS_MANAGEPLOT"], "\z\addons\dayz_code\actions\plotManagement\initPlotManagement.sqf", [], 5, false];
            };
        } else {
            if (s_player_maintain_area < 0) then {
                s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", "maintain", 5, false];
                s_player_maintain_area_force = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_FORCE_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", "force", 5, false];
                s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\maintain_area.sqf", "preview", 5, false];
            };
        };
        if (s_player_plot_boundary < 0 && (_allowed or (_hasAccess select 1))) then {
            s_player_plot_boundary = player addAction [localize "STR_EPOCH_PLOTMANAGEMENT_SHOW_BOUNDARY", "\z\addons\dayz_code\actions\plotManagement\plotToggleMarkers.sqf", "", 1, false];
        };
        if (DZE_permanentPlot && DZE_PlotOwnership) then {
            if (s_player_plot_take_ownership < 0 && (_hasAccess select 0)) then {
                s_player_plot_take_ownership = player addAction [localize "STR_EPOCH_APLOTFORLIFE_TAKE_PLOT_OWNERSHIP", "\z\addons\dayz_code\actions\plot_take_ownership.sqf", "", 1, false];
            };
        };
    } else {
        player removeAction s_player_plotManagement;
        s_player_plotManagement = -1;
        player removeAction s_player_maintain_area;
        s_player_maintain_area = -1;
        player removeAction s_player_maintain_area_force;
        s_player_maintain_area_force = -1;
        player removeAction s_player_maintain_area_preview;
        s_player_maintain_area_preview = -1;
        player removeAction s_player_plot_boundary;
        s_player_plot_boundary = -1;
        player removeAction s_player_plot_take_ownership;
        s_player_plot_take_ownership = -1;
    };
    
    if (DZE_HeliLift) then {
        _liftHeli = objNull;
        _found = false;    
        _allowTow = false;
        if ((count (crew _cursorTarget)) == 0) then {
            {
                if (!_allowTow) then {
                    _allowTow = _cursorTarget isKindOf _x;
                };
            } count DZE_HeliAllowToTow;
        };

        if (_allowTow) then {
            {
                if (!_found) then {
                    _posL = [_x] call FNC_getPos;
                    _posC = [_cursorTarget] call FNC_getPos;
                    _height = (_posL select 2) - (_posC select 2);
                    _hasAttached = _x getVariable["hasAttached",false];
                    if ((_height < 15) && {_height > 5} && {typeName _hasAttached != "OBJECT"}) then {
                        if (((abs((_posL select 0) - (_posC select 0))) < 10) && {(abs((_posL select 1) - (_posC select 1))) < 10}) then {
                            _liftHeli = _x;
                            _found = true;
                        };
                    };
                };
            } count (player nearEntities [DZE_HeliAllowTowFrom,15]);
        };

        _attached = _cursorTarget getVariable["attached",false];
        if (_found && {_allowTow} && {!locked _cursorTarget} && {!_isPZombie} && {typeName _attached != "OBJECT"}) then {
            if (s_player_heli_lift < 0) then {
                s_player_heli_lift = player addAction [localize "STR_EPOCH_ACTIONS_ATTACHTOHELI", "\z\addons\dayz_code\actions\player_heliLift.sqf",[_liftHeli,_cursorTarget], -10, false, true];
            };
        } else {
            player removeAction s_player_heli_lift;
            s_player_heli_lift = -1;
        };
    };
    
    // Allow Owner to lock and unlock vehicle  
    if (_player_lockUnlock_crtl) then {
        if (s_player_lockUnlock_crtl < 0) then {
            _totalKeys = call epoch_tempKeys;
            _temp_keys = _totalKeys select 0;
            _temp_keys_names = _totalKeys select 1;
            _hasKey = _characterID in _temp_keys;
            _oldOwner = (_characterID == _uid);
            if (locked _cursorTarget) then {
                if (_hasKey || _oldOwner) then {
                    _unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",[_cursorTarget,(_temp_keys_names select (parseNumber _characterID))], 2, true, true];
                    s_player_lockunlock set [count s_player_lockunlock,_unlock];
                    s_player_lockUnlock_crtl = 1;
                } else {
                    if (_hasHotwireKit) then {
                        _unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",_cursorTarget, 2, true, true];
                    } else {
                        _unlock = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",_cursorTarget, 2, false, true];
                    };
                    s_player_lockunlock set [count s_player_lockunlock,_unlock];
                    s_player_lockUnlock_crtl = 1;
                };
            } else {
                if (_hasKey || _oldOwner) then {
                    _lock = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true];
                    s_player_lockunlock set [count s_player_lockunlock,_lock];
                    s_player_lockUnlock_crtl = 1;
                };
            };
        };     
    } else {
        {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
        s_player_lockUnlock_crtl = -1;
    };
    
    // gear access on surrendered player
    if (isPlayer _cursorTarget && {_isAlive} && {_cursorTarget getVariable ["DZE_Surrendered",false]}) then {
        if (s_player_SurrenderedGear < 0) then {
            s_player_SurrenderedGear = player addAction [localize "STR_UI_GEAR", "\z\addons\dayz_code\actions\surrender_gear.sqf",_cursorTarget, 1, true, true];
        };
    } else {
        player removeAction s_player_SurrenderedGear;
        s_player_SurrenderedGear = -1;
    };

    // Allow manage door
    if (DZE_doorManagement && (_typeOfCursorTarget in DZE_DoorsLocked)) then {
        // Check player access
        _hasAccess = [player, _cursorTarget] call FNC_check_access;
        if (s_player_manageDoor < 0 && ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3) or (_hasAccess select 4) or (_hasAccess select 5) or (_hasAccess select 6))) then {
            s_player_manageDoor = player addAction [format["<t color='#0059FF'>%1</t>", localize "STR_EPOCH_ACTIONS_MANAGEDOOR"], "\z\addons\dayz_code\actions\doorManagement\initDoorManagement.sqf", _cursorTarget, 5, false];
        };
    } else {
        player removeAction s_player_manageDoor;
        s_player_manageDoor = -1;
    };

    //Allow owner to unlock vault
    if ((_typeOfCursorTarget in DZE_LockableStorage) && {_characterID != "0"} && {player distance _cursorTarget < 3} && {!keypadCancel}) then {
        if (s_player_unlockvault < 0) then {
            if (_typeOfCursorTarget in DZE_LockedStorage) then {
                if (_characterID == dayz_combination || _ownerID == _uid) then {
                    _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_OPEN",_text], "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, false, true];
                    s_player_combi set [count s_player_combi,_combi];
                } else {
                    _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true];
                    s_player_combi set [count s_player_combi,_combi];
                };
                s_player_unlockvault = 1;
            } else {
                if (_characterID != dayz_combination && _ownerID != _uid) then {
                    _combi = player addAction [localize "STR_EPOCH_ACTIONS_RECOMBO", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true];
                    s_player_combi set [count s_player_combi,_combi];
                    s_player_unlockvault = 1;
                };
            };
        };
    } else {
        {player removeAction _x} count s_player_combi;s_player_combi = [];
        s_player_unlockvault = -1;
    };

    //Allow owner to pack vault
    if ((_typeOfCursorTarget in DZE_UnLockedStorage) && {_characterID != "0"} && {player distance _cursorTarget < 3}  && {!keypadCancel}) then {
        if (s_player_lockvault < 0) then {
            if (_characterID == dayz_combination || _ownerID == _uid) then {
                s_player_lockvault = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\vault_lock.sqf",_cursorTarget, 0, false, true];
            };
        };
        if (s_player_packvault < 0 && (_characterID == dayz_combination || _ownerID == _uid)) then {
            s_player_packvault = player addAction [format["<t color='#ff0000'>%1</t>",(format[localize "STR_EPOCH_ACTIONS_PACK",_text])], "\z\addons\dayz_code\actions\vault_pack.sqf",_cursorTarget, 0, false, true];
        };
    } else {
        player removeAction s_player_packvault;
        s_player_packvault = -1;
        player removeAction s_player_lockvault;
        s_player_lockvault = -1;
    };

    //Player Deaths
    if (_typeOfCursorTarget == "Info_Board_EP1") then {
        if (s_player_information < 0) then {
            s_player_information = player addAction [localize "STR_EPOCH_ACTIONS_MURDERS", "\z\addons\dayz_code\actions\list_playerDeaths.sqf",[], 7, false, true];
        };
    } else {
        player removeAction s_player_information;
        s_player_information = -1;
    };
    
    //Fuel Pump
    if (_typeOfCursorTarget in dayz_fuelpumparray) then {
        if (s_player_fuelauto < 0) then {        
            // check if Generator_DZ is running within 30 meters
            _findNearestGen = [];
            {
                if ((alive _x) && (_x getVariable ["GeneratorRunning", false])) then {
                    _findNearestGen set [count _findNearestGen,_x];
                };
            } count (nearestObjects [([player] call FNC_getPos), ["Generator_DZ"], 30]);
            
            // show that pump needs power if no generator nearby.
            if ((count _findNearestGen) > 0) then {
                s_player_fuelauto = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",objNull, 0, false, true];
            } else {
                s_player_fuelauto = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true];
            };
        };
    } else {
        player removeAction s_player_fuelauto;
        s_player_fuelauto = -1;
    };

    //Fuel Pump on truck
    if (_typeOfCursorTarget in DZE_fueltruckarray && _isAlive) then {
        if (s_player_fuelauto2 < 0) then {
            // show that fuel truck pump needs power.
            if (isEngineOn _cursorTarget) then {
                s_player_fuelauto2 = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",_cursorTarget, 0, false, true];
            } else {
                s_player_fuelauto2 = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true];
            };
        };
    } else {
        player removeAction s_player_fuelauto2;
        s_player_fuelauto2 = -1;
    };

    // inplace upgrade tool
    if ((_cursorTarget isKindOf "ModularItems") || (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") || (_cursorTarget isKindOf "CinderWallDoor_DZ_Base")) then {
        if ((s_player_lastTarget select 0) != _cursorTarget) then {
            if (s_player_upgrade_build > 0) then {
                player removeAction s_player_upgrade_build;
                s_player_upgrade_build = -1;
            };
        };
        if (s_player_upgrade_build < 0) then {
            _hasAccess = [player, _cursorTarget] call FNC_check_access;
            _upgrade = getArray (configFile >> "CfgVehicles" >> (typeOf _cursorTarget) >> "upgradeBuilding");
            if (((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) && (count _upgrade) > 0) then {
                s_player_lastTarget set [0,_cursorTarget];
                s_player_upgrade_build = player addAction [format[localize "str_upgrade",_text], "\z\addons\dayz_code\actions\player_upgrade.sqf",_cursorTarget, -1, false, true];
            };
        };
    } else {
        player removeAction s_player_upgrade_build;
        s_player_upgrade_build = -1;
    };
    
    // downgrade system
    if ((DZE_Lock_Door == _characterID)  && {!keypadCancel} && {_isDestructable || _cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" || _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base"}) then {
        if ((s_player_lastTarget select 1) != _cursorTarget) then {
            if (s_player_downgrade_build > 0) then {    
                player removeAction s_player_downgrade_build;
                s_player_downgrade_build = -1;
            };
        };
        if (s_player_downgrade_build < 0) then {
            _hasAccess = [player, _cursorTarget] call FNC_check_access;
            if ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) then {
                s_player_lastTarget set [1,_cursorTarget];
                s_player_downgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_REMLOCK",_text], "\z\addons\dayz_code\actions\player_buildingDowngrade.sqf",_cursorTarget, -2, false, true];
            };
        };
    } else {
        player removeAction s_player_downgrade_build;
        s_player_downgrade_build = -1;
    };

    // inplace maintenance tool
    if ((damage _cursorTarget >= DZE_DamageBeforeMaint) && {_cursorTarget isKindOf "ModularItems" || _cursorTarget isKindOf "DZE_Housebase" || _typeOfCursorTarget == "LightPole_DZ"}) then {
        if ((s_player_lastTarget select 2) != _cursorTarget) then {
            if (s_player_maint_build > 0) then {
                player removeAction s_player_maint_build;
                s_player_maint_build = -1;
            };
        };
        if (s_player_maint_build < 0) then {
            _hasAccess = [player, _cursorTarget] call FNC_check_access;
            if ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) then {
                _text2 = _text + " (" + str(round ((damage _cursorTarget) * 100)) + "% damaged)";
                s_player_lastTarget set [2,_cursorTarget];
                s_player_maint_build = player addAction [format["%1 %2",localize "STR_EPOCH_ACTIONS_MAINTAIN",_text2], "\z\addons\dayz_code\actions\player_buildingMaint.sqf",_cursorTarget, -2, false, true];
            };
        };
    } else {
        player removeAction s_player_maint_build;
        s_player_maint_build = -1;
    };

    //Start Generator
    if (_isGenerator) then {
        if (s_player_fillgen < 0) then {    
            // check if not running 
            if (_cursorTarget getVariable ["GeneratorRunning", false]) then {
                s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR1", "\z\addons\dayz_code\actions\stopGenerator.sqf",_cursorTarget, 0, false, true];                
            } else {
                // check if not filled and player has jerry.
                if (_cursorTarget getVariable ["GeneratorFilled", false]) then {
                    s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR2", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true];
                } else {
                    if (_hasFuel20 or _hasFuel5 or _hasBarrel) then {
                        s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR3", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true];
                    };
                };
            };
        };
    } else {
        player removeAction s_player_fillgen;
        s_player_fillgen = -1;
    };

    //Towing with tow truck
    /*
    if(_typeOfCursorTarget == "TOW_DZE") then {
        if (s_player_towing < 0) then {
            if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
                s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_ATTACH" "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true];                
            } else {
                s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_DETACH", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true];                
            };
        };
    } else {
        player removeAction s_player_towing;
        s_player_towing = -1;
    };
    */

    // All Traders
    if (_isMan && {!(isPlayer _cursorTarget)} && {_typeOfCursorTarget in serverTraders} && {!_isPZombie}) then {
        if (s_player_parts_crtl < 0) then {
            _humanity = player getVariable ["humanity",0];
            _traderMenu = call compile format["menu_%1;",_typeOfCursorTarget];        
            _low_high = localize "STR_EPOCH_ACTIONS_HUMANITY_LOW";
            _humanity_logic = false;
            if ((_traderMenu select 2) == "friendly") then {
                _humanity_logic = (_humanity < -5000);
            };
            if ((_traderMenu select 2) == "hostile") then {
                _low_high = localize "STR_EPOCH_ACTIONS_HUMANITY_HIGH";
                _humanity_logic = (_humanity > -5000);
            };
            if ((_traderMenu select 2) == "hero") then {
                _humanity_logic = (_humanity < 5000);
            };
            if (_humanity_logic) then {
                _cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false];
                s_player_parts set [count s_player_parts,_cancel];
            } else {
                // Static Menu
                {
                    _buy = player addAction [format["Trade %1 %2 for %3 %4",(_x select 3),(_x select 5),(_x select 2),(_x select 6)], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4),(_x select 5),(_x select 6)], (_x select 7), true, true];
                    s_player_parts set [count s_player_parts,_buy];        
                } count (_traderMenu select 1);
                if (DZE_ConfigTrader) then {
                    _buyV = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\AdvancedTrading\init.sqf",(_traderMenu select 0), 999, true, false];
                    s_player_parts set [count s_player_parts,_buyV];
                } else {
                    // Database menu
                    _buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu select 0), 999, true, false];
                    s_player_parts set [count s_player_parts,_buy];
                };
            };
            s_player_parts_crtl = 1;    
        };
    } else {
        {player removeAction _x} count s_player_parts;s_player_parts = [];
        s_player_parts_crtl = -1;
    };
    
    if (dayz_tameDogs) then {
        //Dog
        _hasRawMeat = {_x in Dayz_meatraw} count _magazinesPlayer > 0;
        if (_isDog && {_hasRawMeat} && {_isAlive} && {_ownerID == "0"} && {player getVariable ["dogID",0] == 0}) then {
            if (s_player_tamedog < 0) then {
                s_player_tamedog = player addAction [localize "str_actions_tamedog", "\z\addons\dayz_code\actions\dog\tame_dog.sqf", _cursorTarget, 1, false, true];
            };
        } else {
            player removeAction s_player_tamedog;
            s_player_tamedog = -1;
        };
        if (_isDog && {_ownerID == _id} && {_isAlive}) then {
            if (s_player_feeddog < 0 && _hasRawMeat) then {
                s_player_feeddog = player addAction [localize "str_actions_feeddog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,0], 0, false, true];
            };
            if (s_player_waterdog < 0 && _hasbottleitem) then {
                s_player_waterdog = player addAction [localize "str_actions_waterdog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,1], 0, false, true];
            };
            if (s_player_staydog < 0) then {
                if (_dogHandle getFSMVariable "_actionLieDown") then { _text = "str_actions_liedog"; } else { _text = "str_actions_sitdog"; };
                s_player_staydog = player addAction [localize _text,"\z\addons\dayz_code\actions\dog\stay.sqf", _dogHandle, 5, false, true];
            };
            if (s_player_trackdog < 0) then {
                s_player_trackdog = player addAction [localize "str_actions_trackdog","\z\addons\dayz_code\actions\dog\track.sqf", _dogHandle, 4, false, true];
            };
            if (s_player_barkdog < 0) then {
                s_player_barkdog = player addAction [localize "str_actions_barkdog","\z\addons\dayz_code\actions\dog\speak.sqf", _cursorTarget, 3, false, true];
            };
            if (s_player_warndog < 0) then {
                _warn = _dogHandle getFSMVariable "_watchDog";
                if (_warn) then { _text = localize "str_epoch_player_247"; _warn = false; } else { _text = localize "str_epoch_player_248"; _warn = true; };
                s_player_warndog = player addAction [format[localize "str_actions_warndog",_text],"\z\addons\dayz_code\actions\dog\warn.sqf",[_dogHandle, _warn], 2, false, true];        
            };
            if (s_player_followdog < 0) then {
                s_player_followdog = player addAction [localize "str_actions_followdog","\z\addons\dayz_code\actions\dog\follow.sqf",[_dogHandle,true], 6, false, true];
            };
        } else {
            player removeAction s_player_feeddog;
            s_player_feeddog = -1;
            player removeAction s_player_waterdog;
            s_player_waterdog = -1;
            player removeAction s_player_staydog;
            s_player_staydog = -1;
            player removeAction s_player_trackdog;
            s_player_trackdog = -1;
            player removeAction s_player_barkdog;
            s_player_barkdog = -1;
            player removeAction s_player_warndog;
            s_player_warndog = -1;
            player removeAction s_player_followdog;
            s_player_followdog = -1;
        };
    };
} else {
    //Engineering
    player removeAction s_player_plot_boundary;
    s_player_plot_boundary = -1;
    player removeAction s_player_plot_take_ownership;
    s_player_plot_take_ownership = -1;
    player removeAction s_player_plotManagement;
    s_player_plotManagement = -1;
    {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
    player removeAction s_player_repair_crtl;
    s_player_repair_crtl = -1;
    dayz_myCursorTarget = objNull;
    player removeAction s_player_flipveh;
    s_player_flipveh = -1;
    player removeAction s_player_sleep;
    s_player_sleep = -1;
    player removeAction s_player_deleteBuild;
    s_player_deleteBuild = -1;
    player removeAction s_player_cook;
    s_player_cook = -1;
    player removeAction s_player_boil;
    s_player_boil = -1;
    player removeAction s_player_fireout;
    s_player_fireout = -1;
    player removeAction s_player_packtent;
    s_player_packtent = -1;
    player removeAction s_player_packtentinfected;
    s_player_packtentinfected = -1;
    player removeAction s_player_fillfuel;
    s_player_fillfuel = -1;
    //fuel
    player removeAction s_player_fillfuel210;
    s_player_fillfuel210 = -1;
    player removeAction s_player_fillfuel20;
    s_player_fillfuel20 = -1;
    player removeAction s_player_fillfuel5;
    s_player_fillfuel5 = -1;
    //Allow player to siphon vehicle fuel
    player removeAction s_player_siphonfuel;
    s_player_siphonfuel = -1;
    //Allow player to gather
    player removeAction s_player_gather;
    s_player_gather = -1;
    player removeAction s_player_destorytent;
    s_player_destorytent = -1;
    // player removeAction s_player_attach_bomb;
    //  s_player_attach_bomb = -1;
    //debug
    //player removeAction s_player_debugCheck;
    //s_player_debugCheck = -1;
    player removeAction s_player_upgradestorage;
    s_player_upgradestorage = -1;
    /* //Unlock,Lock // Vanilla base building currently not used in Epoch
    player removeAction s_player_setCode;
    s_player_setCode = -1;
    player removeAction s_player_lockhouse;
    s_player_lockhouse = -1;
    player removeAction s_player_unlockhouse;
    s_player_unlockhouse = -1;
    player removeAction s_player_openGate;
    s_player_openGate = -1;
    player removeAction s_player_CloseGate;
    s_player_CloseGate = -1;
    player removeAction s_player_breakinhouse;
    s_player_breakinhouse = -1;
    player removeAction s_player_BuildUnLock;
    s_player_BuildUnLock = -1;
    player removeAction s_player_BuildLock;
    s_player_BuildLock = -1;*/
    {player removeAction _x} count s_player_combi;s_player_combi = [];    
    s_player_lastTarget = [objNull,objNull,objNull,objNull,objNull];
    {player removeAction _x} count s_player_parts;s_player_parts = [];
    s_player_parts_crtl = -1;
    {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
    s_player_lockUnlock_crtl = -1;
    player removeAction s_player_SurrenderedGear;
    s_player_SurrenderedGear = -1;
    player removeAction s_player_maintain_area;
    s_player_maintain_area = -1;
    player removeAction s_player_maintain_area_force;
    s_player_maintain_area_force = -1;
    player removeAction s_player_maintain_area_preview;
    s_player_maintain_area_preview = -1;    
    player removeAction s_player_tamedog;
    s_player_tamedog = -1;
    player removeAction s_player_feeddog;
    s_player_feeddog = -1;
    player removeAction s_player_waterdog;
    s_player_waterdog = -1;
    player removeAction s_player_staydog;
    s_player_staydog = -1;
    player removeAction s_player_trackdog;
    s_player_trackdog = -1;
    player removeAction s_player_barkdog;
    s_player_barkdog = -1;
    player removeAction s_player_warndog;
    s_player_warndog = -1;
    player removeAction s_player_followdog;
    s_player_followdog = -1;
    player removeAction s_player_unlockvault;
    s_player_unlockvault = -1;
    player removeAction s_player_packvault;
    s_player_packvault = -1;
    player removeAction s_player_lockvault;
    s_player_lockvault = -1;
    player removeAction s_player_information;
    s_player_information = -1;
    player removeAction s_player_fillgen;
    s_player_fillgen = -1;
    player removeAction s_player_upgrade_build;
    s_player_upgrade_build = -1;
    player removeAction s_player_maint_build;
    s_player_maint_build = -1;
    player removeAction s_player_downgrade_build;
    s_player_downgrade_build = -1;
    player removeAction s_player_towing;
    s_player_towing = -1;
    player removeAction s_player_fuelauto;
    s_player_fuelauto = -1;
    player removeAction s_player_fuelauto2;
    s_player_fuelauto2 = -1;
    player removeAction s_player_manageDoor;
    s_player_manageDoor = -1;
    
    // garage
    player removeAction s_player_garage;
    s_player_garage = -1;
};

//Dog actions on player self
if (_dogHandle > 0) then {
    _dog = _dogHandle getFSMVariable "_dog";
    if (isNil "_dog") exitWith {};
    if (isNil "_ownerID") then {_ownerID = "0"};
    if (_canDo && !_inVehicle && alive _dog && !(_ownerID in [dayz_characterID,_uid])) then {
        if (s_player_movedog < 0) then {
            s_player_movedog = player addAction [localize "str_actions_movedog", "\z\addons\dayz_code\actions\dog\move.sqf", player getVariable ["dogID",0], 1, false, true];
        };
        if (s_player_speeddog < 0) then {
            _text = localize "str_epoch_player_249";
            _speed = 0;
            if (_dog getVariable ["currentSpeed",1] == 0) then { _speed = 1; _text = localize "str_epoch_player_250"; };
            s_player_speeddog = player addAction [format[localize "str_actions_speeddog", _text], "\z\addons\dayz_code\actions\dog\speed.sqf",[player getVariable ["dogID",0],_speed], 0, false, true];
        };
        if (s_player_calldog < 0) then {
            s_player_calldog = player addAction [localize "str_actions_calldog", "\z\addons\dayz_code\actions\dog\follow.sqf", [player getVariable ["dogID",0], true], 2, false, true];
        };
    };
} else {
    player removeAction s_player_movedog;        
    s_player_movedog = -1;
    player removeAction s_player_speeddog;
    s_player_speeddog = -1;
    player removeAction s_player_calldog;
    s_player_calldog = -1;
};

//Monitor
player setVariable ["selfActions", diag_ticktime, false];
 

server update object

// [_object,_type] spawn server_updateObject;
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
if (isNil "sm_done") exitWith {};
private ["_objectID","_objectUID","_object_position","_isNotOk","_object","_type","_recorddmg","_forced","_lastUpdate","_needUpdate","_object_inventory","_object_damage","_objWallDamage","_object_killed","_object_maintenance","_object_variables","_totalDmg","_garagelist"];
_object = _this select 0;

// garage
if ((typeOf _object) in DZE_Garage) then {_garagelist = _this select 2;};

_type = _this select 1;
_recorddmg = false;
_isNotOk = false;
_forced = if (count _this > 2) then {_this select 2} else {false};
_totalDmg = if (count _this > 3) then {_this select 3} else {false};
_objectID = "0";
_objectUID = "0";

if ((isNil "_object") || {isNull _object}) exitWith {diag_log "server_updateObject.sqf _object null or nil, could not update object"};
_objectID = _object getVariable ["ObjectID","0"];
_objectUID = _object getVariable ["ObjectUID","0"];


if ((typeName _objectID == "SCALAR") || (typeName _objectUID == "SCALAR")) then { 
    #ifdef OBJECT_DEBUG
        diag_log (format["Non-string Object: ID %1 UID %2", _objectID, _objectUID]);
    #endif
    //force fail
    _objectID = nil;
    _objectUID = nil;
};

if (!((typeOf _object) in DZE_safeVehicle) && !locked _object) then {
    //diag_log format["Object: %1, ObjectID: %2, ObjectUID: %3",_object,_objectID,_objectUID];
    if (!(_objectID in dayz_serverIDMonitor) && isNil {_objectUID}) then { 
        //force fail
        _objectID = nil;
        _objectUID = nil;        
    };
    if ((isNil {_objectID}) && (isNil {_objectUID})) then {
        _object_position = getPosATL _object;
        #ifdef OBJECT_DEBUG
            diag_log format["Object %1 with invalid ID at pos %2",typeOf _object,_object_position];
        #endif
        _isNotOk = true;
    };
};

if (_isNotOk) exitWith {
    //deleteVehicle _object;
};

_lastUpdate = _object getVariable ["lastUpdate",diag_tickTime];
_needUpdate = _object in needUpdate_objects;

// TODO ----------------------
_object_position = {
    private ["_position","_worldspace","_fuel","_key"];
    _position = getPosATL _object;
    //_worldspace = [round (direction _object),_position];
    _worldspace = [getDir _object, _position] call AN_fnc_formatWorldspace; // Precise Base Building 1.0.5
    _fuel = if (_object isKindOf "AllVehicles") then {fuel _object} else {0};
    
    _key = format["CHILD:305:%1:%2:%3:",_objectID,_worldspace,_fuel];
    _key call server_hiveWrite;    

    #ifdef OBJECT_DEBUG
        diag_log ("HIVE: WRITE: "+ str(_key));
    #endif
};

_object_inventory = {
    private ["_inventory","_key","_isNormal","_coins"];
    
    // garage
    if ((typeOf _object) in DZE_Garage) then {
            if (isNil "_garagelist") then {
                _garagelist = _object getVariable ["StoredVehicles",[]];
            };
            if (_objectID == "0") then {
                _key = format["CHILD:309:%1:%2:",_uid,_garagelist];
            } else {
                _key = format["CHILD:303:%1:%2:",_objectID,_garagelist];
            };
            _key call server_hiveWrite;
        } else {
    if (_object isKindOf "TrapItems") then {
        _inventory = [["armed",_object getVariable ["armed",false]]];
    } else {
        _isNormal = true;
    };
        
        
        if (DZE_permanentPlot && (typeOf (_object) == "Plastic_Pole_EP1_DZ")) then {
            _isNormal = false;
            _inventory = _object getVariable ["plotfriends", []]; //We're replacing the inventory with UIDs for this item
        };
        
        if (DZE_doorManagement && (typeOf (_object) in DZE_DoorsLocked)) then {
            _isNormal = false;
            _inventory = _object getVariable ["doorfriends", []]; //We're replacing the inventory with UIDs for this item
        };
        
        if (_isNormal) then {
            _inventory = [getWeaponCargo _object, getMagazineCargo _object, getBackpackCargo _object];
        };
    };
    
    _previous = str(_object getVariable["lastInventory",[]]);
    if (str _inventory != _previous) then {
        _object setVariable["lastInventory",_inventory];
        if (_objectID == "0") then {
            _key = format["CHILD:309:%1:",_objectUID] + str _inventory + ":";
        } else {
            _key = format["CHILD:303:%1:",_objectID] + str _inventory + ":";
        };
        if (Z_SingleCurrency) then {
            _coins = _object getVariable [Z_MoneyVariable, -1]; //set to invalid value if getVariable fails to prevent overwriting of coins in DB
            _key = _key + str _coins + ":";
        };
        
        #ifdef OBJECT_DEBUG
            diag_log ("HIVE: WRITE: "+ str(_key));
        #endif
        
        _key call server_hiveWrite;
    };
};

_object_damage = {
    //Allow dmg process
    private ["_hitpoints","_array","_hit","_selection","_key","_damage","_allFixed"];
    
    // garage
    if ((typeOf _object) in DZE_Garage) then {
            _damage = damage _object;
            _array = _object getVariable ["GarageFriends",[]];
            _key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];
            _key call server_hiveWrite;
    } else {
    
    _hitpoints = _object call vehicle_getHitpoints;
    _damage = damage _object;
    _array = [];
    _allFixed = true;
    
    {
        _hit = [_object,_x] call object_getHit;
        _selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");
        if (_hit > 0) then {
            _allFixed = false;
            _array set [count _array,[_selection,_hit]];
            //diag_log format ["Section Part: %1, Dmg: %2",_selection,_hit]; 
        } else {
            _array set [count _array,[_selection,0]]; 
        };
        } forEach _hitpoints;
    };
    if (_allFixed && !_totalDmg) then {_object setDamage 0;};
    
    if (_forced) then {        
        if (_object in needUpdate_objects) then {needUpdate_objects = needUpdate_objects - [_object];};
        _recorddmg = true;           
    } else {
        //Prevent damage events for the first 10 seconds of the servers live.
        if (diag_ticktime - _lastUpdate > 10) then {
            if !(_object in needUpdate_objects) then {
                //diag_log format["DEBUG: Monitoring: %1",_object];
                needUpdate_objects set [count needUpdate_objects, _object];
                _recorddmg = true;
            };
        };

    
    if (_recorddmg) then {
        if (_objectID == "0") then {
            _key = format["CHILD:306:%1:",_objectUID] + str _array + ":" + str _damage + ":";
        } else {
            _key = format["CHILD:306:%1:",_objectID] + str _array + ":" + str _damage + ":";
        };
        
        diag_log ("HIVE: WRITE: "+ str(_key));
        _key call server_hiveWrite;   
    };
};
};
//Walls
_objWallDamage = {
    private ["_key","_damage"];
    _damage = (damage _object);

    if (_objectID == "0") then {
        _key = format["CHILD:306:%1:%2:%3:",_objectUID,[],_damage];
    } else {
        _key = format["CHILD:306:%1:%2:%3:",_objectID,[],_damage];
    };
    
    diag_log ("HIVE: WRITE: "+ str(_key));
    
    _key call server_hiveWrite;
};

_object_killed = {
    private "_key";
    _object setDamage 1;
    
    if (_objectID == "0") then {
        //Need to update hive to make a new call to allow UID to be updated for a killed event
        //_key = format["CHILD:306:%1:%2:%3:",_objectUID,[],1];
        _key = format["CHILD:310:%1:",_objectUID];
    } else {
        _key = format["CHILD:306:%1:%2:%3:",_objectID,[],1];
    };
    _key call server_hiveWrite;
    
    diag_log format["DELETE: Deleted by KEY: %1",_key];
    
    if (((typeOf _object) in DayZ_removableObjects) or ((typeOf _object) in DZE_isRemovable)) then {[_objectID,_objectUID] call server_deleteObj;};
};

_object_maintenance = {
    private ["_ownerArray","_key"];

    _ownerArray = _object getVariable ["ownerArray",[]];
    _accessArray = _object getVariable ["dayz_padlockCombination",[]];
    _variables set [count _variables, ["ownerArray", _ownerArray]];
    _variables set [count _variables, ["padlockCombination", _accessArray]];

    if (_objectID == "0") then {
        //_key = format["CHILD:309:%1:%2:",_objectUID,_ownerArray];
        _key = format["CHILD:306:%1:%2:%3:",_objectUID,[],0]; //Wont work just now.
    } else {
        //_key = format["CHILD:303:%1:%2:",_objectID,_ownerArray];
        _key = format["CHILD:306:%1:%2:%3:",_objectID,[],0];
    };

//    #ifdef OBJECT_DEBUG
        diag_log ("HIVE: WRITE: Maintenance, "+ str(_key));
//    #endif
    _key call server_hiveWrite;
};

_object_variables = {
    private ["_ownerArray","_key","_accessArray","_variables","_coins"];

    _ownerArray = _object getVariable ["ownerArray",[]];
    _accessArray = _object getVariable ["dayz_padlockCombination",[]];
    _lockedArray = _object getVariable ["BuildLock",false];
    
    //diag_log format ["[%1,%2]",_ownerArray,_accessArray];
    _variables = [];
    _variables set [count _variables, ["ownerArray", _ownerArray]];
    _variables set [count _variables, ["padlockCombination", _accessArray]];
    _variables set [count _variables, ["BuildLock", _lockedArray]];

    if (_objectID == "0") then {
        _key = format["CHILD:309:%1:%2:",_objectUID,_variables];
    } else {
        _key = format["CHILD:303:%1:%2:",_objectID,_variables];
    };
    if (Z_SingleCurrency) then {
        _coins = _object getVariable [Z_MoneyVariable, -1];
        _key = _key + str _coins + ":";
    };
    _key call server_hiveWrite;
};

_object setVariable ["lastUpdate",diag_ticktime,true];
switch (_type) do {
    case "all": {
        call _object_position;
        call _object_inventory;
        call _object_damage;
    };
    case "position": {
        call _object_position;
    };
    case "gear": {
        call _object_inventory;
    };
    case "maintenance": {
        call _object_maintenance;
    };
    case "damage"; case "repair" : {
        call _object_damage;
    };
    case "killed": {
        call _object_killed;
    };
    case "accessCode"; case "buildLock" : {
        call _object_variables;
    };
    case "objWallDamage": {
        call _objWallDamage;
    };
};

Link to comment
Share on other sites

  • 0

Can you please paste FNC_check_access so I can see what it is doing.

 

Edit: I now see that FNC_check_access is a function included with Epoch 1.0.6.

 

In that file, it appears that the parameters are set based on predefined objects, like a Plot Pole.

 

We need to define the garage here.

 

Paste this inside your mission file somewhere and save it as fn_check_access.sqf:

Spoiler

/* 
	Check object's ownership and friends (plot and door)
	Original concept by RimBlock (github.com/RimBlock)

	Extended by Bruce-LXXVI to support different target objects
	and allow fine grained access policies
	
	Parameters: 
	_this select 0: object - player calling this function
	_this select 1: object - target to check ownership and friendlies of
	
	Returns:
	_return select 0: bool - player is owner of target object
	_return select 1: bool - player is friends with owner of target object
	_return select 2: bool - player is plot owner
	_return select 3: bool - player is plot friend
	_return select 4: bool - player is plot management admin
	_return select 5: bool - player is target friend
	_return select 6: bool - player is target management admin
	_return select 7: string - detected target type
	

	2,3,4: always false if no plot nearby
	5,6: always false if _target is not a supported target
*/

private [
	 "_player"						// Player, who wants to access the _target
	,"_target"						// The target object the _player wants to access
	,"_isOwner"						// return value
	,"_isFriendly"					// return value
	,"_isPlotOwner"					// return value
	,"_isPlotFriend"				// return value
	,"_isPlotAdmin"					// return value
	,"_isDoorFriend"				// return value - Only applicable if target is a door
	,"_isDoorAdmin"				    // return value - Only applicable if target is a door
	,"_targetType"					// return value
	,"_targetOwnerUID"				// UID or characterID of the owner of _target
	,"_playerUID"					// UID of the _player
	,"_characterID"					// characterID of the _player
	,"_plotcheck"					// takes return value of FNC_find_plots
	,"_isNearPlot"					// player is in plot's reach
	,"_nearestPlot"					// plot object
	,"_plotOwnerUID"				// plot owner's UID
	,"_plotFriends"					// list of plot friends [["UID", "Name"], ..]
	,"_doorFriends"					// list of door friends [["UID", "Name"], ..]
	,"_garageFriends"
	,"_isGarageFriend"
];


// assign parameters
_player = _this select 0;
_target = _this select 1;

// Initialize return values
_isOwner = false;
_isFriendly = false;
_isPlotOwner = false;
_isPlotFriend = false;
_isPlotAdmin = false;
_isDoorFriend = false;
_isDoorAdmin = false;
_isGarageFriend = false;
_targetType = "";


// determine target type
_targetType = if(typeOf _target in DZE_DoorsLocked) then { "DOOR"; } else { "GENERIC"; };


// determine owner and player id
// and check if player is owner of target object
_playerUID = getPlayerUID _player;
_characterID = dayz_characterID;
if(DZE_permanentPlot) then {
	_targetOwnerUID = _target getVariable ["ownerPUID","0"];
	_isOwner = (_playerUID == _targetOwnerUID);
} else {
	_targetOwnerUID = _target getVariable ["characterID","0"];
	_isOwner = (_characterID == _targetOwnerUID);
};


// determine _players friends (tagged)
// and check if owner of _target is tagged friendly
_friendlies	= _player getVariable ["friendlyTo",[]];
_isFriendly = (_targetOwnerUID in _friendlies);


// find nearest plot
_plotcheck = [_player, false] call FNC_find_plots;
_isNearPlot = ((_plotcheck select 1) > 0);
_nearestPlot = _plotcheck select 2;
if(_isNearPlot) then {
	// determine plot owner
	// and check if player is owner of plot
	if (DZE_permanentPlot) then {
		_plotOwnerUID = _nearestPlot getVariable ["ownerPUID","0"];
		_isPlotOwner = (_playerUID == _plotOwnerUID);
	} else {
		_plotOwnerUID = _nearestPlot getVariable ["characterID","0"];
		_isPlotOwner = (_characterID == _plotOwnerUID);
	};
	
	
	// determine plot friends
	// and check if player is one of them
	_isPlotFriend = _isPlotOwner;  // Plot owner is always a plot friend
	_plotFriends = _nearestPlot getVariable ["plotfriends", []];
	{
		if( (_x select 0) == _playerUID ) then { _isPlotFriend = true; };
	} count _plotFriends;
	
	
	// determine plot management admins
	// and check if player is one of them
	if(_playerUID in DZE_PlotManagementAdmins) then { _isPlotAdmin = true; };
};


// Process target type DOOR
if(_targetType == "DOOR") then {
	// determine door friends
	// and check if player is one of them
	_isDoorFriend = _isOwner;  // Door owner is always a door friend
	_doorFriends = _target getVariable ["doorfriends",[]];
	{
		if( (_x select 0) == _playerUID ) then { _isDoorFriend = true; };
	} count _doorFriends;
	
	
	// determine door management admins
	// and check if player is one of them
	if(_playerUID in DZE_DoorManagementAdmins) then { _isDoorAdmin = true; };
};

if (typeOf _target in DZE_Garage) then {
	_isGarageFriend = _isOwner;
	_garageFriends = _target getVariable["GarageFriends", []];
	{
		if ((_x select 0) == _playerUID) then {
			_isGarageFriend = true;
		};
	} count _garageFriends;
};


// RESULT
[ _isOwner
, _isFriendly
, _isPlotOwner
, _isPlotFriend
, _isPlotAdmin
, _isDoorFriend
, _isDoorAdmin
, _targetType
, _isGarageFriend
]

 

 
 
 

In your compiles.sqf:

Replace:

FNC_check_access = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_check_access.sqf";

With (be sure to change the file path):

FNC_check_access = compile preprocessFileLineNumbers "YOUR_FILE_PATH_HERE\fn_check_access.sqf";

In your fn_selfActions:

Replace:

// garage
	if (_typeOfCursorTarget in DZE_Garage && {speed player <= 1}) then {
	    _hasAccess = [player, _cursorTarget] call FNC_check_access;
	    _allowed = ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3) or (_hasAccess select 4));
	    if ((s_player_garage < 0) && (_allowed or (_hasAccess select 1))) then {
	        s_player_garage =  player addAction ["<t color='#FFAA00'>Garage Menu</t>", "custom\Garage\player_virtualgarage.sqf", _cursorTarget, 2, false];
	    } else {
	        s_player_garage = player addAction ["<t color='#FF0000'>Garage Locked</t>", "",_cursorTarget, 2, true, true, "", ""];   
	    };
	} else {
	    player removeAction s_player_garage;
	    s_player_garage = -1;       
	};

 

With:

// garage
    if (_typeOfCursorTarget in DZE_Garage && {speed player <= 1}) then {
        _hasAccess = [player, _cursorTarget] call FNC_check_access;
        _allowed = _hasAccess select 8;
        if ((s_player_garage < 0) && _allowed) then {
            s_player_garage =  player addAction ["<t color='#FFAA00'>Garage Menu</t>", "custom\Garage\player_virtualgarage.sqf", _cursorTarget, 2, false];
        } else {
            s_player_garage = player addAction ["<t color='#FF0000'>Garage Locked</t>", "",_cursorTarget, 2, true, true, "", ""];   
        };
    } else {
        player removeAction s_player_garage;
        s_player_garage = -1;       
    };

 

Try this and let me know if it works (this is a complete shot in the dark as I have never worked with this script before).

Link to comment
Share on other sites

  • 0
7 hours ago, BigEgg said:

Can you please paste FNC_check_access so I can see what it is doing.

 

Edit: I now see that FNC_check_access is a function included with Epoch 1.0.6.

 

In that file, it appears that the parameters are set based on predefined objects, like a Plot Pole.

 

We need to define the garage here.

 

Paste this inside your mission file somewhere and save it as fn_check_access.sqf:

  Reveal hidden contents


/* 
	Check object's ownership and friends (plot and door)
	Original concept by RimBlock (github.com/RimBlock)

	Extended by Bruce-LXXVI to support different target objects
	and allow fine grained access policies
	
	Parameters: 
	_this select 0: object - player calling this function
	_this select 1: object - target to check ownership and friendlies of
	
	Returns:
	_return select 0: bool - player is owner of target object
	_return select 1: bool - player is friends with owner of target object
	_return select 2: bool - player is plot owner
	_return select 3: bool - player is plot friend
	_return select 4: bool - player is plot management admin
	_return select 5: bool - player is target friend
	_return select 6: bool - player is target management admin
	_return select 7: string - detected target type
	

	2,3,4: always false if no plot nearby
	5,6: always false if _target is not a supported target
*/

private [
	 "_player"						// Player, who wants to access the _target
	,"_target"						// The target object the _player wants to access
	,"_isOwner"						// return value
	,"_isFriendly"					// return value
	,"_isPlotOwner"					// return value
	,"_isPlotFriend"				// return value
	,"_isPlotAdmin"					// return value
	,"_isDoorFriend"				// return value - Only applicable if target is a door
	,"_isDoorAdmin"				    // return value - Only applicable if target is a door
	,"_targetType"					// return value
	,"_targetOwnerUID"				// UID or characterID of the owner of _target
	,"_playerUID"					// UID of the _player
	,"_characterID"					// characterID of the _player
	,"_plotcheck"					// takes return value of FNC_find_plots
	,"_isNearPlot"					// player is in plot's reach
	,"_nearestPlot"					// plot object
	,"_plotOwnerUID"				// plot owner's UID
	,"_plotFriends"					// list of plot friends [["UID", "Name"], ..]
	,"_doorFriends"					// list of door friends [["UID", "Name"], ..]
	,"_garageFriends"
	,"_isGarageFriend"
];


// assign parameters
_player = _this select 0;
_target = _this select 1;

// Initialize return values
_isOwner = false;
_isFriendly = false;
_isPlotOwner = false;
_isPlotFriend = false;
_isPlotAdmin = false;
_isDoorFriend = false;
_isDoorAdmin = false;
_isGarageFriend = false;
_targetType = "";


// determine target type
_targetType = if(typeOf _target in DZE_DoorsLocked) then { "DOOR"; } else { "GENERIC"; };


// determine owner and player id
// and check if player is owner of target object
_playerUID = getPlayerUID _player;
_characterID = dayz_characterID;
if(DZE_permanentPlot) then {
	_targetOwnerUID = _target getVariable ["ownerPUID","0"];
	_isOwner = (_playerUID == _targetOwnerUID);
} else {
	_targetOwnerUID = _target getVariable ["characterID","0"];
	_isOwner = (_characterID == _targetOwnerUID);
};


// determine _players friends (tagged)
// and check if owner of _target is tagged friendly
_friendlies	= _player getVariable ["friendlyTo",[]];
_isFriendly = (_targetOwnerUID in _friendlies);


// find nearest plot
_plotcheck = [_player, false] call FNC_find_plots;
_isNearPlot = ((_plotcheck select 1) > 0);
_nearestPlot = _plotcheck select 2;
if(_isNearPlot) then {
	// determine plot owner
	// and check if player is owner of plot
	if (DZE_permanentPlot) then {
		_plotOwnerUID = _nearestPlot getVariable ["ownerPUID","0"];
		_isPlotOwner = (_playerUID == _plotOwnerUID);
	} else {
		_plotOwnerUID = _nearestPlot getVariable ["characterID","0"];
		_isPlotOwner = (_characterID == _plotOwnerUID);
	};
	
	
	// determine plot friends
	// and check if player is one of them
	_isPlotFriend = _isPlotOwner;  // Plot owner is always a plot friend
	_plotFriends = _nearestPlot getVariable ["plotfriends", []];
	{
		if( (_x select 0) == _playerUID ) then { _isPlotFriend = true; };
	} count _plotFriends;
	
	
	// determine plot management admins
	// and check if player is one of them
	if(_playerUID in DZE_PlotManagementAdmins) then { _isPlotAdmin = true; };
};


// Process target type DOOR
if(_targetType == "DOOR") then {
	// determine door friends
	// and check if player is one of them
	_isDoorFriend = _isOwner;  // Door owner is always a door friend
	_doorFriends = _target getVariable ["doorfriends",[]];
	{
		if( (_x select 0) == _playerUID ) then { _isDoorFriend = true; };
	} count _doorFriends;
	
	
	// determine door management admins
	// and check if player is one of them
	if(_playerUID in DZE_DoorManagementAdmins) then { _isDoorAdmin = true; };
};

if (typeOf _target in DZE_Garage) then {
	_isGarageFriend = _isOwner;
	_garageFriends = _target getVariable["GarageFriends", []];
	{
		if ((_x select 0) == _playerUID) then {
			_isGarageFriend = true;
		};
	} count _garageFriends;
};


// RESULT
[ _isOwner
, _isFriendly
, _isPlotOwner
, _isPlotFriend
, _isPlotAdmin
, _isDoorFriend
, _isDoorAdmin
, _targetType
, _isGarageFriend
]

 

 
 
 

In your compiles.sqf:

Replace:


FNC_check_access = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_check_access.sqf";

With (be sure to change the file path):


FNC_check_access = compile preprocessFileLineNumbers "YOUR_FILE_PATH_HERE\fn_check_access.sqf";

In your fn_selfActions:

Replace:


// garage
	if (_typeOfCursorTarget in DZE_Garage && {speed player <= 1}) then {
	    _hasAccess = [player, _cursorTarget] call FNC_check_access;
	    _allowed = ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3) or (_hasAccess select 4));
	    if ((s_player_garage < 0) && (_allowed or (_hasAccess select 1))) then {
	        s_player_garage =  player addAction ["<t color='#FFAA00'>Garage Menu</t>", "custom\Garage\player_virtualgarage.sqf", _cursorTarget, 2, false];
	    } else {
	        s_player_garage = player addAction ["<t color='#FF0000'>Garage Locked</t>", "",_cursorTarget, 2, true, true, "", ""];   
	    };
	} else {
	    player removeAction s_player_garage;
	    s_player_garage = -1;       
	};

 

With:


// garage
    if (_typeOfCursorTarget in DZE_Garage && {speed player <= 1}) then {
        _hasAccess = [player, _cursorTarget] call FNC_check_access;
        _allowed = _hasAccess select 8;
        if ((s_player_garage < 0) && _allowed) then {
            s_player_garage =  player addAction ["<t color='#FFAA00'>Garage Menu</t>", "custom\Garage\player_virtualgarage.sqf", _cursorTarget, 2, false];
        } else {
            s_player_garage = player addAction ["<t color='#FF0000'>Garage Locked</t>", "",_cursorTarget, 2, true, true, "", ""];   
        };
    } else {
        player removeAction s_player_garage;
        s_player_garage = -1;       
    };

 

Try this and let me know if it works (this is a complete shot in the dark as I have never worked with this script before).

I went ahead and moved the fn_check_access.sqf to the mission file under custom\fn_check_access.sqf and changed the file path in compiles to match it

I also copied your line over to fn_selfactions as well to no availability sadly (the option for garage menu wont even show up now)

It is only non stop spamming in red the option garage locked over and over

Its almost like the garage locked portion of the add action call from the above starts but never ends and cycles garage locked continiusly until you relog from the server 

Does that make sense? or help any?

Link to comment
Share on other sites

  • 0
1 hour ago, Th3-Hunter333 said:

I went ahead and moved the fn_check_access.sqf to the mission file under custom\fn_check_access.sqf and changed the file path in compiles to match it

I also copied your line over to fn_selfactions as well to no availability sadly (the option for garage menu wont even show up now)

It is only non stop spamming in red the option garage locked over and over

Its almost like the garage locked portion of the add action call from the above starts but never ends and cycles garage locked continiusly until you relog from the server 

Does that make sense? or help any?

@Th3-Hunter333 im a lil confused now :D  your problem is the scroll menu option blinking?

Link to comment
Share on other sites

  • 0
4 hours ago, juandayz said:

@Th3-Hunter333 im a lil confused now :D  your problem is the scroll menu option blinking?

Check out these images mate, maybe it will help

20161227183651_1.jpg
20161227183702_1.jpg
20161227183714_1.jpg
20161227183716_1.jpg

Once you get close to the garage it starts spamming in red as an option garage locked (which does nothing if clicked) and never stops spamming until you leave the server 

Link to comment
Share on other sites

  • 0
2 minutes ago, Th3-Hunter333 said:

Check out these images mate, maybe it will help

20161227183651_1.jpg
20161227183702_1.jpg
20161227183714_1.jpg
20161227183716_1.jpg

Once you get close to the garage it starts spamming in red as an option garage locked (which does nothing if clicked) and never stops spamming until you leave the server 

understand now,, seem like the

 player removeAction s_player_garage;
        s_player_garage = -1; 

is not working and enter in a bucle. 

let me see your fn_selfactions.sqf from above and i tell you if i can help you or not.

and have a question... why you use

if ((s_player_garage < 0) && (_allowed or (_hasAccess select 1)))

 

_hasAccess select 1. and not select 0 ? or 2?

Link to comment
Share on other sites

  • 0

Fn selfactions

scriptName "Functions\misc\fn_selfActions.sqf";
/***********************************************************
    ADD ACTIONS FOR SELF
    - Function
    - [] call fnc_usec_selfActions;
************************************************************/
if (dayz_actionInProgress) exitWith {};
private ["_canPickLight","_text","_dir","_canDoThis","_w2m","_bb","_waterHoles","_unlock","_lock","_totalKeys","_temp_keys","_temp_keys_names",
"_hasKey","_oldOwner","_hasAttached","_isZombie","_isHarvested","_isMan","_isFuel","_hasRawMeat","_hastinitem","_player_deleteBuild",
"_player_lockUnlock_crtl","_displayName","_hasIgnators","_menu","_menu1","_allowTow","_liftHeli","_found","_posL","_posC","_height","_attached",
"_combi","_findNearestGen","_humanity_logic","_low_high","_cancel","_buy","_buyV","_humanity","_traderMenu","_warn","_typeOfCursorTarget",
"_isVehicle","_isBicycle","_isDestructable","_isGenerator","_ownerID","_isVehicletype","_hasBarrel","_hasFuel20","_hasFuel5","_hasEmptyFuelCan",
"_itemsPlayer","_hasToolbox","_hasbottleitem","_isAlive","_isPlant","_istypeTent","_upgradeItems","_isDisallowRefuel","_isDog",
"_isModular","_isModularDoor","_isHouse","_isGate","_isFence","_isLockableGate","_isUnlocked","_isOpen","_isClosed","_ownerArray","_ownerBuildLock",
"_ownerPID","_speed","_dog","_vehicle","_inVehicle","_cursorTarget","_primaryWeapon","_currentWeapon","_magazinesPlayer","_onLadder","_canDo",
"_nearLight","_vehicleOwnerID","_hasHotwireKit","_isPZombie","_dogHandle","_allowedDistance","_id","_upgrade","_weaponsPlayer","_hasCrowbar",
"_allowed","_hasAccess","_uid"];

_vehicle = vehicle player;
_inVehicle = (_vehicle != player);
_cursorTarget = cursorTarget;
_primaryWeapon = primaryWeapon player;
_currentWeapon = currentWeapon player;
_magazinesPlayer = magazines player;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
//_canDrink = count nearestObjects [getPosATL player, ["Land_pumpa","Land_water_tank"], 2] > 0;
_uid = getPlayerUID player;
_nearLight = nearestObject [player,"LitObject"];
_canPickLight = false;
_vehicleOwnerID = _vehicle getVariable ["CharacterID","0"];
_hasHotwireKit = "ItemHotwireKit" in _magazinesPlayer;
_isPZombie = player isKindOf "PZombie_VB";
_dogHandle = player getVariable ["dogID",0];

if (!isNull _nearLight) then {
    if (_nearLight distance player < 4) then {
        _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
    };
};

//Grab Flare
if (_canPickLight && !dayz_hasLight && !_isPZombie) then {
    if (s_player_grabflare < 0) then {
        _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
        s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true];
        s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, false, true];
    };
} else {
    player removeAction s_player_grabflare;
    player removeAction s_player_removeflare;
    s_player_grabflare = -1;
    s_player_removeflare = -1;
};

if (s_player_equip_carry < 0) then {
    if (dayz_onBack != "" && { !_inVehicle && { !_onLadder && { !r_player_unconscious } } }) then {
        dz_plr_carryActionItem = dayz_onBack;
        _text = getText (configFile >> "CfgWeapons" >> dz_plr_carryActionItem >> "displayName");
        s_player_equip_carry = player addAction [
            format [localize "STR_ACTIONS_WEAPON", _text],
            "\z\addons\dayz_code\actions\player_switchWeapon_action.sqf",
            nil, 0.5, false, true];
    };
} else {
    if (dayz_onBack != dz_plr_carryActionItem || { _inVehicle || { _onLadder || { r_player_unconscious } } } ) then {
        player removeAction s_player_equip_carry;
        s_player_equip_carry = -1;
    };
};

/*if (dayz_onBack != "" /*&& !dayz_onBackActive && !_inVehicle && !_onLadder && !r_player_unconscious) then {
    if (s_player_equip_carry < 0) then {
        _text = getText (configFile >> "CfgWeapons" >> dayz_onBack >> "displayName");
        s_player_equip_carry = player addAction [format[localize "STR_ACTIONS_WEAPON", _text], "\z\addons\dayz_code\actions\player_switchWeapon_action.sqf", nil, 0.5, false, true];
    };
} else {
    player removeAction s_player_equip_carry;
    s_player_equip_carry = -1;
};*/

//fishing
if ((_currentWeapon in Dayz_fishingItems) && {!dayz_fishingInprogress} && {!_inVehicle} && {!dayz_isSwimming}) then {
    if (s_player_fishing < 0) then {
        s_player_fishing = player addAction [localize "STR_ACTION_CAST", "\z\addons\dayz_code\actions\player_goFishing.sqf",player, 0.5, false, true];
    };
} else {
    player removeAction s_player_fishing;
    s_player_fishing = -1;
};
if ((_primaryWeapon in Dayz_fishingItems) && {!dayz_fishingInprogress} && {_inVehicle && (driver _vehicle != player)}) then {
    if (s_player_fishing_veh < 0) then {
        s_player_fishing_veh = _vehicle addAction [localize "STR_ACTION_CAST", "\z\addons\dayz_code\actions\player_goFishing.sqf",_vehicle, 0.5, false, true];
    };
} else {
    _vehicle removeAction s_player_fishing_veh;
    s_player_fishing_veh = -1;
};

_canDoThis=false;
if (_canDo && !_inVehicle && !dayz_isSwimming) then {
    {
        _waterHoles = if (typeOf _x == "waterHoleProxy") then {nearestObjects [_x, [], 1];} else {[_x];};
        {
            _w2m = _x worldToModel (getPosATL player);
            _bb = (boundingbox _x) select 1;
            _dir = [player, _x] call BIS_fnc_relativeDirTo; if (_dir > 180) then {_dir = _dir - 360};
            if (((abs _dir < 45) && {(_x distance player < 2.22)})  // wells, kasna, pumpa
                or {((("" == typeOf _x) && ((_w2m select 2) < 0.05)) && {((abs(_w2m select 0) < (_bb select 0)) && (abs(_w2m select 1) < (_bb select 1)))})}) exitWith { // ponds
                _canDoThis = true;
            };
        } count _waterHoles;
        if (_canDoThis) exitWith {
            if (s_player_Drinkfromhands < 0) then {
                s_player_Drinkfromhands = player addAction [localize "STR_ACTIONS_DRINK2", "\z\addons\dayz_code\actions\player_drinkWater.sqf",player, 0.5, false, true];
            };
        };
    } foreach nearestObjects [player, ["waterHoleProxy", "Land_pumpa"], 50];
};
if (!_canDoThis && s_player_Drinkfromhands >= 0) then {
    player removeAction s_player_Drinkfromhands;
    s_player_Drinkfromhands = -1;
};

if (_inVehicle) then {
    DZE_myVehicle = _vehicle;
    if (_vehicleOwnerID != "0" && _canDo) then {
        if (s_player_lockUnlockInside_ctrl < 0) then {
            _totalKeys = call epoch_tempKeys;
            _temp_keys = _totalKeys select 0;
            _temp_keys_names = _totalKeys select 1;    
            _hasKey = _vehicleOwnerID in _temp_keys;
            _oldOwner = (_vehicleOwnerID == _uid);
            _text = getText (configFile >> "CfgVehicles" >> (typeOf DZE_myVehicle) >> "displayName");
            if (locked DZE_myVehicle) then {
                if (_hasKey || _oldOwner) then {
                    _unlock = DZE_myVehicle addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",[DZE_myVehicle,(_temp_keys_names select (parseNumber _vehicleOwnerID))], 2, false, true];
                    s_player_lockUnlockInside set [count s_player_lockUnlockInside,_unlock];
                    s_player_lockUnlockInside_ctrl = 1;
                } else {
                    if (_hasHotwireKit) then {
                        _unlock = DZE_myVehicle addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",DZE_myVehicle, 2, true, true];
                    } else {
                        _unlock = DZE_myVehicle addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",DZE_myVehicle, 2, true, true];
                    };
                    s_player_lockUnlockInside set [count s_player_lockUnlockInside,_unlock];
                    s_player_lockUnlockInside_ctrl = 1;
                };
            } else {
                if (_hasKey || _oldOwner) then {
                    _lock = DZE_myVehicle addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",DZE_myVehicle, 1, false, true];
                    s_player_lockUnlockInside set [count s_player_lockUnlockInside,_lock];
                    s_player_lockUnlockInside_ctrl = 1;
                };
            };
        };
    } else {
        {DZE_myVehicle removeAction _x} count s_player_lockUnlockInside;s_player_lockUnlockInside = [];
        s_player_lockUnlockInside_ctrl = -1;
    };
} else {
    {DZE_myVehicle removeAction _x} count s_player_lockUnlockInside;s_player_lockUnlockInside = [];
    s_player_lockUnlockInside_ctrl = -1;
};

if (DZE_HeliLift) then {
    _hasAttached = _vehicle getVariable["hasAttached",false];
    if (_inVehicle && {_vehicle isKindOf "Air"} && {(([_vehicle] call FNC_getPos) select 2) < 30} && {speed _vehicle < 5} && {typeName _hasAttached == "OBJECT"}) then {
        if (s_player_heli_detach < 0) then {
            dayz_myLiftVehicle = _vehicle;
            s_player_heli_detach = dayz_myLiftVehicle addAction [localize "STR_EPOCH_ACTIONS_DETACHVEHICLE","\z\addons\dayz_code\actions\player_heliDetach.sqf",[dayz_myLiftVehicle,_hasAttached],2,false,true];
        };
    } else {
        dayz_myLiftVehicle removeAction s_player_heli_detach;
        s_player_heli_detach = -1;
    };
};

if (DZE_HaloJump) then {
    if (_inVehicle && {_vehicle isKindOf "Air"} && {(([_vehicle] call FNC_getPos) select 2) > 400}) then {
        if (s_halo_action < 0) then {
            DZE_myHaloVehicle = _vehicle;
            s_halo_action = DZE_myHaloVehicle addAction [localize "STR_EPOCH_ACTIONS_HALO","\z\addons\dayz_code\actions\halo_jump.sqf",[],2,false,true];
        };
    } else {
        DZE_myHaloVehicle removeAction s_halo_action;
        s_halo_action = -1;
    };
};

if (DZE_NameTags > 0) then {
    if (s_player_showname < 0 && !_isPZombie) then {
        if (DZE_NameTags < 2) then {
            s_player_showname = 1;
            player setVariable["DZE_display_name",true,true];
        } else {
            s_player_showname = player addAction [localize "STR_EPOCH_ACTIONS_NAMEYES", "\z\addons\dayz_code\actions\display_name.sqf",true, 0, true, false];
            s_player_showname1 = player addAction [localize "STR_EPOCH_ACTIONS_NAMENO", "\z\addons\dayz_code\actions\display_name.sqf",false, 0, true, false];
        };
    };
};

if (_isPZombie) then {
    if (s_player_attack < 0) then {
        s_player_attack = player addAction [localize "STR_EPOCH_ACTIONS_ATTACK", "\z\addons\dayz_code\actions\pzombie\pz_attack.sqf", _cursorTarget, 6, false, true];
    };
    if (s_player_callzombies < 0) then {
        s_player_callzombies = player addAction [localize "STR_EPOCH_ACTIONS_RAISEHORDE", "\z\addons\dayz_code\actions\pzombie\call_zombies.sqf",player, 5, true, false];
    };
    if (s_player_pzombiesvision < 0) then {
        s_player_pzombiesvision = player addAction [localize "STR_EPOCH_ACTIONS_NIGHTVIS", "\z\addons\dayz_code\actions\pzombie\pz_vision.sqf", [], 4, false, true, "nightVision", "_this == _target"];
    };
    if (!isNull _cursorTarget && (player distance _cursorTarget < 3)) then {
        _isZombie = _cursorTarget isKindOf "zZombie_base";
        _isHarvested = _cursorTarget getVariable["meatHarvested",false];
        _isMan = _cursorTarget isKindOf "Man"; //includes animals and zombies
        if (!alive _cursorTarget && _isMan && !_isZombie && !_isHarvested) then {
            if (s_player_pzombiesfeed < 0) then {
                s_player_pzombiesfeed = player addAction [localize "STR_EPOCH_ACTIONS_FEED", "\z\addons\dayz_code\actions\pzombie\pz_feed.sqf",_cursorTarget, 3, true, false];
            };
        } else {
            player removeAction s_player_pzombiesfeed;
            s_player_pzombiesfeed = -1;
        };
    } else {
        player removeAction s_player_pzombiesfeed;
        s_player_pzombiesfeed = -1;
    };
};

// Increase distance only if AIR or SHIP
_allowedDistance = if ((_cursorTarget isKindOf "Air") or (_cursorTarget isKindOf "Ship")) then {8} else {4};

if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cursorTarget < _allowedDistance) && _canDo) then {
//Has some kind of target
    _typeOfCursorTarget = typeOf _cursorTarget;
    _isVehicle = _cursorTarget isKindOf "AllVehicles";
    _isBicycle = _cursorTarget isKindOf "Bicycle";
    _isMan = _cursorTarget isKindOf "Man"; //includes animals and zombies
    _isDestructable = _cursorTarget isKindOf "BuiltItems";
    _isGenerator = _cursorTarget isKindOf "Generator_DZ";
    //_isVehicletype = _typeOfCursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"]; //Checked in player_flipvehicle
    _isFuel = false;
    _hasBarrel = "ItemFuelBarrel" in _magazinesPlayer;
    _hasFuel20 = "ItemJerrycan" in _magazinesPlayer;
    _hasFuel5 = "ItemFuelcan" in _magazinesPlayer;
    _hasEmptyFuelCan = (("ItemJerrycanEmpty" in _magazinesPlayer) || ("ItemFuelcanEmpty" in _magazinesPlayer) || ("ItemFuelBarrelEmpty" in _magazinesPlayer));
    _itemsPlayer = items player;
    _weaponsPlayer = weapons player;
    _hasCrowbar = "ItemCrowbar" in _itemsPlayer or "MeleeCrowbar" in _weaponsPlayer or dayz_onBack == "MeleeCrowbar";
    _hasToolbox = "ItemToolbox" in _itemsPlayer;
    _hasbottleitem = (("ItemWaterBottle" in _magazinesPlayer) || ("ItemWaterBottleInfected" in _magazinesPlayer) || ("ItemWaterBottleSafe" in _magazinesPlayer));
    _isAlive = alive _cursorTarget;
    _text = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName");
    _isPlant = _typeOfCursorTarget in Dayz_plants;
    _istypeTent = (_cursorTarget isKindOf "TentStorage_base") or (_cursorTarget isKindOf "IC_Tent");
    _upgradeItems = ["TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","StashSmall","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3","DomeTentStorage","DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DomeTentStorage4"];
    _characterID = _cursorTarget getVariable ["CharacterID","0"];
    
    if (DZE_permanentPlot) then {
        _id = _uid;
        _ownerID = _cursorTarget getVariable ["ownerPUID","0"];
    } else {
        _id = dayz_characterID;
        _ownerID = _characterID;
    };

    _isDisallowRefuel = _typeOfCursorTarget in ["M240Nest_DZ","MMT_Civ","MMT_USMC","Old_bike_TK_CIV_EP1","Old_bike_TK_INS_EP1"];    
    _isDog = (_cursorTarget isKindOf "Pastor" || _cursorTarget isKindOf "Fin");
    _isModular = _cursorTarget isKindOf "ModularItems";
    _isModularDoor = _typeOfCursorTarget in ["Land_DZE_WoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_GarageWoodDoor","CinderWallDoor_DZ","CinderWallDoorSmall_DZ"];
    _player_deleteBuild = false;
    _player_lockUnlock_crtl = false;
    
    //fuel tanks
    if (_hasEmptyFuelCan) then {
        {
            if (_cursorTarget isKindOf _x) exitWith {_isFuel = true;};
        } count dayz_fuelsources;
    };

    //remove gathered plant if empty
    if (_isPlant) then {
        _cursorTarget call player_gather;
    };

    //flip vehicle
    if (_isVehicle && {!_isMan} && {!(canMove _cursorTarget)} && {_isAlive} && {player distance _cursorTarget >= 2} && {(count (crew _cursorTarget))== 0} && {((vectorUp _cursorTarget) select 2) < 0.5}) then {
        if (s_player_flipveh < 0) then {
            s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, true, true];
        };
    } else {
        player removeAction s_player_flipveh;
        s_player_flipveh = -1;
    };
    
    //Allow player to fill Fuel can
    if (_hasEmptyFuelCan && {_isFuel} && {!a_player_jerryfilling} && {_isAlive}) then {
        if (s_player_fillfuel < 0) then {
            s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",_cursorTarget, 1, false, true];
        };
    } else {
        player removeAction s_player_fillfuel;
        s_player_fillfuel = -1;
    };
    
    if (damage _cursorTarget < 1) then {
        //Allow player to fill vehicle 210L
        if (_hasBarrel && {!_isMan} && {_isVehicle} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
            if (s_player_fillfuel210 < 0) then {
                s_player_fillfuel210 = player addAction [format[localize "str_actions_medical_10",_text,"210"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemFuelBarrel",_cursorTarget], 0, true, true, "", "'ItemFuelBarrel' in magazines player"];
            };
        } else {
            player removeAction s_player_fillfuel210;
            s_player_fillfuel210 = -1;
        };
        
        //Allow player to fill vehicle 20L
        if (_hasFuel20 && {!_isMan} && {_isVehicle} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
            if (s_player_fillfuel20 < 0) then {
                s_player_fillfuel20 = player addAction [format[localize "str_actions_medical_10",_text,"20"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemJerrycan",_cursorTarget], 0, true, true, "", "'ItemJerrycan' in magazines player"];
            };
        } else {
            player removeAction s_player_fillfuel20;
            s_player_fillfuel20 = -1;
        };

        //Allow player to fill vehicle 5L
        if (_hasFuel5 && {!_isMan} && {_isVehicle} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
            if (s_player_fillfuel5 < 0) then {
                s_player_fillfuel5 = player addAction [format[localize "str_actions_medical_10",_text,"5"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemFuelcan",_cursorTarget], 0, true, true, "", "'ItemFuelcan' in magazines player"];
            };
        } else {
            player removeAction s_player_fillfuel5;
            s_player_fillfuel5 = -1;
        };
        /*
            Vanilla generator is currently not functional.
            Vanilla generator refuel actions removed for now.
            Epoch generator fill action is below.
        */
        //Allow player to siphon vehicles
        if (_hasEmptyFuelCan && {!_isMan} && {_isVehicle} && {!_isBicycle} && {!a_player_jerryfilling} && {fuel _cursorTarget > 0}) then {
            if (s_player_siphonfuel < 0) then {
                s_player_siphonfuel = player addAction [format[localize "str_siphon_start"], "\z\addons\dayz_code\actions\siphonFuel.sqf",_cursorTarget, 0, true, true];
            };
        } else {
            player removeAction s_player_siphonfuel;
            s_player_siphonfuel = -1;
        };
    } else {
        player removeAction s_player_fillfuel210;
        s_player_fillfuel210 = -1;
        player removeAction s_player_fillfuel20;
        s_player_fillfuel20 = -1;
        player removeAction s_player_fillfuel5;
        s_player_fillfuel5 = -1;
        player removeAction s_player_siphonfuel;
        s_player_siphonfuel = -1;
    };
    
    //Fireplace Actions check
    if ((_cursorTarget call isInflamed) or (inflamed _cursorTarget)) then {
        _hasRawMeat = {_x in Dayz_meatraw} count _magazinesPlayer > 0;
        _hastinitem = {_x in boil_tin_cans} count _magazinesPlayer > 0;
        
    //Cook Meat    
        if (_hasRawMeat && !a_player_cooking) then {
            if (s_player_cook < 0) then {
                s_player_cook = player addAction [localize "str_actions_self_05", "\z\addons\dayz_code\actions\cook.sqf",_cursorTarget, 3, true, true];
            };
        }; 
    //Boil Water
        if (_hastinitem && _hasbottleitem && !a_player_boil) then {
            if (s_player_boil < 0) then {
                s_player_boil = player addAction [localize "str_actions_boilwater", "\z\addons\dayz_code\actions\boil.sqf",_cursorTarget, 3, true, true];
            };
        };
    } else {
        if (a_player_cooking) then {
            player removeAction s_player_cook;
            s_player_cook = -1;
        };
        if (a_player_boil) then {
            player removeAction s_player_boil;
            s_player_boil = -1;
        };
    };
    
//    Not needed.
/*
    if(_cursorTarget == dayz_hasFire) then {
        if ((s_player_fireout < 0) && !(_cursorTarget call isInflamed) && (player distance _cursorTarget < 3)) then {
            s_player_fireout = player addAction [localize "str_actions_self_06", "\z\addons\dayz_code\actions\fire_pack.sqf",_cursorTarget, 0, false, true];
        };
    } else {
        player removeAction s_player_fireout;
        s_player_fireout = -1;
    };
*/
    if (_isAlive) then {
        //Allow player to delete objects
        if (_isDestructable || {((_typeOfCursorTarget in DZE_isWreck) or (_typeOfCursorTarget in DZE_isWreckBuilding))} || {(_typeOfCursorTarget in DZE_isRemovable)}) then {
            if (_hasToolbox && _hasCrowbar) then {
                _player_deleteBuild = true;
            };
        };    

        if (_isModular || _isModularDoor || _isGenerator || {_typeOfCursorTarget in DZE_isDestroyableStorage}) then {
            if (_hasToolbox && _hasCrowbar) then {
                _hasAccess = [player, _cursorTarget] call FNC_check_access;
                if ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) then {
                    _player_deleteBuild = true;
                };
            };
        };
        
        if (_isVehicle) then {
            if ((_characterID != "0") && {!_isMan}) then {
                _player_lockUnlock_crtl = true;
            };
        };
    };
    
    if (_player_deleteBuild) then {
        if (s_player_deleteBuild < 0) then {
            s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, false, true];
        };
    } else {
        player removeAction s_player_deleteBuild;
        s_player_deleteBuild = -1;
    };

    //remove Own objects
    if (_ownerID == _id) then {
        //upgrade items
        if (_typeOfCursorTarget in _upgradeItems) then {
            if (s_player_upgradestorage < 0) then {
                if (isText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "Upgrade" >> "create")) then {
                    _displayName = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName");
                    s_player_upgradestorage = player addAction [format[localize "str_upgrade",_displayName], "\z\addons\dayz_code\actions\object_upgradeStorage.sqf",_cursorTarget, 0, false, true];
                };
            };
        } else {
            player removeAction s_player_upgradestorage;
            s_player_upgradestorage = -1
        };
        if (_istypeTent) then {
            //Packing my tent
            if (s_player_packtent < 0) then {
                s_player_packtent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, false, true];
            };
        } else {
            player removeAction s_player_packtent;
            s_player_packtent = -1;
        };
    } else {
        player removeAction s_player_upgradestorage;
        s_player_upgradestorage = -1;
        player removeAction s_player_packtent;
        s_player_packtent = -1;
    };
    //other tents
    if (_istypeTent) then {
        //destroy tents
        //Located in variables Dayz_Ignators = ["ItemMatchbox","Item5Matchbox","Item4Matchbox","Item3Matchbox","Item2Matchbox","Item1Matchbox"];
        _hasIgnators = {_x in Dayz_Ignators} count _itemsPlayer > 0;
        if ((_hasFuel20 or _hasFuel5 or _hasBarrel) && _hasIgnators) then {
            if (s_player_destorytent < 0) then {
                s_player_destorytent = player addAction [localize "str_actions_self_destorytent", "\z\addons\dayz_code\actions\player_destroyTent.sqf",_cursorTarget, 0, false, true];
            };
        } else {
            player removeAction s_player_destorytent;
            s_player_destorytent = -1;
        };    
        if (_typeOfCursorTarget in ["IC_DomeTent","IC_Tent"]) then {
            if (s_player_packtentinfected < 0) then {
                s_player_packtentinfected = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, false, true];
            };
        } else {
            player removeAction s_player_packtentinfected;
            s_player_packtentinfected = -1;
        };
        //sleep
        if (s_player_sleep < 0) then {
            s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",_cursorTarget, 0, false, true];
        };
    } else {
        player removeAction s_player_sleep;
        s_player_sleep = -1;
    };
/*    
    //Carbomb
    _hasCarBomb = "ItemCarBomb" in _magazinesPlayer;
    if (((_cursorTarget isKindOf "Car") || (_cursorTarget isKindOf "Air") || (_cursorTarget isKindOf "Motorcycle")) && _hasCarBomb) then {
        if (s_player_attach_bomb < 0) then {
            s_player_attach_bomb = player addAction [localize "str_bombAttach", "\z\addons\dayz_code\actions\player_attach_bomb.sqf",_cursorTarget, 3, true, true];
        };
    } else {
            player removeAction s_player_attach_bomb;
            s_player_attach_bomb = -1;
    };
*/
    //Repairing Vehicles
    if (_isVehicle && {!_isMan} && {dayz_myCursorTarget != _cursorTarget} && {_hasToolbox} && {damage _cursorTarget < 1} && {_typeOfCursorTarget != "M240Nest_DZ"}) then {
        if (s_player_repair_crtl < 0) then {
            dayz_myCursorTarget = _cursorTarget;
            _menu = dayz_myCursorTarget addAction [localize "str_actions_repairveh", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false];
            if (!_isBicycle) then { //Bike wheels should not give full size tires. Also model does not update to show removed wheels.
                if (!DZE_salvageLocked) then {
                    if (!locked _cursorTarget) then {
                        _menu1 = dayz_myCursorTarget addAction [localize "str_actions_salvageveh", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false];
                        s_player_repairActions set [count s_player_repairActions,_menu1];
                    };
                } else {
                    _menu1 = dayz_myCursorTarget addAction [localize "str_actions_salvageveh", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false];
                    s_player_repairActions set [count s_player_repairActions,_menu1];
                };
            };
            s_player_repairActions set [count s_player_repairActions,_menu];
            s_player_repair_crtl = 1;
        } else {
            {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;
            s_player_repairActions = [];
            s_player_repair_crtl = -1;
        };
    };
    /* //Vanilla base building currently not used in Epoch
    // House locking and unlocking
    _isHouse = _typeOfCursorTarget in ["SurvivorWorkshopAStage5", "SurvivorWorkshopBStage5", "SurvivorWorkshopCStage5"];
    _isGate = _typeOfCursorTarget in ["WoodenGate_1","WoodenGate_2","WoodenGate_3","WoodenGate_4","MetalGate_1","MetalGate_2","MetalGate_3","MetalGate_4"];
    _isFence = _typeOfCursorTarget in ["WoodenFence_1","WoodenFence_2","WoodenFence_3","WoodenFence_4","WoodenFence_5","WoodenFence_6","MetalFence_1","MetalFence_2","MetalFence_3","MetalFence_4","MetalFence_5","MetalFence_6","MetalFence_7"];

    //Only the owners can lock the gates
    _isLockableGate = _typeOfCursorTarget in ["WoodenGate_2","WoodenGate_3","WoodenGate_4","MetalGate_2","MetalGate_3","MetalGate_4"];
    _isUnlocked = _cursorTarget getVariable ["isOpen","0"] == "1";

    //Allow the gates to be opened when not locked by anyone
    _isOpen = ((_cursorTarget animationPhase "DoorL") == 1) || ((_cursorTarget animationPhase "DoorR") == 1);
    _isClosed = ((_cursorTarget animationPhase "DoorL") == 0) || ((_cursorTarget animationPhase "DoorR") == 0);
    
    //[["ownerArray",["PID"]]]
    _ownerArray = _cursorTarget getVariable ["ownerArray",["0"]];
    _ownerBuildLock = _cursorTarget getVariable ["BuildLock",false];    
    _ownerPID = (_ownerArray select 0);
    
    // open Gate
    if (_isGate && _isClosed && _isUnlocked) then {
        if (s_player_openGate < 0) then {
            s_player_openGate = player addAction [localize "STR_DN_OUT_O_GATE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Open"], 1, true, true];
        };
    } else {
        player removeAction s_player_openGate;
        s_player_openGate = -1;
    };
    // Close Gate
    if (_isGate && _isOpen && _isUnlocked) then {
        if (s_player_CloseGate < 0) then {
            s_player_CloseGate = player addAction [localize "STR_DN_OUT_C_GATE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Close"], 1, true, true];
        };
    } else {
        player removeAction s_player_CloseGate;
        s_player_CloseGate = -1;
    };
    // Set
    if ((_isHouse or _isLockableGate) && (_ownerPID == _uid) && !_isUnlocked && _isClosed) then {
        if (s_player_setCode < 0) then {
            s_player_setCode = player addAction [localize "STR_BLD_ACTIONS_SETLOCKCODE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Set"], 1, true, true];
        };
    } else {
        player removeAction s_player_setCode;
        s_player_setCode = -1;
    };
    //Lock Build point
    if ((_isFence or _isGate) && (_ownerPID == _uid) && !_ownerBuildLock) then {
        if (s_player_BuildLock < 0) then {
            s_player_BuildLock = player addAction [localize "STR_BLD_ACTIONS_LOCKBUILD", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"BuildLock"], 1, true, true];
        };
    } else {
        player removeAction s_player_BuildLock;
        s_player_BuildLock = -1;
    };
    //UnLock Build point
    if ((_isFence or _isGate) && (_ownerPID == _uid) && _ownerBuildLock) then {
        if (s_player_BuildUnLock < 0) then {
            s_player_BuildUnLock = player addAction [localize "STR_BLD_ACTIONS_UNLOCKBUILD", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"BuildUnLock"], 1, true, true];
        };
    } else {
        player removeAction s_player_BuildUnLock;
        s_player_BuildUnLock = -1;
    };
    // Unlock Gate/House
    if ((_isHouse or _isLockableGate) && !_isUnlocked && _isClosed) then {
        if (s_player_unlockhouse < 0) then {
            s_player_unlockhouse = player addAction [localize "STR_BLD_ACTIONS_UNLOCKGATE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Unlock"], 1, true, true];
        };
    } else {
        player removeAction s_player_unlockhouse;
        s_player_unlockhouse = -1;
    };
    // Lock Gate/House
    if ((_isHouse or _isLockableGate) && _isUnlocked && _isClosed) then {
        if (s_player_lockhouse < 0) then {
            s_player_lockhouse = player addAction [localize "STR_BLD_ACTIONS_LOCKGATE", "\z\addons\dayz_code\actions\player_operate.sqf",[_cursorTarget,"Lock"], 1, true, true];
        };
    } else {
        player removeAction s_player_lockhouse;
        s_player_lockhouse = -1;
    };
    //Break In
    if ((_isHouse or _isLockableGate) && (_ownerPID != _uid) && !_isUnlocked) then {
        if (s_player_breakinhouse < 0) then {
            s_player_breakinhouse = player addAction [localize "STR_BLD_ACTIONS_BREAKIN", "\z\addons\dayz_code\actions\player_breakin.sqf",_cursorTarget, 1, true, true];
        };
    } else {
        player removeAction s_player_breakinhouse;
        s_player_breakinhouse = -1;
    };*/
    //          if (s_player_garage < 0) then {        //if ((s_player_garage < 0) && (_allowed or (_hasAccess select 1))) then {
    
// garage
    if (_typeOfCursorTarget in DZE_Garage && {speed player <= 1}) then {
        _hasAccess = [player, _cursorTarget] call FNC_check_access;
        _allowed = _hasAccess select 8;
        if ((s_player_garage < 0) && _allowed) then {
            s_player_garage =  player addAction ["<t color='#FFAA00'>Garage Menu</t>", "custom\Garage\player_virtualgarage.sqf", _cursorTarget, 2, false];
        } else {
            s_player_garage = player addAction ["<t color='#FF0000'>Garage Locked</t>", "",_cursorTarget, 2, true, true, "", ""];   
        };
    } else {
        player removeAction s_player_garage;
        s_player_garage = -1;       
    };
    
    if ((_cursorTarget isKindOf "Plastic_Pole_EP1_DZ") && {speed player <= 1}) then {
        _hasAccess = [player, _cursorTarget] call FNC_check_access;
        _allowed = ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3) or (_hasAccess select 4));
        if (DZE_permanentPlot) then {
            if (s_player_plotManagement < 0 && _allowed) then {
                s_player_plotManagement = player addAction [format["<t color='#0059FF'>%1</t>",localize "STR_EPOCH_ACTIONS_MANAGEPLOT"], "\z\addons\dayz_code\actions\plotManagement\initPlotManagement.sqf", [], 5, false];
            };
        } else {
            if (s_player_maintain_area < 0) then {
                s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", "maintain", 5, false];
                s_player_maintain_area_force = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_FORCE_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", "force", 5, false];
                s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\maintain_area.sqf", "preview", 5, false];
            };
        };
        if (s_player_plot_boundary < 0 && (_allowed or (_hasAccess select 1))) then {
            s_player_plot_boundary = player addAction [localize "STR_EPOCH_PLOTMANAGEMENT_SHOW_BOUNDARY", "\z\addons\dayz_code\actions\plotManagement\plotToggleMarkers.sqf", "", 1, false];
        };
        if (DZE_permanentPlot && DZE_PlotOwnership) then {
            if (s_player_plot_take_ownership < 0 && (_hasAccess select 0)) then {
                s_player_plot_take_ownership = player addAction [localize "STR_EPOCH_APLOTFORLIFE_TAKE_PLOT_OWNERSHIP", "\z\addons\dayz_code\actions\plot_take_ownership.sqf", "", 1, false];
            };
        };
    } else {
        player removeAction s_player_plotManagement;
        s_player_plotManagement = -1;
        player removeAction s_player_maintain_area;
        s_player_maintain_area = -1;
        player removeAction s_player_maintain_area_force;
        s_player_maintain_area_force = -1;
        player removeAction s_player_maintain_area_preview;
        s_player_maintain_area_preview = -1;
        player removeAction s_player_plot_boundary;
        s_player_plot_boundary = -1;
        player removeAction s_player_plot_take_ownership;
        s_player_plot_take_ownership = -1;
    };
    
    if (DZE_HeliLift) then {
        _liftHeli = objNull;
        _found = false;    
        _allowTow = false;
        if ((count (crew _cursorTarget)) == 0) then {
            {
                if (!_allowTow) then {
                    _allowTow = _cursorTarget isKindOf _x;
                };
            } count DZE_HeliAllowToTow;
        };

        if (_allowTow) then {
            {
                if (!_found) then {
                    _posL = [_x] call FNC_getPos;
                    _posC = [_cursorTarget] call FNC_getPos;
                    _height = (_posL select 2) - (_posC select 2);
                    _hasAttached = _x getVariable["hasAttached",false];
                    if ((_height < 15) && {_height > 5} && {typeName _hasAttached != "OBJECT"}) then {
                        if (((abs((_posL select 0) - (_posC select 0))) < 10) && {(abs((_posL select 1) - (_posC select 1))) < 10}) then {
                            _liftHeli = _x;
                            _found = true;
                        };
                    };
                };
            } count (player nearEntities [DZE_HeliAllowTowFrom,15]);
        };

        _attached = _cursorTarget getVariable["attached",false];
        if (_found && {_allowTow} && {!locked _cursorTarget} && {!_isPZombie} && {typeName _attached != "OBJECT"}) then {
            if (s_player_heli_lift < 0) then {
                s_player_heli_lift = player addAction [localize "STR_EPOCH_ACTIONS_ATTACHTOHELI", "\z\addons\dayz_code\actions\player_heliLift.sqf",[_liftHeli,_cursorTarget], -10, false, true];
            };
        } else {
            player removeAction s_player_heli_lift;
            s_player_heli_lift = -1;
        };
    };
    
    // Allow Owner to lock and unlock vehicle  
    if (_player_lockUnlock_crtl) then {
        if (s_player_lockUnlock_crtl < 0) then {
            _totalKeys = call epoch_tempKeys;
            _temp_keys = _totalKeys select 0;
            _temp_keys_names = _totalKeys select 1;
            _hasKey = _characterID in _temp_keys;
            _oldOwner = (_characterID == _uid);
            if (locked _cursorTarget) then {
                if (_hasKey || _oldOwner) then {
                    _unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",[_cursorTarget,(_temp_keys_names select (parseNumber _characterID))], 2, true, true];
                    s_player_lockunlock set [count s_player_lockunlock,_unlock];
                    s_player_lockUnlock_crtl = 1;
                } else {
                    if (_hasHotwireKit) then {
                        _unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",_cursorTarget, 2, true, true];
                    } else {
                        _unlock = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",_cursorTarget, 2, false, true];
                    };
                    s_player_lockunlock set [count s_player_lockunlock,_unlock];
                    s_player_lockUnlock_crtl = 1;
                };
            } else {
                if (_hasKey || _oldOwner) then {
                    _lock = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true];
                    s_player_lockunlock set [count s_player_lockunlock,_lock];
                    s_player_lockUnlock_crtl = 1;
                };
            };
        };     
    } else {
        {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
        s_player_lockUnlock_crtl = -1;
    };
    
    // gear access on surrendered player
    if (isPlayer _cursorTarget && {_isAlive} && {_cursorTarget getVariable ["DZE_Surrendered",false]}) then {
        if (s_player_SurrenderedGear < 0) then {
            s_player_SurrenderedGear = player addAction [localize "STR_UI_GEAR", "\z\addons\dayz_code\actions\surrender_gear.sqf",_cursorTarget, 1, true, true];
        };
    } else {
        player removeAction s_player_SurrenderedGear;
        s_player_SurrenderedGear = -1;
    };

    // Allow manage door
    if (DZE_doorManagement && (_typeOfCursorTarget in DZE_DoorsLocked)) then {
        // Check player access
        _hasAccess = [player, _cursorTarget] call FNC_check_access;
        if (s_player_manageDoor < 0 && ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3) or (_hasAccess select 4) or (_hasAccess select 5) or (_hasAccess select 6))) then {
            s_player_manageDoor = player addAction [format["<t color='#0059FF'>%1</t>", localize "STR_EPOCH_ACTIONS_MANAGEDOOR"], "\z\addons\dayz_code\actions\doorManagement\initDoorManagement.sqf", _cursorTarget, 5, false];
        };
    } else {
        player removeAction s_player_manageDoor;
        s_player_manageDoor = -1;
    };

    //Allow owner to unlock vault
    if ((_typeOfCursorTarget in DZE_LockableStorage) && {_characterID != "0"} && {player distance _cursorTarget < 3} && {!keypadCancel}) then {
        if (s_player_unlockvault < 0) then {
            if (_typeOfCursorTarget in DZE_LockedStorage) then {
                if (_characterID == dayz_combination || _ownerID == _uid) then {
                    _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_OPEN",_text], "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, false, true];
                    s_player_combi set [count s_player_combi,_combi];
                } else {
                    _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true];
                    s_player_combi set [count s_player_combi,_combi];
                };
                s_player_unlockvault = 1;
            } else {
                if (_characterID != dayz_combination && _ownerID != _uid) then {
                    _combi = player addAction [localize "STR_EPOCH_ACTIONS_RECOMBO", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true];
                    s_player_combi set [count s_player_combi,_combi];
                    s_player_unlockvault = 1;
                };
            };
        };
    } else {
        {player removeAction _x} count s_player_combi;s_player_combi = [];
        s_player_unlockvault = -1;
    };

    //Allow owner to pack vault
    if ((_typeOfCursorTarget in DZE_UnLockedStorage) && {_characterID != "0"} && {player distance _cursorTarget < 3}  && {!keypadCancel}) then {
        if (s_player_lockvault < 0) then {
            if (_characterID == dayz_combination || _ownerID == _uid) then {
                s_player_lockvault = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\vault_lock.sqf",_cursorTarget, 0, false, true];
            };
        };
        if (s_player_packvault < 0 && (_characterID == dayz_combination || _ownerID == _uid)) then {
            s_player_packvault = player addAction [format["<t color='#ff0000'>%1</t>",(format[localize "STR_EPOCH_ACTIONS_PACK",_text])], "\z\addons\dayz_code\actions\vault_pack.sqf",_cursorTarget, 0, false, true];
        };
    } else {
        player removeAction s_player_packvault;
        s_player_packvault = -1;
        player removeAction s_player_lockvault;
        s_player_lockvault = -1;
    };

    //Player Deaths
    if (_typeOfCursorTarget == "Info_Board_EP1") then {
        if (s_player_information < 0) then {
            s_player_information = player addAction [localize "STR_EPOCH_ACTIONS_MURDERS", "\z\addons\dayz_code\actions\list_playerDeaths.sqf",[], 7, false, true];
        };
    } else {
        player removeAction s_player_information;
        s_player_information = -1;
    };
    
    //Fuel Pump
    if (_typeOfCursorTarget in dayz_fuelpumparray) then {
        if (s_player_fuelauto < 0) then {        
            // check if Generator_DZ is running within 30 meters
            _findNearestGen = [];
            {
                if ((alive _x) && (_x getVariable ["GeneratorRunning", false])) then {
                    _findNearestGen set [count _findNearestGen,_x];
                };
            } count (nearestObjects [([player] call FNC_getPos), ["Generator_DZ"], 30]);
            
            // show that pump needs power if no generator nearby.
            if ((count _findNearestGen) > 0) then {
                s_player_fuelauto = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",objNull, 0, false, true];
            } else {
                s_player_fuelauto = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true];
            };
        };
    } else {
        player removeAction s_player_fuelauto;
        s_player_fuelauto = -1;
    };

    //Fuel Pump on truck
    if (_typeOfCursorTarget in DZE_fueltruckarray && _isAlive) then {
        if (s_player_fuelauto2 < 0) then {
            // show that fuel truck pump needs power.
            if (isEngineOn _cursorTarget) then {
                s_player_fuelauto2 = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",_cursorTarget, 0, false, true];
            } else {
                s_player_fuelauto2 = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, false, true];
            };
        };
    } else {
        player removeAction s_player_fuelauto2;
        s_player_fuelauto2 = -1;
    };

    // inplace upgrade tool
    if ((_cursorTarget isKindOf "ModularItems") || (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") || (_cursorTarget isKindOf "CinderWallDoor_DZ_Base")) then {
        if ((s_player_lastTarget select 0) != _cursorTarget) then {
            if (s_player_upgrade_build > 0) then {
                player removeAction s_player_upgrade_build;
                s_player_upgrade_build = -1;
            };
        };
        if (s_player_upgrade_build < 0) then {
            _hasAccess = [player, _cursorTarget] call FNC_check_access;
            _upgrade = getArray (configFile >> "CfgVehicles" >> (typeOf _cursorTarget) >> "upgradeBuilding");
            if (((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) && (count _upgrade) > 0) then {
                s_player_lastTarget set [0,_cursorTarget];
                s_player_upgrade_build = player addAction [format[localize "str_upgrade",_text], "\z\addons\dayz_code\actions\player_upgrade.sqf",_cursorTarget, -1, false, true];
            };
        };
    } else {
        player removeAction s_player_upgrade_build;
        s_player_upgrade_build = -1;
    };
    
    // downgrade system
    if ((DZE_Lock_Door == _characterID)  && {!keypadCancel} && {_isDestructable || _cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" || _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base"}) then {
        if ((s_player_lastTarget select 1) != _cursorTarget) then {
            if (s_player_downgrade_build > 0) then {    
                player removeAction s_player_downgrade_build;
                s_player_downgrade_build = -1;
            };
        };
        if (s_player_downgrade_build < 0) then {
            _hasAccess = [player, _cursorTarget] call FNC_check_access;
            if ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) then {
                s_player_lastTarget set [1,_cursorTarget];
                s_player_downgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_REMLOCK",_text], "\z\addons\dayz_code\actions\player_buildingDowngrade.sqf",_cursorTarget, -2, false, true];
            };
        };
    } else {
        player removeAction s_player_downgrade_build;
        s_player_downgrade_build = -1;
    };

    // inplace maintenance tool
    if ((damage _cursorTarget >= DZE_DamageBeforeMaint) && {_cursorTarget isKindOf "ModularItems" || _cursorTarget isKindOf "DZE_Housebase" || _typeOfCursorTarget == "LightPole_DZ"}) then {
        if ((s_player_lastTarget select 2) != _cursorTarget) then {
            if (s_player_maint_build > 0) then {
                player removeAction s_player_maint_build;
                s_player_maint_build = -1;
            };
        };
        if (s_player_maint_build < 0) then {
            _hasAccess = [player, _cursorTarget] call FNC_check_access;
            if ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3)) then {
                _text2 = _text + " (" + str(round ((damage _cursorTarget) * 100)) + "% damaged)";
                s_player_lastTarget set [2,_cursorTarget];
                s_player_maint_build = player addAction [format["%1 %2",localize "STR_EPOCH_ACTIONS_MAINTAIN",_text2], "\z\addons\dayz_code\actions\player_buildingMaint.sqf",_cursorTarget, -2, false, true];
            };
        };
    } else {
        player removeAction s_player_maint_build;
        s_player_maint_build = -1;
    };

    //Start Generator
    if (_isGenerator) then {
        if (s_player_fillgen < 0) then {    
            // check if not running 
            if (_cursorTarget getVariable ["GeneratorRunning", false]) then {
                s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR1", "\z\addons\dayz_code\actions\stopGenerator.sqf",_cursorTarget, 0, false, true];                
            } else {
                // check if not filled and player has jerry.
                if (_cursorTarget getVariable ["GeneratorFilled", false]) then {
                    s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR2", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true];
                } else {
                    if (_hasFuel20 or _hasFuel5 or _hasBarrel) then {
                        s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR3", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true];
                    };
                };
            };
        };
    } else {
        player removeAction s_player_fillgen;
        s_player_fillgen = -1;
    };

    //Towing with tow truck
    /*
    if(_typeOfCursorTarget == "TOW_DZE") then {
        if (s_player_towing < 0) then {
            if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
                s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_ATTACH" "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true];                
            } else {
                s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_DETACH", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true];                
            };
        };
    } else {
        player removeAction s_player_towing;
        s_player_towing = -1;
    };
    */

    // All Traders
    if (_isMan && {!(isPlayer _cursorTarget)} && {_typeOfCursorTarget in serverTraders} && {!_isPZombie}) then {
        if (s_player_parts_crtl < 0) then {
            _humanity = player getVariable ["humanity",0];
            _traderMenu = call compile format["menu_%1;",_typeOfCursorTarget];        
            _low_high = localize "STR_EPOCH_ACTIONS_HUMANITY_LOW";
            _humanity_logic = false;
            if ((_traderMenu select 2) == "friendly") then {
                _humanity_logic = (_humanity < -5000);
            };
            if ((_traderMenu select 2) == "hostile") then {
                _low_high = localize "STR_EPOCH_ACTIONS_HUMANITY_HIGH";
                _humanity_logic = (_humanity > -5000);
            };
            if ((_traderMenu select 2) == "hero") then {
                _humanity_logic = (_humanity < 5000);
            };
            if (_humanity_logic) then {
                _cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false];
                s_player_parts set [count s_player_parts,_cancel];
            } else {
                // Static Menu
                {
                    _buy = player addAction [format["Trade %1 %2 for %3 %4",(_x select 3),(_x select 5),(_x select 2),(_x select 6)], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4),(_x select 5),(_x select 6)], (_x select 7), true, true];
                    s_player_parts set [count s_player_parts,_buy];        
                } count (_traderMenu select 1);
                if (DZE_ConfigTrader) then {
                    _buyV = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\AdvancedTrading\init.sqf",(_traderMenu select 0), 999, true, false];
                    s_player_parts set [count s_player_parts,_buyV];
                } else {
                    // Database menu
                    _buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu select 0), 999, true, false];
                    s_player_parts set [count s_player_parts,_buy];
                };
            };
            s_player_parts_crtl = 1;    
        };
    } else {
        {player removeAction _x} count s_player_parts;s_player_parts = [];
        s_player_parts_crtl = -1;
    };
    
    if (dayz_tameDogs) then {
        //Dog
        _hasRawMeat = {_x in Dayz_meatraw} count _magazinesPlayer > 0;
        if (_isDog && {_hasRawMeat} && {_isAlive} && {_ownerID == "0"} && {player getVariable ["dogID",0] == 0}) then {
            if (s_player_tamedog < 0) then {
                s_player_tamedog = player addAction [localize "str_actions_tamedog", "\z\addons\dayz_code\actions\dog\tame_dog.sqf", _cursorTarget, 1, false, true];
            };
        } else {
            player removeAction s_player_tamedog;
            s_player_tamedog = -1;
        };
        if (_isDog && {_ownerID == _id} && {_isAlive}) then {
            if (s_player_feeddog < 0 && _hasRawMeat) then {
                s_player_feeddog = player addAction [localize "str_actions_feeddog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,0], 0, false, true];
            };
            if (s_player_waterdog < 0 && _hasbottleitem) then {
                s_player_waterdog = player addAction [localize "str_actions_waterdog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,1], 0, false, true];
            };
            if (s_player_staydog < 0) then {
                if (_dogHandle getFSMVariable "_actionLieDown") then { _text = "str_actions_liedog"; } else { _text = "str_actions_sitdog"; };
                s_player_staydog = player addAction [localize _text,"\z\addons\dayz_code\actions\dog\stay.sqf", _dogHandle, 5, false, true];
            };
            if (s_player_trackdog < 0) then {
                s_player_trackdog = player addAction [localize "str_actions_trackdog","\z\addons\dayz_code\actions\dog\track.sqf", _dogHandle, 4, false, true];
            };
            if (s_player_barkdog < 0) then {
                s_player_barkdog = player addAction [localize "str_actions_barkdog","\z\addons\dayz_code\actions\dog\speak.sqf", _cursorTarget, 3, false, true];
            };
            if (s_player_warndog < 0) then {
                _warn = _dogHandle getFSMVariable "_watchDog";
                if (_warn) then { _text = localize "str_epoch_player_247"; _warn = false; } else { _text = localize "str_epoch_player_248"; _warn = true; };
                s_player_warndog = player addAction [format[localize "str_actions_warndog",_text],"\z\addons\dayz_code\actions\dog\warn.sqf",[_dogHandle, _warn], 2, false, true];        
            };
            if (s_player_followdog < 0) then {
                s_player_followdog = player addAction [localize "str_actions_followdog","\z\addons\dayz_code\actions\dog\follow.sqf",[_dogHandle,true], 6, false, true];
            };
        } else {
            player removeAction s_player_feeddog;
            s_player_feeddog = -1;
            player removeAction s_player_waterdog;
            s_player_waterdog = -1;
            player removeAction s_player_staydog;
            s_player_staydog = -1;
            player removeAction s_player_trackdog;
            s_player_trackdog = -1;
            player removeAction s_player_barkdog;
            s_player_barkdog = -1;
            player removeAction s_player_warndog;
            s_player_warndog = -1;
            player removeAction s_player_followdog;
            s_player_followdog = -1;
        };
    };
} else {
    //Engineering
    player removeAction s_player_plot_boundary;
    s_player_plot_boundary = -1;
    player removeAction s_player_plot_take_ownership;
    s_player_plot_take_ownership = -1;
    player removeAction s_player_plotManagement;
    s_player_plotManagement = -1;
    {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
    player removeAction s_player_repair_crtl;
    s_player_repair_crtl = -1;
    dayz_myCursorTarget = objNull;
    player removeAction s_player_flipveh;
    s_player_flipveh = -1;
    player removeAction s_player_sleep;
    s_player_sleep = -1;
    player removeAction s_player_deleteBuild;
    s_player_deleteBuild = -1;
    player removeAction s_player_cook;
    s_player_cook = -1;
    player removeAction s_player_boil;
    s_player_boil = -1;
    player removeAction s_player_fireout;
    s_player_fireout = -1;
    player removeAction s_player_packtent;
    s_player_packtent = -1;
    player removeAction s_player_packtentinfected;
    s_player_packtentinfected = -1;
    player removeAction s_player_fillfuel;
    s_player_fillfuel = -1;
    //fuel
    player removeAction s_player_fillfuel210;
    s_player_fillfuel210 = -1;
    player removeAction s_player_fillfuel20;
    s_player_fillfuel20 = -1;
    player removeAction s_player_fillfuel5;
    s_player_fillfuel5 = -1;
    //Allow player to siphon vehicle fuel
    player removeAction s_player_siphonfuel;
    s_player_siphonfuel = -1;
    //Allow player to gather
    player removeAction s_player_gather;
    s_player_gather = -1;
    player removeAction s_player_destorytent;
    s_player_destorytent = -1;
    // player removeAction s_player_attach_bomb;
    //  s_player_attach_bomb = -1;
    //debug
    //player removeAction s_player_debugCheck;
    //s_player_debugCheck = -1;
    player removeAction s_player_upgradestorage;
    s_player_upgradestorage = -1;
    /* //Unlock,Lock // Vanilla base building currently not used in Epoch
    player removeAction s_player_setCode;
    s_player_setCode = -1;
    player removeAction s_player_lockhouse;
    s_player_lockhouse = -1;
    player removeAction s_player_unlockhouse;
    s_player_unlockhouse = -1;
    player removeAction s_player_openGate;
    s_player_openGate = -1;
    player removeAction s_player_CloseGate;
    s_player_CloseGate = -1;
    player removeAction s_player_breakinhouse;
    s_player_breakinhouse = -1;
    player removeAction s_player_BuildUnLock;
    s_player_BuildUnLock = -1;
    player removeAction s_player_BuildLock;
    s_player_BuildLock = -1;*/
    {player removeAction _x} count s_player_combi;s_player_combi = [];    
    s_player_lastTarget = [objNull,objNull,objNull,objNull,objNull];
    {player removeAction _x} count s_player_parts;s_player_parts = [];
    s_player_parts_crtl = -1;
    {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
    s_player_lockUnlock_crtl = -1;
    player removeAction s_player_SurrenderedGear;
    s_player_SurrenderedGear = -1;
    player removeAction s_player_maintain_area;
    s_player_maintain_area = -1;
    player removeAction s_player_maintain_area_force;
    s_player_maintain_area_force = -1;
    player removeAction s_player_maintain_area_preview;
    s_player_maintain_area_preview = -1;    
    player removeAction s_player_tamedog;
    s_player_tamedog = -1;
    player removeAction s_player_feeddog;
    s_player_feeddog = -1;
    player removeAction s_player_waterdog;
    s_player_waterdog = -1;
    player removeAction s_player_staydog;
    s_player_staydog = -1;
    player removeAction s_player_trackdog;
    s_player_trackdog = -1;
    player removeAction s_player_barkdog;
    s_player_barkdog = -1;
    player removeAction s_player_warndog;
    s_player_warndog = -1;
    player removeAction s_player_followdog;
    s_player_followdog = -1;
    player removeAction s_player_unlockvault;
    s_player_unlockvault = -1;
    player removeAction s_player_packvault;
    s_player_packvault = -1;
    player removeAction s_player_lockvault;
    s_player_lockvault = -1;
    player removeAction s_player_information;
    s_player_information = -1;
    player removeAction s_player_fillgen;
    s_player_fillgen = -1;
    player removeAction s_player_upgrade_build;
    s_player_upgrade_build = -1;
    player removeAction s_player_maint_build;
    s_player_maint_build = -1;
    player removeAction s_player_downgrade_build;
    s_player_downgrade_build = -1;
    player removeAction s_player_towing;
    s_player_towing = -1;
    player removeAction s_player_fuelauto;
    s_player_fuelauto = -1;
    player removeAction s_player_fuelauto2;
    s_player_fuelauto2 = -1;
    player removeAction s_player_manageDoor;
    s_player_manageDoor = -1;
    
    // garage
    player removeAction s_player_garage;
    s_player_garage = -1;
};

//Dog actions on player self
if (_dogHandle > 0) then {
    _dog = _dogHandle getFSMVariable "_dog";
    if (isNil "_dog") exitWith {};
    if (isNil "_ownerID") then {_ownerID = "0"};
    if (_canDo && !_inVehicle && alive _dog && !(_ownerID in [dayz_characterID,_uid])) then {
        if (s_player_movedog < 0) then {
            s_player_movedog = player addAction [localize "str_actions_movedog", "\z\addons\dayz_code\actions\dog\move.sqf", player getVariable ["dogID",0], 1, false, true];
        };
        if (s_player_speeddog < 0) then {
            _text = localize "str_epoch_player_249";
            _speed = 0;
            if (_dog getVariable ["currentSpeed",1] == 0) then { _speed = 1; _text = localize "str_epoch_player_250"; };
            s_player_speeddog = player addAction [format[localize "str_actions_speeddog", _text], "\z\addons\dayz_code\actions\dog\speed.sqf",[player getVariable ["dogID",0],_speed], 0, false, true];
        };
        if (s_player_calldog < 0) then {
            s_player_calldog = player addAction [localize "str_actions_calldog", "\z\addons\dayz_code\actions\dog\follow.sqf", [player getVariable ["dogID",0], true], 2, false, true];
        };
    };
} else {
    player removeAction s_player_movedog;        
    s_player_movedog = -1;
    player removeAction s_player_speeddog;
    s_player_speeddog = -1;
    player removeAction s_player_calldog;
    s_player_calldog = -1;
};

//Monitor
player setVariable ["selfActions", diag_ticktime, false];
 

Link to comment
Share on other sites

  • 0

Ill try to help out some more with this this here is my variables.sqf below

I have more than triple checked to make sure everything is right and am more or less bouncing my head off a wall trying anything at this point.
I cant for the life of me find it 


disableSerialization;

// garage
DZE_Garage = ["Garbage_container"];

//Model Variables
Bandit1_DZ = "Bandit1_DZ";
BanditW1_DZ = "BanditW1_DZ";
Survivor1_DZ = "Survivor1_DZ";
Survivor2_DZ = "Survivor2_DZ";
SurvivorW2_DZ = "SurvivorW2_DZ";
Sniper1_DZ = "Sniper1_DZ";
Camo1_DZ = "Camo1_DZ";
Soldier1_DZ = "Soldier1_DZ";
Rocket_DZ = "Rocket_DZ";
// EPOCH ADDITIONS
Bandit2_DZ = "Bandit2_DZ";
BanditW2_DZ = "BanditW2_DZ";
SurvivorW3_DZ = "SurvivorW2_DZ";

//Rolling Msg system
Message_1 = "";
Message_2 = "";
Message_3 = "";
Message_1_time = 0;
Message_2_time = 0;
Message_3_time = 0;
//Kill Feed
death_1 = "";
death_2 = "";
death_3 = "";
death_4 = "";
death_1_time = 0;
death_2_time = 0;
death_3_time = 0;
death_4_time = 0;

//OpenTarget timer
OpenTarget_Time = 0;

///Player classes
AllPlayers = ["Survivor_DZ","Survivor1_DZ","SurvivorW2_DZ","Survivor2_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","BanditW1_DZ","Bandit1_DZ","Survivor3_DZ","SurvivorWcombat_DZ","SurvivorWdesert_DZ","SurvivorWurban_DZ","SurvivorWsequishaD_DZ","SurvivorWsequisha_DZ","SurvivorWpink_DZ","SurvivorW3_DZ","Bandit2_DZ","BanditW2_DZ","Soldier_Crew_PMC","Rocket_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","Priest_DZ","Functionary1_EP1_DZ","GUE_Commander_DZ","Ins_Soldier_GL_DZ","Haris_Press_EP1_DZ","Pilot_EP1_DZ","RU_Policeman_DZ","pz_policeman","pz_suit1","pz_suit2","pz_worker1","pz_worker2","pz_worker3","pz_doctor","pz_teacher","pz_hunter","pz_villager1","pz_villager2","pz_villager3","pz_priest","Soldier_TL_PMC_DZ","Soldier_Sniper_PMC_DZ","Soldier_Bodyguard_AA12_PMC_DZ","Drake_Light_DZ","CZ_Special_Forces_GL_DES_EP1_DZ","TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ","FR_OHara_DZ","FR_Rodriguez_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","GUE_Soldier_MG_DZ","GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_CO_DZ","GUE_Soldier_2_DZ","TK_Special_Forces_MG_EP1_DZ","TK_Soldier_Sniper_EP1_DZ","TK_Commander_EP1_DZ","RU_Soldier_Crew_DZ","INS_Lopotev_DZ","INS_Soldier_AR_DZ","INS_Soldier_CO_DZ","INS_Bardak_DZ","INS_Worker2_DZ","USMC_Soldier_Officer_DZ","USMC_Soldier_MG_DZ","USMC_Soldier_Pilot_DZ","FR_TL_DZ","FR_R_DZ","FR_Marksman_DZ","FR_Assault_R_DZ","RU_Soldier_DZ","RU_Soldier_Officer_DZ","RUS_Soldier1_DZ","RUS_Commander_DZ","MVD_Soldier_DZ","Ins_Soldier_2_DZ","Ins_Commander_DZ","Ins_Soldier_Crew_DZ","CDF_Soldier_DZ","Doctor_DZ","Assistant_DZ","Worker1_DZ","Worker3_DZ","Worker4_DZ","TK_CIV_Takistani01_EP1_DZ","TK_CIV_Takistani03_EP1_DZ","TK_CIV_Takistani04_EP1_DZ","TK_CIV_Takistani06_EP1_DZ","TK_INS_Soldier_AR_EP1_DZ","TK_GUE_Soldier_EP1_DZ","CZ_Soldier_SL_DES_EP1_DZ","US_Soldier_EP1_DZ","UN_CDF_Soldier_Guard_EP1_DZ","UN_CDF_Soldier_EP1_DZ","GER_Soldier_TL_EP1_DZ","BAF_Soldier_Officer_MTP_DZ","BAF_Soldier_N_MTP_DZ","FR_Sapper_DZ"];
DayZ_Male = ["Survivor_DZ","Survivor1_DZ","Survivor2_DZ","Survivor3_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","Bandit1_DZ","Bandit2_DZ","Soldier_Crew_PMC","Rocket_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","Priest_DZ","Functionary1_EP1_DZ","GUE_Commander_DZ","Ins_Soldier_GL_DZ","Haris_Press_EP1_DZ","Pilot_EP1_DZ","RU_Policeman_DZ","pz_policeman","pz_suit1","pz_suit2","pz_worker1","pz_worker2","pz_worker3","pz_doctor","pz_teacher","pz_hunter","pz_villager1","pz_villager2","pz_villager3","pz_priest","Soldier_TL_PMC_DZ","Soldier_Sniper_PMC_DZ","Soldier_Bodyguard_AA12_PMC_DZ","Drake_Light_DZ","CZ_Special_Forces_GL_DES_EP1_DZ","TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ","FR_OHara_DZ","FR_Rodriguez_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","GUE_Soldier_MG_DZ","GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_CO_DZ","GUE_Soldier_2_DZ","TK_Special_Forces_MG_EP1_DZ","TK_Soldier_Sniper_EP1_DZ","TK_Commander_EP1_DZ","RU_Soldier_Crew_DZ","INS_Lopotev_DZ","INS_Soldier_AR_DZ","INS_Soldier_CO_DZ","INS_Bardak_DZ","INS_Worker2_DZ","USMC_Soldier_Officer_DZ","USMC_Soldier_MG_DZ","USMC_Soldier_Pilot_DZ","FR_TL_DZ","FR_R_DZ","FR_Marksman_DZ","FR_Assault_R_DZ","RU_Soldier_DZ","RU_Soldier_Officer_DZ","RUS_Soldier1_DZ","RUS_Commander_DZ","MVD_Soldier_DZ","Ins_Soldier_2_DZ","Ins_Commander_DZ","Ins_Soldier_Crew_DZ","CDF_Soldier_DZ","Doctor_DZ","Assistant_DZ","Worker1_DZ","Worker3_DZ","Worker4_DZ","TK_CIV_Takistani01_EP1_DZ","TK_CIV_Takistani03_EP1_DZ","TK_CIV_Takistani04_EP1_DZ","TK_CIV_Takistani06_EP1_DZ","TK_INS_Soldier_AR_EP1_DZ","TK_GUE_Soldier_EP1_DZ","CZ_Soldier_SL_DES_EP1_DZ","US_Soldier_EP1_DZ","UN_CDF_Soldier_Guard_EP1_DZ","UN_CDF_Soldier_EP1_DZ","GER_Soldier_TL_EP1_DZ","BAF_Soldier_Officer_MTP_DZ","BAF_Soldier_N_MTP_DZ","FR_Sapper_DZ"];
DayZ_Female = ["SurvivorW2_DZ","BanditW1_DZ","BanditW2_DZ","SurvivorWcombat_DZ","SurvivorWurban_DZ","SurvivorWdesert_DZ","SurvivorWsequishaD_DZ","SurvivorWsequisha_DZ","SurvivorWpink_DZ","SurvivorW3_DZ"];

//Classnames for specific items
MeleeWeapons = ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeBaseball","MeleeBaseBallBat","MeleeBaseBallBatBarbed","MeleeBaseBallBatNails","MeleeFishingPole","MeleeSledge"];
MeleeMagazines = ["Hatchet_Swing","Crowbar_Swing","Machete_Swing","Bat_Swing","BatBarbed_Swing","BatNails_Swing","Fishing_Swing","Sledge_Swing"];
MeleeAmmo = ["Hatchet_Swing_Ammo","Crowbar_Swing_Ammo","Machete_Swing_Ammo","Bat_Swing_Ammo","BatBarbed_Swing_Ammo","BatNailed_Swing_Ammo","Fishing_Swing_Ammo","Sledge_Swing_Ammo","Chainsaw_Swing_Ammo"];
Dayz_fishingItems = ["MeleeFishingPole"];
Dayz_plants = ["Dayz_Plant1","Dayz_Plant2","Dayz_Plant3"];
Dayz_attachment_array = ["Attachment_ACG","Attachment_AIM"];
//DayZ_Tents = ["TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4","DomeTentStorage","DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DomeTentStorage4"]
//DayZ_Stashs = ["StashSmall","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3","StashMedium4"]
//DayZ_cutter = ["Wire_cat1","Sandbag1_DZ","Fence_DZ","Generator_DZ","Hedgehog_DZ","CamoNet_DZ"]
DayZ_Backpacks = ["DZ_Patrol_Pack_EP1","DZ_Assault_Pack_EP1","DZ_Czech_Vest_Pouch","DZ_ALICE_Pack_EP1","DZ_TK_Assault_Pack_EP1","DZ_British_ACU","DZ_CivilBackpack_EP1","DZ_Backpack_EP1","DZ_TerminalPack_EP1","DZ_CompactPack_EP1","DZ_GunBag_EP1","DZ_LargeGunBag_EP1"];
Dayz_Gutting = ["ItemKnife","ItemKnife5","ItemKnife4","ItemKnife3","ItemKnife2","ItemKnife1","ItemKnifeBlunt"];
Dayz_Ignators = ["ItemMatchbox","Item5Matchbox","Item4Matchbox","Item3Matchbox","Item2Matchbox","Item1Matchbox"];
DayZ_fuelCans = ["ItemJerrycan","ItemFuelcan","ItemFuelBarrel"];
DayZ_fuelCansEmpty = ["ItemJerrycanEmpty","ItemFuelcanEmpty","ItemFuelBarrelEmpty"];
DayZ_traps = ["Trap_Cans","TrapTripwireFlare","TrapBearTrapSmoke","TrapTripwireGrenade","TrapTripwireSmoke","TrapBearTrapFlare"];
DayZ_ViralZeds = ["z_new_villager2","z_new_villager3","z_new_villager4","z_new_worker2","z_new_worker3","z_new_worker4"];
DayZ_SafeObjects = ["Base_Fire_DZ","WoodenGate_1","WoodenGate_2","WoodenGate_3","WoodenGate_4","Land_Fire_DZ","TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4","StashSmall","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3","StashMedium4","Wire_cat1","Sandbag1_DZ","Fence_DZ","Generator_DZ","Hedgehog_DZ","BearTrap_DZ","DomeTentStorage","DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DomeTentStorage4","CamoNet_DZ","Trap_Cans","TrapTripwireFlare","TrapBearTrapSmoke","TrapTripwireGrenade","TrapTripwireSmoke","TrapBearTrapFlare","TentStorageDomed","VaultStorageLocked","BagFenceRound_DZ","TrapBear","Fort_RazorWire","WoodGate_DZ","Land_HBarrier1_DZ","Land_HBarrier3_DZ","Land_HBarrier5_DZ","Fence_corrugated_DZ","M240Nest_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","Plastic_Pole_EP1_DZ","StickFence_DZ","LightPole_DZ","FuelPump_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","SandNest_DZ","DeerStand_DZ","MetalPanel_DZ","WorkBench_DZ","WoodFloor_DZ","WoodLargeWall_DZ","WoodLargeWallDoor_DZ","WoodLargeWallWin_DZ","WoodSmallWall_DZ","WoodSmallWallWin_DZ","WoodSmallWallDoor_DZ","LockboxStorageLocked","WoodFloorHalf_DZ","WoodFloorQuarter_DZ","WoodStairs_DZ","WoodStairsSans_DZ","WoodStairsRails_DZ","WoodSmallWallThird_DZ","WoodLadder_DZ","Land_DZE_GarageWoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_WoodDoor","Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoorLocked","CinderWallHalf_DZ","CinderWall_DZ","CinderWallDoorway_DZ","CinderWallDoor_DZ","CinderWallDoorLocked_DZ","CinderWallSmallDoorway_DZ","CinderWallDoorSmall_DZ","CinderWallDoorSmallLocked_DZ","MetalFloor_DZ","WoodRamp_DZ","GunRack_DZ","FireBarrel_DZ","WoodCrate_DZ","Scaffolding_DZ","DesertTentStorage","DesertTentStorage0","DesertTentStorage1","DesertTentStorage2","DesertTentStorage3","DesertTentStorage4"];
DayZ_DropDrageeObjects = ["WoodenGate_1","WoodenGate_2","WoodenGate_3","WoodenGate_4","TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4","Wire_cat1","Sandbag1_DZ","Fence_DZ","Generator_DZ","Hedgehog_DZ","DomeTentStorage","DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DomeTentStorage4","TentStorageDomed","VaultStorageLocked","BagFenceRound_DZ","Fort_RazorWire","WoodGate_DZ","Land_HBarrier1_DZ","Land_HBarrier3_DZ","Land_HBarrier5_DZ","Fence_corrugated_DZ","M240Nest_DZ","ParkBench_DZ","MetalGate_DZ","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","StickFence_DZ","SandNest_DZ","MetalPanel_DZ","WorkBench_DZ","WoodLargeWall_DZ","WoodLargeWallDoor_DZ","WoodLargeWallWin_DZ","WoodSmallWall_DZ","WoodSmallWallWin_DZ","WoodSmallWallDoor_DZ","LockboxStorageLocked","WoodSmallWallThird_DZ","WoodLadder_DZ","Land_DZE_GarageWoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_WoodDoor","Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoorLocked","CinderWallHalf_DZ","CinderWall_DZ","CinderWallDoorway_DZ","CinderWallDoor_DZ","CinderWallDoorLocked_DZ","CinderWallSmallDoorway_DZ","CinderWallDoorSmall_DZ","CinderWallDoorSmallLocked_DZ","DesertTentStorage","DesertTentStorage0","DesertTentStorage1","DesertTentStorage2","DesertTentStorage3","DesertTentStorage4","WoodFloorHalf_DZ","WoodFloor_DZ","WoodFloorQuarter_DZ","WoodStairs_DZ","WoodStairsSans_DZ","WoodStairsRails_DZ","MetalFloor_DZ","WoodRamp_DZ"];
DayZ_GearedObjects = ["Car","Helicopter","Motorcycle","Ship","TentStorage_base","StashSmall_base","StashMedium_base","Plane","Tank","VaultStorage","LockboxStorage","TentStorage","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","GunRack_DZ","WoodCrate_DZ","Scaffolding_DZ"];
DayZ_RestingAnims = ["amovpsitmstpsnonwpstdnon_ground","amovpsitmstpsnonwpstdnon_smoking","amovpsitmstpsraswrfldnon_weaponcheck1","amovpsitmstpsraswrfldnon"];
dayz_typedBags = ["bloodTester","bloodBagANEG","bloodBagAPOS","bloodBagBNEG","bloodBagBPOS","bloodBagABNEG","bloodBagABPOS","bloodBagONEG","bloodBagOPOS","wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"];
dayz_playerAchievements = []; //[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
dayz_trees = ["ind_timbers.p3d","t_picea2s_snow.p3d","b_corylus.p3d","t_quercus3s.p3d","t_larix3s.p3d","t_pyrus2s.p3d","str_briza_kriva.p3d","dd_borovice.p3d","les_singlestrom_b.p3d","les_singlestrom.p3d","smrk_velky.p3d","smrk_siroky.p3d","smrk_maly.p3d","les_buk.p3d","str krovisko vysoke.p3d","str_fikovnik_ker.p3d","str_fikovnik.p3d","str vrba.p3d","hrusen2.p3d","str dub jiny.p3d","str lipa.p3d","str briza.p3d","p_akat02s.p3d","jablon.p3d","p_buk.p3d","str_topol.p3d","str_topol2.p3d","p_osika.p3d","t_picea3f.p3d","t_picea2s.p3d","t_picea1s.p3d","t_fagus2w.p3d","t_fagus2s.p3d","t_fagus2f.p3d","t_betula1f.p3d","t_betula2f.p3d","t_betula2s.p3d","t_betula2w.p3d","t_alnus2s.p3d","t_acer2s.p3d","t_populus3s.p3d","t_quercus2f.p3d","t_sorbus2s.p3d","t_malus1s.p3d","t_salix2s.p3d","t_picea1s_w.p3d","t_picea2s_w.p3d","t_ficusb2s_ep1.p3d","t_populusb2s_ep1.p3d","t_populusf2s_ep1.p3d","t_amygdalusc2s_ep1.p3d","t_pistacial2s_ep1.p3d","t_pinuse2s_ep1.p3d","t_pinuss3s_ep1.p3d","t_prunuss2s_ep1.p3d","t_pinusn2s.p3d","t_pinusn1s.p3d","t_pinuss2f.p3d","t_poplar2f_dead_pmc.p3d","misc_torzotree_pmc.p3d","misc_burnspruce_pmc.p3d","brg_cocunutpalm8.p3d","brg_umbrella_acacia01b.p3d","brg_jungle_tree_canopy_1.p3d","brg_jungle_tree_canopy_2.p3d","brg_cocunutpalm4.p3d","brg_cocunutpalm3.p3d","palm_01.p3d","palm_02.p3d","palm_03.p3d","palm_04.p3d","palm_09.p3d","palm_10.p3d","brg_cocunutpalm2.p3d","brg_jungle_tree_antiaris.p3d","brg_cocunutpalm1.p3d","str habr.p3d","brg_bird_1.p3d","brg_bird_2.p3d","brg_bird_3.p3d","brg_umbrella_acacia02b.p3d","brg_africandoumpalm_1.p3d","brg_umbrella_acacia04b.p3d","brg_datepalm_4.p3d","brg_datepalm_1.p3d","brg_umbrella_acacia03b.p3d","brg_bottle_4.p3d","brg_aloe1.p3d","brg_umbrella_acacia03.p3d","brg_umbrella_acacia01.p3d","brg_umbrella_acacia04.p3d","brg_aloe2.p3d","brg_umbrella_acacia02.p3d","brg_aloe3.p3d","brg_bottle_1.p3d","brg_datepalm_3.p3d","brg_datepalm_2.p3d","brg_baobab_1.p3d","brg_bottle_2.p3d","brg_bottle_3.p3d","t_fraxinus2s.p3d","t_carpinus2s.p3d"];

Dayz_meatraw =
[
    "FoodBeefRaw",
    "FoodMuttonRaw",
    "FoodChickenRaw",
    "FoodRabbitRaw",
    "FoodBaconRaw",
    "FoodGoatRaw",
    "FoodDogRaw",
    "FishRawTrout",
    "FishRawSeaBass",
    "FishRawTuna"
];

Dayz_meatcooked =
[
    "FoodBeefCooked",
    "FoodMuttonCooked",
    "FoodChickenCooked",
    "FoodRabbitCooked",
    "FoodBaconCooked",
    "FoodGoatCooked",
    "FoodDogCooked",
    "FishCookedTrout",
    "FishCookedSeaBass",
    "FishCookedTuna"
];

boil_tin_cans =
[
    "TrashTinCan",
    "FoodCanGriffEmpty",
    "FoodCanBadguyEmpty",
    "FoodCanBoneboyEmpty",
    "FoodCanCornEmpty",
    "FoodCanCurgonEmpty",
    "FoodCanDemonEmpty",
    "FoodCanFraggleosEmpty",
    "FoodCanHerpyEmpty",
    "FoodCanDerpyEmpty",
    "FoodCanOrlokEmpty",
    "FoodCanPowellEmpty",
    "FoodCanTylersEmpty",
    "FoodCanUnlabeledEmpty",
    "FoodCanRusUnlabeledEmpty",
    "FoodCanRusStewEmpty",
    "FoodCanRusPorkEmpty",
    "FoodCanRusPeasEmpty",
    "FoodCanRusMilkEmpty",
    "FoodCanRusCornEmpty",
    "ItemSodaEmpty",
    "ItemSodaClaysEmpty",
    "ItemSodaDrwasteEmpty",
    "ItemSodaFrankaEmpty",
    "ItemSodaGrapeDrinkEmpty",
    "ItemSodaLemonadeEmpty",
    "ItemSodaLirikEmpty",
    "ItemSodaLvgEmpty",
    "ItemSodaMtngreenEmpty",
    "ItemSodaMzlyEmpty",
    "ItemSodaPeppsyEmpty",
    "ItemSodaR4z0rEmpty",
    "ItemSodaRabbitEmpty",
    "ItemSodaRocketFuelEmpty",
    "ItemSodaSacriteEmpty",
    //"ItemSodaSherbetEmpty",
    "ItemSodaSmashtEmpty",
    "FoodCanPotatoesEmpty",
    "FoodCanBeefEmpty"
];

canPickup = false;
pickupInit = false;
mouseOverCarry = false; //for carry slot since determining mouse pos doesn't work right
dayZ_partClasses = ["PartFueltank","PartWheel","PartEngine"]; //No need to add PartGeneric, it is default for everything
dayZ_explosiveParts = ["palivo","motor"];
if (isNil "infectedWaterHoles") then {infectedWaterHoles = [];}; //Needed for non-cherno maps

//Survival Variables
SleepFood = 2160; //minutes (48 hours)
SleepWater = 1440; //minutes (24 hours)
SleepTemperatur = 90 / 100;    //First value = Minutes until player reaches the coldest point at night (without other effects! night factor expected to be -1) //TeeChange

//Server Variables
allowConnection = false;
dayz_serverObjectMonitor = [];

//GUI
Dayz_GUI_R = 0.38; // 0.7 .38
Dayz_GUI_G = 0.63; // -0.63
Dayz_GUI_B = 0.26; // -0.26

//actions blockers
a_player_cooking = false;
a_player_boil = false;
a_player_jerryfilling = false;
a_player_repairing = false;

//Player self-action handles
dayz_resetSelfActions = {
    s_player_equip_carry = -1;
    s_player_dragbody = -1;
    s_player_fire = -1;
    s_player_cook = -1;
    s_player_boil = -1;
    s_player_fireout = -1;
    s_player_packtent = -1;
    s_player_packtentinfected = -1;
    s_player_fillwater = -1;
    s_player_fillwater2 = -1;
    s_player_fillfuel = -1;
    s_player_grabflare = -1;
    s_player_removeflare = -1;
    s_player_painkiller = -1;
    s_build_Sandbag1_DZ = -1;
    s_build_Hedgehog_DZ = -1;
    s_build_Wire_cat1 = -1;
    s_player_deleteBuild = -1;
    s_player_flipveh = -1;
    s_player_stats = -1;
    s_player_sleep = -1;
    s_player_fillfuel210 = -1;
    s_player_fillfuel20 = -1;
    s_player_fillfuel5 = -1;
    s_player_siphonfuel = -1;
    s_player_repair_crtl = -1;
    s_player_fishing = -1;
    s_player_fishing_veh = -1;
    s_player_gather = -1;
    s_player_debugCheck = -1;
    s_player_destorytent = -1;
    s_player_attach_bomb = -1;
    s_player_upgradestorage = -1;
    s_player_Drinkfromhands = -1;
    /*s_player_lockhouse = -1; //Vanilla base building currently not used in Epoch
    s_player_unlockhouse = -1;
    s_player_openGate = -1;
    s_player_CloseGate = -1;
    s_player_breakinhouse = -1;
    s_player_setCode = -1;
    s_player_BuildUnLock = -1;
    s_player_BuildLock = -1;*/
    s_player_packvault = -1;
    s_player_lockvault = -1;
    s_player_unlockvault = -1;
    s_player_attack = -1;
    s_player_callzombies = -1;
    s_player_showname = -1;
    s_player_pzombiesattack = -1;
    s_player_pzombiesvision = -1;
    s_player_pzombiesfeed = -1;
    s_player_tamedog = -1;
    s_player_parts_crtl = -1;
    s_player_movedog = -1;
    s_player_speeddog = -1;
    s_player_calldog = -1;
    s_player_feeddog = -1;
    s_player_waterdog = -1;
    s_player_staydog = -1;
    s_player_trackdog = -1;
    s_player_barkdog = -1;
    s_player_warndog = -1;
    s_player_followdog = -1;
    s_player_information = -1;    
    s_player_fuelauto = -1;
    s_player_fuelauto2 = -1;
    s_player_fillgen = -1;
    s_player_upgrade_build = -1;
    s_player_maint_build = -1;
    s_player_downgrade_build = -1;
    s_player_towing = -1;
    s_halo_action = -1;
    s_player_SurrenderedGear = -1;
    s_player_maintain_area = -1;
    s_player_maintain_area_force = -1;
    s_player_maintain_area_preview = -1;
    s_player_heli_lift = -1;
    s_player_heli_detach = -1;
    s_player_clothes = -1;
    s_player_lockUnlock_crtl = -1;
    s_player_lockUnlockInside_ctrl = -1;
    s_player_toggleSnap = -1;
    s_player_toggleSnapSelect = -1;
    s_player_toggleSnapSelectPoint = [];
    snapActions = -1;
    s_player_plot_boundary = -1;
    s_player_plot_take_ownership = -1;
    s_player_plotManagement = -1;
    s_player_toggleDegree = -1;
    s_player_toggleDegrees=[];
    degreeActions = -1;
    s_player_toggleVector = -1;
    s_player_toggleVectors=[];
    vectorActions = -1;
    s_player_manageDoor = -1;
    // garage
    s_player_garage = -1;
};
call dayz_resetSelfActions;

dayz_resetUpgradeActions = {
    s_player_disassembly = -1;
    s_player_building = -1;
    s_player_maintenance = -1;
};
call dayz_resetUpgradeActions;

//Engineering variables
s_player_lastTarget = objNull;
s_player_repairActions = [];

//Initialize Medical Variables
force_dropBody = false;
r_interrupt = false;
r_doLoop = false;
r_self = false;
r_self_actions = [];
r_drag_sqf = false;
r_action = false;
r_action_unload = false;
r_player_handler = false;
r_player_unconsciousInProgress = false;
r_player_unconsciousInputDisabled = false;
r_player_dead = false;
r_player_unconscious = false;
r_player_infected = false;
//infection from hits
r_player_Sepsis = [false, 0];
r_player_injured = false;
r_player_inpain = false;
r_player_loaded = false;
r_player_cardiac = false;
r_fracture_legs = false;
r_fracture_arms = false;
r_player_vehicle = player;
r_player_blood = 12000;
r_player_bloodregen = 0;
r_player_bloodgainpersec = 0;
r_player_bloodlosspersec = 0;
r_player_bloodpersec = 0; //Blood Per Sec (gain - loss)
r_player_foodstack = 1;
//player skill
r_player_lowblood = false;
r_player_timeout = 0;
r_player_bloodTotal = r_player_blood;
r_public_blood = r_player_blood;
r_player_bloodDanger = r_player_bloodTotal * 0.2;
r_player_actions = [];
r_handlerCount = 0;
r_action_targets = [];
r_pitchWhine = false;
r_isBandit = false;
dayz_DisplayGenderSelect = true;
//blood test vars
r_A_watered = false;
r_B_watered = false;
r_D_watered = false;
r_control_watered = false;
r_canClick_resultsCard = false;
r_resultsCard_Clicked = false;
r_water_clicked = false;
r_needleclicked = 0;
r_needleReset = false;
r_control_done = false;
r_antiA_done = false;
r_antiB_done = false;
r_antiD_done = false;
carryClick = false;
dayz_actionInProgress = false;
dayz_workingInprogress = false;
gear_done = false;

//player warming up vars
//heatpack
r_player_warming_heatpack = [false, 0];
r_player_warming_heatpack_time = 600; 

//displays temp progress
r_player_temp_factor = 0; //to be used for temp(up/down) indicators
r_player_temp_min_factor = -0.04; //(lvl3 down arrow)
r_player_temp_max_factor = 0.04; //(lvl3 up arrow)
 
//INT Nutrition Info
r_player_Nutrition = 0; // Calories
r_player_nutritionMuilpty = 2;

//ammo routine
r_player_actions2 = [];
r_action2 = false;
r_player_lastVehicle = objNull;
r_player_lastSeat = [];
r_player_removeActions2 = {
    if (!isNull r_player_lastVehicle) then {
        {
            r_player_lastVehicle removeAction _x;
        } count r_player_actions2;
        r_player_actions2 = [];
        r_action2 = false;
    };
};

USEC_woundHit = ["","body","hands","legs","head_hit"]; // limbs hit given by arma engine when fnc_usec_damageHandler is called
DAYZ_woundHit = [["body","hands","legs","head_hit"],[0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,3]];
DAYZ_woundHit_ok = [["body","hands","legs"],[0,0,0,0,0,1,1,1,2,2]];
USEC_MinorWounds = ["hands","legs"];
USEC_woundPoint = [ // translation table USEC_woundHit -> SV suffixes
    ["Pelvis","aimpoint"],
    ["aimpoint"], //,"RightShoulder","LeftShoulder"
    ["lelbow","relbow"],
    ["RightFoot","LeftFoot"],
    ["neck","pilot"]
];
USEC_typeOfWounds = [ // used by player_sumMedical, should contains all limbs described in USEC_woundPoint. These limbs statuses are saved by server_playerSync in HIVE if they are bleeding (medical select 8)
    "Pelvis",
    "aimpoint",
    "lelbow","relbow",
    "RightFoot","LeftFoot",
    "neck","pilot"
];

//Initialize Zombie Variables
dayz_zombieTargetList = [["SoldierWB",50],["Air",500],["LandVehicle",200]];
PVDZ_obj_Publish = []; // Used for eventhandler to spawn a mirror of players tent
PVCDZ_obj_HideBody = objNull;

//DayZ settings
dayz_lastHumanityChange = diag_tickTime;
dayz_maxAnimals = 5;
dayz_maxPlants = 3;
dayz_animalDistance = 600;
dayz_plantDistance = 600;

dayz_maxMaxModels = 80; // max quantity of Man models (player or Z, dead or alive) around players. Below this limit we can spawn Z // max quantity of loot piles around players. Below this limit we can spawn some loot
dayz_cantseeDist = 150; // distance from which we can spawn a Z in front of any player without ray-tracing and angle checks
dayz_cantseefov = 70; // half player field-of-view. Visible Z won't be spawned in front of any near players
dayz_canDelete = 350; // Z, further than this distance from its "owner", will be deleted
dayz_traps = [];
dayz_traps_active = [];
dayz_traps_trigger = [];

//Settings Not under dayz_settings
if(isNil "dayz_attackRange") then { 
    dayz_attackRange = 3;
};
if(isNil "dayz_DamageMultiplier") then { 
    dayz_DamageMultiplier = 1;
};
if(isNil "dayz_quickSwitch") then {
    dayz_quickSwitch = false; //Enable quick weapon switch,
};
//Will be moved to map
if(isNil "dayz_infectiouswaterholes") then {
    dayz_infectiouswaterholes = true; //Enable infected waterholes
};
if(isNil "dayz_POIs") then {
    dayz_POIs = true; //Enable POI's
};
if(isNil "dayz_ForcefullmoonNights") then {
    dayz_ForcefullmoonNights = false; // Forces night time to be full moon.
};
if(isNil "dayz_randomMaxFuelAmount") then {
    dayz_randomMaxFuelAmount = 500; //Puts a random amount of fuel in all fuel stations.
};
if(isNil "dayz_townGenerator") then {
    dayz_townGenerator = true; // Spawn map junk. Currently only compatible with Chernarus. Need to add coordinates for other maps.
};
if(isNil "dayz_townGeneratorBlackList") then {
    dayz_townGeneratorBlackList = []; // Town generator will not spawn junk within 150m of these positions.
};

//Replace server individual settings with ranked settings
if(isNil "dayz_presets") then { dayz_presets = "Vanilla"; };

switch (dayz_presets) do {
    case "Custom": { //Custom 
        if(isNil "dayz_enableGhosting") then { dayz_enableGhosting = false; };
        if(isNil "dayz_ghostTimer") then { dayz_ghostTimer = 120; };
        if(isNil "dayz_spawnselection") then { dayz_spawnselection = 0; };
        if(isNil "dayz_spawncarepkgs_clutterCutter") then { dayz_spawncarepkgs_clutterCutter = 0; };
        if(isNil "dayz_spawnCrashSite_clutterCutter") then { dayz_spawnCrashSite_clutterCutter = 0; };
        if(isNil "dayz_spawnInfectedSite_clutterCutter") then { dayz_spawnInfectedSite_clutterCutter = 0; };
        if(isNil "dayz_bleedingeffect") then { dayz_bleedingeffect = 2; };
        if(isNil "dayz_OpenTarget_TimerTicks") then { dayz_OpenTarget_TimerTicks = 60 * 10; };
        if(isNil "dayz_temperature_override") then { dayz_temperature_override = true; };
        if(isNil "dayz_nutritionValuesSystem") then { dayz_nutritionValuesSystem = false; };
        if(isNil "dayz_classicBloodBagSystem") then { dayz_classicBloodBagSystem = false; };
    };
    case "Classic": { //Classic
        dayz_enableGhosting = false; //Enable disable the ghosting system.
        dayz_ghostTimer = 120; //Sets how long in seconds a player must be dissconnected before being able to login again.
        dayz_spawnselection = 0; //Turn on spawn selection 0 = random only spawns, 1 = Spawn choice based on limits
        dayz_spawncarepkgs_clutterCutter = 0; //0 =  loot hidden in grass, 1 = loot lifted and 2 = no grass
        dayz_spawnCrashSite_clutterCutter = 0;    // heli crash options 0 =  loot hidden in grass, 1 = loot lifted and 2 = no grass
        dayz_spawnInfectedSite_clutterCutter = 0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass 
        dayz_bleedingeffect = 2; //1= blood on the ground, 2= partical effect, 3 = both.
        dayz_OpenTarget_TimerTicks = 60 * 10; //how long can a player be freely attacked for after attacking someone unprovoked.
        dayz_temperature_override = true; // Set to true to disable all temperature changes.
        dayz_nutritionValuesSystem = false; //Enables nutrition system
        dayz_classicBloodBagSystem = true; //Enables one type of bloodbag
    };
    case "Elite": { //Elite
        dayz_enableGhosting = true; //Enable disable the ghosting system.
        dayz_ghostTimer = 90; //Sets how long in seconds a player must be dissconnected before being able to login again.
        dayz_spawnselection = 0; //Turn on spawn selection 0 = random only spawns, 1 = Spawn choice based on limits
        dayz_spawncarepkgs_clutterCutter = 0; //0 =  loot hidden in grass, 1 = loot lifted and 2 = no grass
        dayz_spawnCrashSite_clutterCutter = 0;    // heli crash options 0 =  loot hidden in grass, 1 = loot lifted and 2 = no grass
        dayz_spawnInfectedSite_clutterCutter = 0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass 
        dayz_bleedingeffect = 3; //1= blood on the ground, 2= partical effect, 3 = both.
        dayz_OpenTarget_TimerTicks = 60 * 25; //how long can a player be freely attacked for after attacking someone unprovoked.
        dayz_temperature_override = false; // Set to true to disable all temperature changes.
        dayz_nutritionValuesSystem = true; //Enables nutrition system
        dayz_classicBloodBagSystem = false; //Enables one type of bloodbag
    };
    default { //Vanilla
        dayz_enableGhosting = true; //Enable disable the ghosting system.
        dayz_ghostTimer = 60; //Sets how long in seconds a player must be disconnected before being able to login again.
        dayz_spawnselection = 1; //Turn on spawn selection 0 = random only spawns, 1 = Spawn choice based on limits
        dayz_spawncarepkgs_clutterCutter = 0; //0 =  loot hidden in grass, 1 = loot lifted and 2 = no grass
        dayz_spawnCrashSite_clutterCutter = 0;    // heli crash options 0 =  loot hidden in grass, 1 = loot lifted and 2 = no grass
        dayz_spawnInfectedSite_clutterCutter = 0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass 
        dayz_bleedingeffect = 3; //1= blood on the ground, 2= partical effect, 3 = both.
        dayz_OpenTarget_TimerTicks = 60 * 10; //how long can a player be freely attacked for after attacking someone unprovoked.
        dayz_temperature_override = false; // Set to true to disable all temperature changes.
        dayz_nutritionValuesSystem = true; //Enables nutrition system
        dayz_classicBloodBagSystem = false; //Enables one type of bloodbag
    };
};

switch (toLower worldName) do {
    case "napf";
    case "sauerland" : {dayz_minpos = -1000; dayz_maxpos = 26000;};
    case "tavi" : {dayz_minpos = -26000; dayz_maxpos = 26000;};
    case "chernarus" : {dayz_minpos = -1; dayz_maxpos = 16000;};
    case default {dayz_minpos = -20000; dayz_maxpos = 20000;};
};

//start achievements_init
//call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\achievements_init.sqf";

// EPOCH ADDITIONS
keypadCancel = false; //Brute force fix
keyPadReset = {uiSleep 2; keypadCancel = false;};
canbuild = true;
dayz_activeInvites = [];
dayz_combination = "";
dayz_disallowedVault = ["TentStorage","BuiltItems","ModularItems","DZE_Base_Object","Generator_DZ"];
// These work with just a running generator
dayz_fuelpumparray = ["FuelPump_DZ","Land_A_FuelStation_Feed","Land_Ind_FuelStation_Feed_EP1","Land_FuelStation_Feed_PMC","FuelStation","Land_ibr_FuelStation_Feed","Land_fuelstation_army","Land_fuelstation","land_fuelstation_w","Land_benzina_schnell"];
// Standard Fuel sources
dayz_fuelsources = ["Land_Ind_TankSmall","Land_fuel_tank_big","Land_fuel_tank_stairs","Land_fuel_tank_stairs_ep1","Land_wagon_tanker","Land_fuelstation","Land_fuelstation_army","land_fuelstation_w","Land_benzina_schnell"];
dayz_humanitytarget = "";
dayz_selectedVault = objNull;
dayz_selectedDoor = objNull;
DAYZ_woundHit_dog = [["body","hands","legs"],[0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2]];
DZE_fueltruckarray = ["KamazRefuel_DZ","UralRefuel_TK_EP1_DZ","MtvrRefuel_DES_EP1_DZ","V3S_Refuel_TK_GUE_EP1_DZ","MtvrRefuel_DZ","KamazRefuel_DZE","KamazRefuel_DZE1","KamazRefuel_DZE2","KamazRefuel_DZE3","KamazRefuel_DZE4","UralRefuel_TK_EP1_DZE","MtvrRefuel_DES_EP1_DZE","V3S_Refuel_TK_GUE_EP1_DZE","MtvrRefuel_DZE"];
DZE_Lock_Door = "";
DZE_HeliAllowTowFrom = ["CH_47F_EP1_DZE","CH_47F_EP1_DZ","CH_47F_BAF","CH_47F_EP1","BAF_Merlin_DZE","CH53_DZE"];
DZE_HeliAllowToTow = ["hilux1_civil_1_open","HMMWV_Base","Lada_base","Offroad_DSHKM_base","Pickup_PK_base","SkodaBase","tractor","VWGolf","Volha_TK_CIV_Base_EP1","S1203_TK_CIV_EP1","SUV_Base_EP1","ArmoredSUV_Base_PMC","UAZ_Base","LandRover_Base","Ship"];
DZE_REPLACE_WEAPONS = [["Crossbow","DMR","M14_EP1","SVD","SVD_CAMO"],["Crossbow_DZ","DMR_DZ","M14_CCO_DZ","SVD_DZ","SVD_Gh_DZ"]];
DZE_LockableStorage = ["VaultStorage","VaultStorageLocked","LockboxStorageLocked","LockboxStorage"];
DZE_LockedStorage = ["VaultStorageLocked","LockboxStorageLocked"];
DZE_UnLockedStorage = ["VaultStorage","LockboxStorage"];
DZE_maintainClasses = ["ModularItems","DZE_Housebase","LightPole_DZ","BuiltItems","Generator_DZ","DZ_buildables","Plastic_Pole_EP1_DZ","Fence_corrugated_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","StickFence_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","DeerStand_DZ","Scaffolding_DZ","FireBarrel_DZ","M240Nest_DZ"];
DZE_DoorsLocked = ["Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoorLocked","CinderWallDoorLocked_DZ","CinderWallDoorSmallLocked_DZ"];
// List of removable items that require crowbar
DZE_isRemovable = ["Fence_corrugated_DZ","M240Nest_DZ","ParkBench_DZ","Plastic_Pole_EP1_DZ","FireBarrel_DZ","Scaffolding_DZ","CanvasHut_DZ"];
DZE_isWreck = ["SKODAWreck","HMMWVWreck","UralWreck","datsun01Wreck","hiluxWreck","datsun02Wreck","UAZWreck","Land_Misc_Garb_Heap_EP1","Fort_Barricade_EP1","Rubbish2"];
DZE_isWreckBuilding = ["Land_wreck_cinder","Land_wood_wreck_quarter","Land_wood_wreck_floor","Land_wood_wreck_third","Land_wood_wreck_frame","Land_iron_vein_wreck","Land_silver_vein_wreck","Land_gold_vein_wreck","Land_ammo_supply_wreck"];
DZE_isNewStorage = ["VaultStorage","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","GunRack_DZ","WoodCrate_DZ"];
DZE_isDestroyableStorage = ["OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","GunRack_DZ","WoodCrate_DZ"];
helperDetach = false;
DZE_snapExtraRange = 0;
DZE_tradeVehicle = ["trade_any_vehicle","trade_any_vehicle_free","trade_any_vehicle_old","trade_any_bicycle","trade_any_bicycle_old","trade_any_boat","trade_any_boat_old"];
DZE_tradeVehicleKeyless = ["trade_any_bicycle","trade_any_bicycle_old","trade_any_vehicle_free"];
DZE_tradeObject = DZE_tradeVehicle + ["trade_backpacks"];
if (isNil "DZE_plotOwnershipExclusions") then {
    DZE_plotTakeOwnershipItems = DayZ_SafeObjects - (DZE_LockableStorage + ["Plastic_Pole_EP1_DZ","DZ_storage_base"]);
};

DZE_GearCheckBypass = false;
isInTraderCity = false;
inTraderCity = "Unknown Trader";
PlayerDeaths = [];
PVDZE_obj_Trade = []; // For all traders increment qty
PVDZE_plr_DeathB = [];
PVDZE_plr_TradeMenu = []; // For all traders
snapGizmos = [];
snapGizmosNearby = [];
s_player_combi = [];
s_player_lockunlock = [];
s_player_lockUnlockInside = [];
s_player_parts = [];
if (isNil "DZE_GodModeBase") then {DZE_GodModeBase = false;};
if (isNil "dayz_paraSpawn") then {dayz_paraSpawn = false;};
if (isNil "DZE_BuildingLimit") then {DZE_BuildingLimit = 150;};
if (isNil "DZE_BuildOnRoads") then {DZE_BuildOnRoads = false;};
if (isNil "DZE_SelfTransfuse") then {DZE_SelfTransfuse = false;};
if (isNil "DZE_selfTransfuse_Values") then {DZE_selfTransfuse_Values = [12000,15,120];};
if (isNil "DZE_PlotPole") then {DZE_PlotPole = [30,45];};
DZE_maintainRange = ((DZE_PlotPole select 0)+20);
if (isNil "DZE_slowZombies") then {DZE_slowZombies = false;};
TimeOutDisplayed = false;

if (isServer) then {
    dead_bodyCleanup = [];
    needUpdate_objects = [];
    needUpdate_FenceObjects = [];
    //dayz_spawnCrashSite_clutterCutter=0; // helicrash spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass 
    //dayz_spawnInfectedSite_clutterCutter=0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass 
    //Objects to remove when killed.
    DayZ_nonCollide = ["TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4","StashSmall","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3", "StashMedium4", "DomeTentStorage", "DomeTentStorage0", "DomeTentStorage1", "DomeTentStorage2", "DomeTentStorage3", "DomeTentStorage4", "CamoNet_DZ", "DesertTentStorage", "DesertTentStorage0", "DesertTentStorage1", "DesertTentStorage2", "DomeTentStorage3", "DesertTentStorage4"];
    DayZ_WoodenFence = ["WoodenFence_1","WoodenFence_2","WoodenFence_3","WoodenFence_4","WoodenFence_5","WoodenFence_6","WoodenFence_7"];
    DayZ_WoodenGates = ["WoodenGate_1","WoodenGate_2","WoodenGate_3","WoodenGate_4"];
    DayZ_removableObjects = ["Wire_cat1","Sandbag1_DZ","Hedgehog_DZ","CamoNet_DZ","Trap_Cans","TrapTripwireFlare","TrapBearTrapSmoke","TrapTripwireGrenade","TrapTripwireSmoke","TrapBearTrapFlare"];
    //[10416.695, 4198.4634],[7982.2563, 1419.8256],[10795.93, 1419.8263],[7966.083, 4088.7463],[9259.7266, 2746.1985],[5200.5234, 3915.3274],[6494.1665, 2572.7798],[5216.6968, 1246.407],[2564.7244, 3915.3296],[3858.3674, 2572.782],[2580.8977, 1246.4092],[13398.995, 4400.5874],[12242.025, 2948.3196],[13551.842, 1832.2257],[14870.512, 3009.5117],[-178.19415, 1062.4478],[1099.2754, 2388.8206],[-194.36755, 3731.3679],[10394.215, 8322.1719],[7959.7759, 5543.5342],[10773.449, 5543.5342],
    dayz_grid =[[7943.6025, 8212.4551],[9237.2461, 6869.9063],[5178.043, 8039.0361],[6471.686, 6696.4883],[5194.2163, 5370.1152],[2542.2439, 8039.0381],[3835.887, 6696.4902],[2558.4172, 5370.1172],[13376.514, 8524.2969],[12219.544, 7072.0273],[13529.361, 5955.9336],[14848.032, 7133.2197],[-200.67474, 5186.1563],[1076.7949, 6512.5283],[-216.84814, 7855.0771],[10293.751, 12197.736],[7859.312, 9419.0996],[10672.988, 9419.0996],[7843.1387, 12088.021],[9136.7822, 10745.474],[5077.5791, 11914.601],[6371.2222, 10572.052],[5093.7524, 9245.6816],[2441.78, 11914.604],[3735.4231, 10572.055],[2457.9534, 9245.6816],[13276.053, 12399.861],[12119.08, 10947.596],[13428.897, 9831.501],[14747.566, 11008.786],[-301.13867, 9061.7207],[976.33112, 10388.096],[-317.31201, 11730.642],[10271.271, 16321.429],[7836.8315, 13542.813],[10650.506, 13542.813],[7820.6582, 16211.718],[9114.3018, 14869.175],[5055.0986, 16038.3],[6348.7417, 14695.758],[5071.272, 13369.392],[2419.2996, 16038.305],[3712.9426, 14695.76],[2435.4729, 13369.392],[13253.568, 16523.553],[12096.6, 15071.295],[13406.416, 13955.209],[14725.089, 15132.486],[-323.61914, 13185.43],[953.85059, 14511.8],[-339.79248, 15854.346]];
    dayz_choppedTrees = [];
    dayz_ghostPlayers = [];
    dayz_activePlayers = [];
    dayz_died = [];

    // EPOCH ADDITIONS
    DZE_safeVehicle = ["ParachuteWest","ParachuteC","HeliH","Garbage_container"];
//    if (isNil "EpochUseEvents") then {EpochUseEvents = true;};
//    if (isNil "EpochEvents") then {EpochEvents = [
EpochUseEvents = true; //Enable event scheduler. Define custom scripts in dayz_server\modules to run on a schedule.
EpochEvents = [
["any","any","any","any",2,"Construction"],  
//["any","any","any","any",5,"Construction"],
["any","any","any","any",15,"Military"],
["any","any","any","any",25,"Treasure"],
["any","any","any","any",35,"crash_spawner"],
["any","any","any","any",45,"Building"],
["any","any","any","any",55,"Military"],
["any","any","any","any",65,"Treasure"],
["any","any","any","any",75,"Construction"]
//["any","any","any","any",85,"SupplyItems"]
//["any","any","any","any",95,"Vault"]
    ];//};
    if (isNil "MaxDynamicDebris") then {MaxDynamicDebris = 100;};
    if (isNil "MaxVehicleLimit") then {MaxVehicleLimit = 50;};
    if (isNil "spawnArea") then {spawnArea = 1400;};
    if (isNil "spawnShoremode") then {spawnShoremode = 1;};
};

if (!isDedicated) then {
    dayz_buildingBubbleMonitor = [];

    //temperature variables
    dayz_temperatur = 36; //TeeChange
    dayz_temperaturnormal = 36; //TeeChange
    dayz_temperaturmax = 42; //TeeChange
    dayz_temperaturmin = 27; //TeeChange

    //player special variables
    dayz_bloodBagHumanity = 300;
    dayz_lastDamageSourceNull = false;
    dayz_lastDamageSource = "none";
    dayz_lastDamageTime = 0;
    dayz_lastMedicalSource = "none";
    dayz_lastMedicalTime = 0;
    dayz_lastClothesChange = 0;
    dayZ_lastPlayerUpdate = 0;
    dayz_lastSelfTransfusion = -(DZE_selfTransfuse_Values select 2);
    dayz_lastTransfusion = 0;
    dayz_playerName = "unknown";
    dayz_hunger = 0;
    dayz_thirst = 0;
    dayz_nutrition = 0;
    dayz_preloadFinished = true;
    dayz_soundMuted = false;
    dayz_statusArray = [1,1];
    dayz_disAudial = 0;
    dayz_disVisual = 0;
    dayz_firedCooldown = 0;
    dayz_damageCounter = time;
    dayz_lastSave = time;
    dayz_isSwimming = true;
    dayz_currentDay = 0;
    dayz_hasLight = false;
    dayz_surfaceNoise = 0;
    dayz_surfaceType = "None";
    dayz_noPenalty = [];
    dayz_heavenCooldown = 0;
    deathHandled = false;
    dayz_firstGroup = group player;
    dayz_originalPlayer = player;
    dayz_sourceBleeding = objNull;
    dayz_clientPreload = false;
    dayz_authed = false;
    dayz_panicCooldown = 0;
    dayz_areaAffect = 3.5;
    dayz_monitorPeriod = 0.6; // number of seconds between each player_zombieCheck calls
    dayz_heartBeat = false;
    dayz_spawnZombies = 0; // Current local
    dayz_swarmSpawnZombies = 0;
    dayz_maxLocalZombies = 15; // max quantity of Z controlled by local gameclient, used by player_spawnCheck. Below this limit we can spawn Z
    dayz_CurrentNearByZombies = 0;
    dayz_maxNearByZombies = 30; // max quantity of Z controlled by local gameclient, used by player_spawnCheck. Below this limit we can spawn Z
    dayz_currentGlobalZombies = 0; // Current total
    if(isNil "dayz_maxGlobalZeds") then {
        dayz_maxGlobalZeds = 1000;
    };
    //Animals
    dayz_currentGlobalAnimals =    0;
    dayz_maxGlobalAnimals =    50;
    //Plants    
    dayz_currentGlobalPlants = 0;
    dayz_maxGlobalPlants = 500;
    //Loot
    r_player_divideinvehicle = 0;
    dayz_currentWeaponHolders = 0;
    dayz_maxMaxWeaponHolders = 80;
    dayz_inVehicle = false;
    dayz_unsaved = false;
    dayz_scaleLight = 0;
    dayzDebug = false;
    dayzState = -1;
    dayz_onBack = "";
    dayz_fishingInprogress = false;
    dayz_siphonFuelInProgress = false;
    dayz_salvageInProgress = false;
    lastSpawned = diag_tickTime;
    lastSepsis = 0;
    NORRN_dropAction = -1;
    //uiNamespace setVariable ['DAYZ_GUI_display',displayNull];
    //if (uiNamespace getVariable ['DZ_displayUI', 0] == 2) then {
    //    dayzDebug = true;
    //};
    dayz_dodge = false;
    Dayz_constructionContext = [];
    Dayz_freefall = [ time, 0, 0.1 ];
    dayz_getout = objNull;
    dayz_getoutTime = 0;
    dayz_HitBy = objNull;
    voice_actions = ["voiceOverNet","PushToTalk","PushToTalkAll","PushToTalkCommand","PushToTalkDirect","PushToTalkGroup","PushToTalkSide","PushToTalkVehicle"];

    // EPOCH ADDITIONS
    if (isNil "DZE_BackpackAntiTheft") then {DZE_BackpackAntiTheft = false;};
    if (isNil "DZE_requireplot") then {DZE_requireplot = 1;};
    if (isNil "DZE_StaticConstructionCount") then {DZE_StaticConstructionCount = 0;};
    if (toLower DZE_DeathMsgChat in ["global","side"]) then {enableRadio true;}; //Needed for scripted global chat to show, doesn't seem to have any adverse effects
    autoRunActive = false;
    DZE_AntiWallCounter = 0;
    DZE_myHaloVehicle = objNull;
    dayz_myLiftVehicle = objNull;
    DZE_Friends = [];
    DZE_Q = false;
    DZE_Z = false;
    DZE_Q_alt = false;
    DZE_Z_alt = false;
    DZE_Q_ctrl = false;
    DZE_Z_ctrl = false;
    DZE_4 = false;
    DZE_5 = false;
    DZE_6 = false;
    DZE_F = false;
    DZE_cancelBuilding = false;
    DZE_TEMP_treedmg = 1;
    DZE_Surrender = false;
    DZE_Quarantine = false;
    DZE_InRadiationZone = false;
    DZE_myVehicle = objNull;
    dayz_groupNameTags = true;
};
 

Link to comment
Share on other sites

  • 0
2 minutes ago, Th3-Hunter333 said:

Ill try to help out some more with this this here is my variables.sqf below

I have more than triple checked to make sure everything is right and am more or less bouncing my head off a wall trying anything at this point.
I cant for the life of me find it 

 

  Reveal hidden contents

 

disableSerialization;

// garage
DZE_Garage = ["Garbage_container"];

//Model Variables
Bandit1_DZ = "Bandit1_DZ";
BanditW1_DZ = "BanditW1_DZ";
Survivor1_DZ = "Survivor1_DZ";
Survivor2_DZ = "Survivor2_DZ";
SurvivorW2_DZ = "SurvivorW2_DZ";
Sniper1_DZ = "Sniper1_DZ";
Camo1_DZ = "Camo1_DZ";
Soldier1_DZ = "Soldier1_DZ";
Rocket_DZ = "Rocket_DZ";
// EPOCH ADDITIONS
Bandit2_DZ = "Bandit2_DZ";
BanditW2_DZ = "BanditW2_DZ";
SurvivorW3_DZ = "SurvivorW2_DZ";

//Rolling Msg system
Message_1 = "";
Message_2 = "";
Message_3 = "";
Message_1_time = 0;
Message_2_time = 0;
Message_3_time = 0;
//Kill Feed
death_1 = "";
death_2 = "";
death_3 = "";
death_4 = "";
death_1_time = 0;
death_2_time = 0;
death_3_time = 0;
death_4_time = 0;

//OpenTarget timer
OpenTarget_Time = 0;

///Player classes
AllPlayers = ["Survivor_DZ","Survivor1_DZ","SurvivorW2_DZ","Survivor2_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","BanditW1_DZ","Bandit1_DZ","Survivor3_DZ","SurvivorWcombat_DZ","SurvivorWdesert_DZ","SurvivorWurban_DZ","SurvivorWsequishaD_DZ","SurvivorWsequisha_DZ","SurvivorWpink_DZ","SurvivorW3_DZ","Bandit2_DZ","BanditW2_DZ","Soldier_Crew_PMC","Rocket_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","Priest_DZ","Functionary1_EP1_DZ","GUE_Commander_DZ","Ins_Soldier_GL_DZ","Haris_Press_EP1_DZ","Pilot_EP1_DZ","RU_Policeman_DZ","pz_policeman","pz_suit1","pz_suit2","pz_worker1","pz_worker2","pz_worker3","pz_doctor","pz_teacher","pz_hunter","pz_villager1","pz_villager2","pz_villager3","pz_priest","Soldier_TL_PMC_DZ","Soldier_Sniper_PMC_DZ","Soldier_Bodyguard_AA12_PMC_DZ","Drake_Light_DZ","CZ_Special_Forces_GL_DES_EP1_DZ","TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ","FR_OHara_DZ","FR_Rodriguez_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","GUE_Soldier_MG_DZ","GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_CO_DZ","GUE_Soldier_2_DZ","TK_Special_Forces_MG_EP1_DZ","TK_Soldier_Sniper_EP1_DZ","TK_Commander_EP1_DZ","RU_Soldier_Crew_DZ","INS_Lopotev_DZ","INS_Soldier_AR_DZ","INS_Soldier_CO_DZ","INS_Bardak_DZ","INS_Worker2_DZ","USMC_Soldier_Officer_DZ","USMC_Soldier_MG_DZ","USMC_Soldier_Pilot_DZ","FR_TL_DZ","FR_R_DZ","FR_Marksman_DZ","FR_Assault_R_DZ","RU_Soldier_DZ","RU_Soldier_Officer_DZ","RUS_Soldier1_DZ","RUS_Commander_DZ","MVD_Soldier_DZ","Ins_Soldier_2_DZ","Ins_Commander_DZ","Ins_Soldier_Crew_DZ","CDF_Soldier_DZ","Doctor_DZ","Assistant_DZ","Worker1_DZ","Worker3_DZ","Worker4_DZ","TK_CIV_Takistani01_EP1_DZ","TK_CIV_Takistani03_EP1_DZ","TK_CIV_Takistani04_EP1_DZ","TK_CIV_Takistani06_EP1_DZ","TK_INS_Soldier_AR_EP1_DZ","TK_GUE_Soldier_EP1_DZ","CZ_Soldier_SL_DES_EP1_DZ","US_Soldier_EP1_DZ","UN_CDF_Soldier_Guard_EP1_DZ","UN_CDF_Soldier_EP1_DZ","GER_Soldier_TL_EP1_DZ","BAF_Soldier_Officer_MTP_DZ","BAF_Soldier_N_MTP_DZ","FR_Sapper_DZ"];
DayZ_Male = ["Survivor_DZ","Survivor1_DZ","Survivor2_DZ","Survivor3_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","Bandit1_DZ","Bandit2_DZ","Soldier_Crew_PMC","Rocket_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","Priest_DZ","Functionary1_EP1_DZ","GUE_Commander_DZ","Ins_Soldier_GL_DZ","Haris_Press_EP1_DZ","Pilot_EP1_DZ","RU_Policeman_DZ","pz_policeman","pz_suit1","pz_suit2","pz_worker1","pz_worker2","pz_worker3","pz_doctor","pz_teacher","pz_hunter","pz_villager1","pz_villager2","pz_villager3","pz_priest","Soldier_TL_PMC_DZ","Soldier_Sniper_PMC_DZ","Soldier_Bodyguard_AA12_PMC_DZ","Drake_Light_DZ","CZ_Special_Forces_GL_DES_EP1_DZ","TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ","FR_OHara_DZ","FR_Rodriguez_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","GUE_Soldier_MG_DZ","GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_CO_DZ","GUE_Soldier_2_DZ","TK_Special_Forces_MG_EP1_DZ","TK_Soldier_Sniper_EP1_DZ","TK_Commander_EP1_DZ","RU_Soldier_Crew_DZ","INS_Lopotev_DZ","INS_Soldier_AR_DZ","INS_Soldier_CO_DZ","INS_Bardak_DZ","INS_Worker2_DZ","USMC_Soldier_Officer_DZ","USMC_Soldier_MG_DZ","USMC_Soldier_Pilot_DZ","FR_TL_DZ","FR_R_DZ","FR_Marksman_DZ","FR_Assault_R_DZ","RU_Soldier_DZ","RU_Soldier_Officer_DZ","RUS_Soldier1_DZ","RUS_Commander_DZ","MVD_Soldier_DZ","Ins_Soldier_2_DZ","Ins_Commander_DZ","Ins_Soldier_Crew_DZ","CDF_Soldier_DZ","Doctor_DZ","Assistant_DZ","Worker1_DZ","Worker3_DZ","Worker4_DZ","TK_CIV_Takistani01_EP1_DZ","TK_CIV_Takistani03_EP1_DZ","TK_CIV_Takistani04_EP1_DZ","TK_CIV_Takistani06_EP1_DZ","TK_INS_Soldier_AR_EP1_DZ","TK_GUE_Soldier_EP1_DZ","CZ_Soldier_SL_DES_EP1_DZ","US_Soldier_EP1_DZ","UN_CDF_Soldier_Guard_EP1_DZ","UN_CDF_Soldier_EP1_DZ","GER_Soldier_TL_EP1_DZ","BAF_Soldier_Officer_MTP_DZ","BAF_Soldier_N_MTP_DZ","FR_Sapper_DZ"];
DayZ_Female = ["SurvivorW2_DZ","BanditW1_DZ","BanditW2_DZ","SurvivorWcombat_DZ","SurvivorWurban_DZ","SurvivorWdesert_DZ","SurvivorWsequishaD_DZ","SurvivorWsequisha_DZ","SurvivorWpink_DZ","SurvivorW3_DZ"];

//Classnames for specific items
MeleeWeapons = ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeBaseball","MeleeBaseBallBat","MeleeBaseBallBatBarbed","MeleeBaseBallBatNails","MeleeFishingPole","MeleeSledge"];
MeleeMagazines = ["Hatchet_Swing","Crowbar_Swing","Machete_Swing","Bat_Swing","BatBarbed_Swing","BatNails_Swing","Fishing_Swing","Sledge_Swing"];
MeleeAmmo = ["Hatchet_Swing_Ammo","Crowbar_Swing_Ammo","Machete_Swing_Ammo","Bat_Swing_Ammo","BatBarbed_Swing_Ammo","BatNailed_Swing_Ammo","Fishing_Swing_Ammo","Sledge_Swing_Ammo","Chainsaw_Swing_Ammo"];
Dayz_fishingItems = ["MeleeFishingPole"];
Dayz_plants = ["Dayz_Plant1","Dayz_Plant2","Dayz_Plant3"];
Dayz_attachment_array = ["Attachment_ACG","Attachment_AIM"];
//DayZ_Tents = ["TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4","DomeTentStorage","DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DomeTentStorage4"]
//DayZ_Stashs = ["StashSmall","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3","StashMedium4"]
//DayZ_cutter = ["Wire_cat1","Sandbag1_DZ","Fence_DZ","Generator_DZ","Hedgehog_DZ","CamoNet_DZ"]
DayZ_Backpacks = ["DZ_Patrol_Pack_EP1","DZ_Assault_Pack_EP1","DZ_Czech_Vest_Pouch","DZ_ALICE_Pack_EP1","DZ_TK_Assault_Pack_EP1","DZ_British_ACU","DZ_CivilBackpack_EP1","DZ_Backpack_EP1","DZ_TerminalPack_EP1","DZ_CompactPack_EP1","DZ_GunBag_EP1","DZ_LargeGunBag_EP1"];
Dayz_Gutting = ["ItemKnife","ItemKnife5","ItemKnife4","ItemKnife3","ItemKnife2","ItemKnife1","ItemKnifeBlunt"];
Dayz_Ignators = ["ItemMatchbox","Item5Matchbox","Item4Matchbox","Item3Matchbox","Item2Matchbox","Item1Matchbox"];
DayZ_fuelCans = ["ItemJerrycan","ItemFuelcan","ItemFuelBarrel"];
DayZ_fuelCansEmpty = ["ItemJerrycanEmpty","ItemFuelcanEmpty","ItemFuelBarrelEmpty"];
DayZ_traps = ["Trap_Cans","TrapTripwireFlare","TrapBearTrapSmoke","TrapTripwireGrenade","TrapTripwireSmoke","TrapBearTrapFlare"];
DayZ_ViralZeds = ["z_new_villager2","z_new_villager3","z_new_villager4","z_new_worker2","z_new_worker3","z_new_worker4"];
DayZ_SafeObjects = ["Base_Fire_DZ","WoodenGate_1","WoodenGate_2","WoodenGate_3","WoodenGate_4","Land_Fire_DZ","TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4","StashSmall","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3","StashMedium4","Wire_cat1","Sandbag1_DZ","Fence_DZ","Generator_DZ","Hedgehog_DZ","BearTrap_DZ","DomeTentStorage","DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DomeTentStorage4","CamoNet_DZ","Trap_Cans","TrapTripwireFlare","TrapBearTrapSmoke","TrapTripwireGrenade","TrapTripwireSmoke","TrapBearTrapFlare","TentStorageDomed","VaultStorageLocked","BagFenceRound_DZ","TrapBear","Fort_RazorWire","WoodGate_DZ","Land_HBarrier1_DZ","Land_HBarrier3_DZ","Land_HBarrier5_DZ","Fence_corrugated_DZ","M240Nest_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","Plastic_Pole_EP1_DZ","StickFence_DZ","LightPole_DZ","FuelPump_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","SandNest_DZ","DeerStand_DZ","MetalPanel_DZ","WorkBench_DZ","WoodFloor_DZ","WoodLargeWall_DZ","WoodLargeWallDoor_DZ","WoodLargeWallWin_DZ","WoodSmallWall_DZ","WoodSmallWallWin_DZ","WoodSmallWallDoor_DZ","LockboxStorageLocked","WoodFloorHalf_DZ","WoodFloorQuarter_DZ","WoodStairs_DZ","WoodStairsSans_DZ","WoodStairsRails_DZ","WoodSmallWallThird_DZ","WoodLadder_DZ","Land_DZE_GarageWoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_WoodDoor","Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoorLocked","CinderWallHalf_DZ","CinderWall_DZ","CinderWallDoorway_DZ","CinderWallDoor_DZ","CinderWallDoorLocked_DZ","CinderWallSmallDoorway_DZ","CinderWallDoorSmall_DZ","CinderWallDoorSmallLocked_DZ","MetalFloor_DZ","WoodRamp_DZ","GunRack_DZ","FireBarrel_DZ","WoodCrate_DZ","Scaffolding_DZ","DesertTentStorage","DesertTentStorage0","DesertTentStorage1","DesertTentStorage2","DesertTentStorage3","DesertTentStorage4"];
DayZ_DropDrageeObjects = ["WoodenGate_1","WoodenGate_2","WoodenGate_3","WoodenGate_4","TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4","Wire_cat1","Sandbag1_DZ","Fence_DZ","Generator_DZ","Hedgehog_DZ","DomeTentStorage","DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DomeTentStorage4","TentStorageDomed","VaultStorageLocked","BagFenceRound_DZ","Fort_RazorWire","WoodGate_DZ","Land_HBarrier1_DZ","Land_HBarrier3_DZ","Land_HBarrier5_DZ","Fence_corrugated_DZ","M240Nest_DZ","ParkBench_DZ","MetalGate_DZ","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","StickFence_DZ","SandNest_DZ","MetalPanel_DZ","WorkBench_DZ","WoodLargeWall_DZ","WoodLargeWallDoor_DZ","WoodLargeWallWin_DZ","WoodSmallWall_DZ","WoodSmallWallWin_DZ","WoodSmallWallDoor_DZ","LockboxStorageLocked","WoodSmallWallThird_DZ","WoodLadder_DZ","Land_DZE_GarageWoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_WoodDoor","Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoorLocked","CinderWallHalf_DZ","CinderWall_DZ","CinderWallDoorway_DZ","CinderWallDoor_DZ","CinderWallDoorLocked_DZ","CinderWallSmallDoorway_DZ","CinderWallDoorSmall_DZ","CinderWallDoorSmallLocked_DZ","DesertTentStorage","DesertTentStorage0","DesertTentStorage1","DesertTentStorage2","DesertTentStorage3","DesertTentStorage4","WoodFloorHalf_DZ","WoodFloor_DZ","WoodFloorQuarter_DZ","WoodStairs_DZ","WoodStairsSans_DZ","WoodStairsRails_DZ","MetalFloor_DZ","WoodRamp_DZ"];
DayZ_GearedObjects = ["Car","Helicopter","Motorcycle","Ship","TentStorage_base","StashSmall_base","StashMedium_base","Plane","Tank","VaultStorage","LockboxStorage","TentStorage","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","GunRack_DZ","WoodCrate_DZ","Scaffolding_DZ"];
DayZ_RestingAnims = ["amovpsitmstpsnonwpstdnon_ground","amovpsitmstpsnonwpstdnon_smoking","amovpsitmstpsraswrfldnon_weaponcheck1","amovpsitmstpsraswrfldnon"];
dayz_typedBags = ["bloodTester","bloodBagANEG","bloodBagAPOS","bloodBagBNEG","bloodBagBPOS","bloodBagABNEG","bloodBagABPOS","bloodBagONEG","bloodBagOPOS","wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"];
dayz_playerAchievements = []; //[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
dayz_trees = ["ind_timbers.p3d","t_picea2s_snow.p3d","b_corylus.p3d","t_quercus3s.p3d","t_larix3s.p3d","t_pyrus2s.p3d","str_briza_kriva.p3d","dd_borovice.p3d","les_singlestrom_b.p3d","les_singlestrom.p3d","smrk_velky.p3d","smrk_siroky.p3d","smrk_maly.p3d","les_buk.p3d","str krovisko vysoke.p3d","str_fikovnik_ker.p3d","str_fikovnik.p3d","str vrba.p3d","hrusen2.p3d","str dub jiny.p3d","str lipa.p3d","str briza.p3d","p_akat02s.p3d","jablon.p3d","p_buk.p3d","str_topol.p3d","str_topol2.p3d","p_osika.p3d","t_picea3f.p3d","t_picea2s.p3d","t_picea1s.p3d","t_fagus2w.p3d","t_fagus2s.p3d","t_fagus2f.p3d","t_betula1f.p3d","t_betula2f.p3d","t_betula2s.p3d","t_betula2w.p3d","t_alnus2s.p3d","t_acer2s.p3d","t_populus3s.p3d","t_quercus2f.p3d","t_sorbus2s.p3d","t_malus1s.p3d","t_salix2s.p3d","t_picea1s_w.p3d","t_picea2s_w.p3d","t_ficusb2s_ep1.p3d","t_populusb2s_ep1.p3d","t_populusf2s_ep1.p3d","t_amygdalusc2s_ep1.p3d","t_pistacial2s_ep1.p3d","t_pinuse2s_ep1.p3d","t_pinuss3s_ep1.p3d","t_prunuss2s_ep1.p3d","t_pinusn2s.p3d","t_pinusn1s.p3d","t_pinuss2f.p3d","t_poplar2f_dead_pmc.p3d","misc_torzotree_pmc.p3d","misc_burnspruce_pmc.p3d","brg_cocunutpalm8.p3d","brg_umbrella_acacia01b.p3d","brg_jungle_tree_canopy_1.p3d","brg_jungle_tree_canopy_2.p3d","brg_cocunutpalm4.p3d","brg_cocunutpalm3.p3d","palm_01.p3d","palm_02.p3d","palm_03.p3d","palm_04.p3d","palm_09.p3d","palm_10.p3d","brg_cocunutpalm2.p3d","brg_jungle_tree_antiaris.p3d","brg_cocunutpalm1.p3d","str habr.p3d","brg_bird_1.p3d","brg_bird_2.p3d","brg_bird_3.p3d","brg_umbrella_acacia02b.p3d","brg_africandoumpalm_1.p3d","brg_umbrella_acacia04b.p3d","brg_datepalm_4.p3d","brg_datepalm_1.p3d","brg_umbrella_acacia03b.p3d","brg_bottle_4.p3d","brg_aloe1.p3d","brg_umbrella_acacia03.p3d","brg_umbrella_acacia01.p3d","brg_umbrella_acacia04.p3d","brg_aloe2.p3d","brg_umbrella_acacia02.p3d","brg_aloe3.p3d","brg_bottle_1.p3d","brg_datepalm_3.p3d","brg_datepalm_2.p3d","brg_baobab_1.p3d","brg_bottle_2.p3d","brg_bottle_3.p3d","t_fraxinus2s.p3d","t_carpinus2s.p3d"];

Dayz_meatraw =
[
    "FoodBeefRaw",
    "FoodMuttonRaw",
    "FoodChickenRaw",
    "FoodRabbitRaw",
    "FoodBaconRaw",
    "FoodGoatRaw",
    "FoodDogRaw",
    "FishRawTrout",
    "FishRawSeaBass",
    "FishRawTuna"
];

Dayz_meatcooked =
[
    "FoodBeefCooked",
    "FoodMuttonCooked",
    "FoodChickenCooked",
    "FoodRabbitCooked",
    "FoodBaconCooked",
    "FoodGoatCooked",
    "FoodDogCooked",
    "FishCookedTrout",
    "FishCookedSeaBass",
    "FishCookedTuna"
];

boil_tin_cans =
[
    "TrashTinCan",
    "FoodCanGriffEmpty",
    "FoodCanBadguyEmpty",
    "FoodCanBoneboyEmpty",
    "FoodCanCornEmpty",
    "FoodCanCurgonEmpty",
    "FoodCanDemonEmpty",
    "FoodCanFraggleosEmpty",
    "FoodCanHerpyEmpty",
    "FoodCanDerpyEmpty",
    "FoodCanOrlokEmpty",
    "FoodCanPowellEmpty",
    "FoodCanTylersEmpty",
    "FoodCanUnlabeledEmpty",
    "FoodCanRusUnlabeledEmpty",
    "FoodCanRusStewEmpty",
    "FoodCanRusPorkEmpty",
    "FoodCanRusPeasEmpty",
    "FoodCanRusMilkEmpty",
    "FoodCanRusCornEmpty",
    "ItemSodaEmpty",
    "ItemSodaClaysEmpty",
    "ItemSodaDrwasteEmpty",
    "ItemSodaFrankaEmpty",
    "ItemSodaGrapeDrinkEmpty",
    "ItemSodaLemonadeEmpty",
    "ItemSodaLirikEmpty",
    "ItemSodaLvgEmpty",
    "ItemSodaMtngreenEmpty",
    "ItemSodaMzlyEmpty",
    "ItemSodaPeppsyEmpty",
    "ItemSodaR4z0rEmpty",
    "ItemSodaRabbitEmpty",
    "ItemSodaRocketFuelEmpty",
    "ItemSodaSacriteEmpty",
    //"ItemSodaSherbetEmpty",
    "ItemSodaSmashtEmpty",
    "FoodCanPotatoesEmpty",
    "FoodCanBeefEmpty"
];

canPickup = false;
pickupInit = false;
mouseOverCarry = false; //for carry slot since determining mouse pos doesn't work right
dayZ_partClasses = ["PartFueltank","PartWheel","PartEngine"]; //No need to add PartGeneric, it is default for everything
dayZ_explosiveParts = ["palivo","motor"];
if (isNil "infectedWaterHoles") then {infectedWaterHoles = [];}; //Needed for non-cherno maps

//Survival Variables
SleepFood = 2160; //minutes (48 hours)
SleepWater = 1440; //minutes (24 hours)
SleepTemperatur = 90 / 100;    //First value = Minutes until player reaches the coldest point at night (without other effects! night factor expected to be -1) //TeeChange

//Server Variables
allowConnection = false;
dayz_serverObjectMonitor = [];

//GUI
Dayz_GUI_R = 0.38; // 0.7 .38
Dayz_GUI_G = 0.63; // -0.63
Dayz_GUI_B = 0.26; // -0.26

//actions blockers
a_player_cooking = false;
a_player_boil = false;
a_player_jerryfilling = false;
a_player_repairing = false;

//Player self-action handles
dayz_resetSelfActions = {
    s_player_equip_carry = -1;
    s_player_dragbody = -1;
    s_player_fire = -1;
    s_player_cook = -1;
    s_player_boil = -1;
    s_player_fireout = -1;
    s_player_packtent = -1;
    s_player_packtentinfected = -1;
    s_player_fillwater = -1;
    s_player_fillwater2 = -1;
    s_player_fillfuel = -1;
    s_player_grabflare = -1;
    s_player_removeflare = -1;
    s_player_painkiller = -1;
    s_build_Sandbag1_DZ = -1;
    s_build_Hedgehog_DZ = -1;
    s_build_Wire_cat1 = -1;
    s_player_deleteBuild = -1;
    s_player_flipveh = -1;
    s_player_stats = -1;
    s_player_sleep = -1;
    s_player_fillfuel210 = -1;
    s_player_fillfuel20 = -1;
    s_player_fillfuel5 = -1;
    s_player_siphonfuel = -1;
    s_player_repair_crtl = -1;
    s_player_fishing = -1;
    s_player_fishing_veh = -1;
    s_player_gather = -1;
    s_player_debugCheck = -1;
    s_player_destorytent = -1;
    s_player_attach_bomb = -1;
    s_player_upgradestorage = -1;
    s_player_Drinkfromhands = -1;
    /*s_player_lockhouse = -1; //Vanilla base building currently not used in Epoch
    s_player_unlockhouse = -1;
    s_player_openGate = -1;
    s_player_CloseGate = -1;
    s_player_breakinhouse = -1;
    s_player_setCode = -1;
    s_player_BuildUnLock = -1;
    s_player_BuildLock = -1;*/
    s_player_packvault = -1;
    s_player_lockvault = -1;
    s_player_unlockvault = -1;
    s_player_attack = -1;
    s_player_callzombies = -1;
    s_player_showname = -1;
    s_player_pzombiesattack = -1;
    s_player_pzombiesvision = -1;
    s_player_pzombiesfeed = -1;
    s_player_tamedog = -1;
    s_player_parts_crtl = -1;
    s_player_movedog = -1;
    s_player_speeddog = -1;
    s_player_calldog = -1;
    s_player_feeddog = -1;
    s_player_waterdog = -1;
    s_player_staydog = -1;
    s_player_trackdog = -1;
    s_player_barkdog = -1;
    s_player_warndog = -1;
    s_player_followdog = -1;
    s_player_information = -1;    
    s_player_fuelauto = -1;
    s_player_fuelauto2 = -1;
    s_player_fillgen = -1;
    s_player_upgrade_build = -1;
    s_player_maint_build = -1;
    s_player_downgrade_build = -1;
    s_player_towing = -1;
    s_halo_action = -1;
    s_player_SurrenderedGear = -1;
    s_player_maintain_area = -1;
    s_player_maintain_area_force = -1;
    s_player_maintain_area_preview = -1;
    s_player_heli_lift = -1;
    s_player_heli_detach = -1;
    s_player_clothes = -1;
    s_player_lockUnlock_crtl = -1;
    s_player_lockUnlockInside_ctrl = -1;
    s_player_toggleSnap = -1;
    s_player_toggleSnapSelect = -1;
    s_player_toggleSnapSelectPoint = [];
    snapActions = -1;
    s_player_plot_boundary = -1;
    s_player_plot_take_ownership = -1;
    s_player_plotManagement = -1;
    s_player_toggleDegree = -1;
    s_player_toggleDegrees=[];
    degreeActions = -1;
    s_player_toggleVector = -1;
    s_player_toggleVectors=[];
    vectorActions = -1;
    s_player_manageDoor = -1;
    // garage
    s_player_garage = -1;
};
call dayz_resetSelfActions;

dayz_resetUpgradeActions = {
    s_player_disassembly = -1;
    s_player_building = -1;
    s_player_maintenance = -1;
};
call dayz_resetUpgradeActions;

//Engineering variables
s_player_lastTarget = objNull;
s_player_repairActions = [];

//Initialize Medical Variables
force_dropBody = false;
r_interrupt = false;
r_doLoop = false;
r_self = false;
r_self_actions = [];
r_drag_sqf = false;
r_action = false;
r_action_unload = false;
r_player_handler = false;
r_player_unconsciousInProgress = false;
r_player_unconsciousInputDisabled = false;
r_player_dead = false;
r_player_unconscious = false;
r_player_infected = false;
//infection from hits
r_player_Sepsis = [false, 0];
r_player_injured = false;
r_player_inpain = false;
r_player_loaded = false;
r_player_cardiac = false;
r_fracture_legs = false;
r_fracture_arms = false;
r_player_vehicle = player;
r_player_blood = 12000;
r_player_bloodregen = 0;
r_player_bloodgainpersec = 0;
r_player_bloodlosspersec = 0;
r_player_bloodpersec = 0; //Blood Per Sec (gain - loss)
r_player_foodstack = 1;
//player skill
r_player_lowblood = false;
r_player_timeout = 0;
r_player_bloodTotal = r_player_blood;
r_public_blood = r_player_blood;
r_player_bloodDanger = r_player_bloodTotal * 0.2;
r_player_actions = [];
r_handlerCount = 0;
r_action_targets = [];
r_pitchWhine = false;
r_isBandit = false;
dayz_DisplayGenderSelect = true;
//blood test vars
r_A_watered = false;
r_B_watered = false;
r_D_watered = false;
r_control_watered = false;
r_canClick_resultsCard = false;
r_resultsCard_Clicked = false;
r_water_clicked = false;
r_needleclicked = 0;
r_needleReset = false;
r_control_done = false;
r_antiA_done = false;
r_antiB_done = false;
r_antiD_done = false;
carryClick = false;
dayz_actionInProgress = false;
dayz_workingInprogress = false;
gear_done = false;

//player warming up vars
//heatpack
r_player_warming_heatpack = [false, 0];
r_player_warming_heatpack_time = 600; 

//displays temp progress
r_player_temp_factor = 0; //to be used for temp(up/down) indicators
r_player_temp_min_factor = -0.04; //(lvl3 down arrow)
r_player_temp_max_factor = 0.04; //(lvl3 up arrow)
 
//INT Nutrition Info
r_player_Nutrition = 0; // Calories
r_player_nutritionMuilpty = 2;

//ammo routine
r_player_actions2 = [];
r_action2 = false;
r_player_lastVehicle = objNull;
r_player_lastSeat = [];
r_player_removeActions2 = {
    if (!isNull r_player_lastVehicle) then {
        {
            r_player_lastVehicle removeAction _x;
        } count r_player_actions2;
        r_player_actions2 = [];
        r_action2 = false;
    };
};

USEC_woundHit = ["","body","hands","legs","head_hit"]; // limbs hit given by arma engine when fnc_usec_damageHandler is called
DAYZ_woundHit = [["body","hands","legs","head_hit"],[0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,3]];
DAYZ_woundHit_ok = [["body","hands","legs"],[0,0,0,0,0,1,1,1,2,2]];
USEC_MinorWounds = ["hands","legs"];
USEC_woundPoint = [ // translation table USEC_woundHit -> SV suffixes
    ["Pelvis","aimpoint"],
    ["aimpoint"], //,"RightShoulder","LeftShoulder"
    ["lelbow","relbow"],
    ["RightFoot","LeftFoot"],
    ["neck","pilot"]
];
USEC_typeOfWounds = [ // used by player_sumMedical, should contains all limbs described in USEC_woundPoint. These limbs statuses are saved by server_playerSync in HIVE if they are bleeding (medical select 8)
    "Pelvis",
    "aimpoint",
    "lelbow","relbow",
    "RightFoot","LeftFoot",
    "neck","pilot"
];

//Initialize Zombie Variables
dayz_zombieTargetList = [["SoldierWB",50],["Air",500],["LandVehicle",200]];
PVDZ_obj_Publish = []; // Used for eventhandler to spawn a mirror of players tent
PVCDZ_obj_HideBody = objNull;

//DayZ settings
dayz_lastHumanityChange = diag_tickTime;
dayz_maxAnimals = 5;
dayz_maxPlants = 3;
dayz_animalDistance = 600;
dayz_plantDistance = 600;

dayz_maxMaxModels = 80; // max quantity of Man models (player or Z, dead or alive) around players. Below this limit we can spawn Z // max quantity of loot piles around players. Below this limit we can spawn some loot
dayz_cantseeDist = 150; // distance from which we can spawn a Z in front of any player without ray-tracing and angle checks
dayz_cantseefov = 70; // half player field-of-view. Visible Z won't be spawned in front of any near players
dayz_canDelete = 350; // Z, further than this distance from its "owner", will be deleted
dayz_traps = [];
dayz_traps_active = [];
dayz_traps_trigger = [];

//Settings Not under dayz_settings
if(isNil "dayz_attackRange") then { 
    dayz_attackRange = 3;
};
if(isNil "dayz_DamageMultiplier") then { 
    dayz_DamageMultiplier = 1;
};
if(isNil "dayz_quickSwitch") then {
    dayz_quickSwitch = false; //Enable quick weapon switch,
};
//Will be moved to map
if(isNil "dayz_infectiouswaterholes") then {
    dayz_infectiouswaterholes = true; //Enable infected waterholes
};
if(isNil "dayz_POIs") then {
    dayz_POIs = true; //Enable POI's
};
if(isNil "dayz_ForcefullmoonNights") then {
    dayz_ForcefullmoonNights = false; // Forces night time to be full moon.
};
if(isNil "dayz_randomMaxFuelAmount") then {
    dayz_randomMaxFuelAmount = 500; //Puts a random amount of fuel in all fuel stations.
};
if(isNil "dayz_townGenerator") then {
    dayz_townGenerator = true; // Spawn map junk. Currently only compatible with Chernarus. Need to add coordinates for other maps.
};
if(isNil "dayz_townGeneratorBlackList") then {
    dayz_townGeneratorBlackList = []; // Town generator will not spawn junk within 150m of these positions.
};

//Replace server individual settings with ranked settings
if(isNil "dayz_presets") then { dayz_presets = "Vanilla"; };

switch (dayz_presets) do {
    case "Custom": { //Custom 
        if(isNil "dayz_enableGhosting") then { dayz_enableGhosting = false; };
        if(isNil "dayz_ghostTimer") then { dayz_ghostTimer = 120; };
        if(isNil "dayz_spawnselection") then { dayz_spawnselection = 0; };
        if(isNil "dayz_spawncarepkgs_clutterCutter") then { dayz_spawncarepkgs_clutterCutter = 0; };
        if(isNil "dayz_spawnCrashSite_clutterCutter") then { dayz_spawnCrashSite_clutterCutter = 0; };
        if(isNil "dayz_spawnInfectedSite_clutterCutter") then { dayz_spawnInfectedSite_clutterCutter = 0; };
        if(isNil "dayz_bleedingeffect") then { dayz_bleedingeffect = 2; };
        if(isNil "dayz_OpenTarget_TimerTicks") then { dayz_OpenTarget_TimerTicks = 60 * 10; };
        if(isNil "dayz_temperature_override") then { dayz_temperature_override = true; };
        if(isNil "dayz_nutritionValuesSystem") then { dayz_nutritionValuesSystem = false; };
        if(isNil "dayz_classicBloodBagSystem") then { dayz_classicBloodBagSystem = false; };
    };
    case "Classic": { //Classic
        dayz_enableGhosting = false; //Enable disable the ghosting system.
        dayz_ghostTimer = 120; //Sets how long in seconds a player must be dissconnected before being able to login again.
        dayz_spawnselection = 0; //Turn on spawn selection 0 = random only spawns, 1 = Spawn choice based on limits
        dayz_spawncarepkgs_clutterCutter = 0; //0 =  loot hidden in grass, 1 = loot lifted and 2 = no grass
        dayz_spawnCrashSite_clutterCutter = 0;    // heli crash options 0 =  loot hidden in grass, 1 = loot lifted and 2 = no grass
        dayz_spawnInfectedSite_clutterCutter = 0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass 
        dayz_bleedingeffect = 2; //1= blood on the ground, 2= partical effect, 3 = both.
        dayz_OpenTarget_TimerTicks = 60 * 10; //how long can a player be freely attacked for after attacking someone unprovoked.
        dayz_temperature_override = true; // Set to true to disable all temperature changes.
        dayz_nutritionValuesSystem = false; //Enables nutrition system
        dayz_classicBloodBagSystem = true; //Enables one type of bloodbag
    };
    case "Elite": { //Elite
        dayz_enableGhosting = true; //Enable disable the ghosting system.
        dayz_ghostTimer = 90; //Sets how long in seconds a player must be dissconnected before being able to login again.
        dayz_spawnselection = 0; //Turn on spawn selection 0 = random only spawns, 1 = Spawn choice based on limits
        dayz_spawncarepkgs_clutterCutter = 0; //0 =  loot hidden in grass, 1 = loot lifted and 2 = no grass
        dayz_spawnCrashSite_clutterCutter = 0;    // heli crash options 0 =  loot hidden in grass, 1 = loot lifted and 2 = no grass
        dayz_spawnInfectedSite_clutterCutter = 0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass 
        dayz_bleedingeffect = 3; //1= blood on the ground, 2= partical effect, 3 = both.
        dayz_OpenTarget_TimerTicks = 60 * 25; //how long can a player be freely attacked for after attacking someone unprovoked.
        dayz_temperature_override = false; // Set to true to disable all temperature changes.
        dayz_nutritionValuesSystem = true; //Enables nutrition system
        dayz_classicBloodBagSystem = false; //Enables one type of bloodbag
    };
    default { //Vanilla
        dayz_enableGhosting = true; //Enable disable the ghosting system.
        dayz_ghostTimer = 60; //Sets how long in seconds a player must be disconnected before being able to login again.
        dayz_spawnselection = 1; //Turn on spawn selection 0 = random only spawns, 1 = Spawn choice based on limits
        dayz_spawncarepkgs_clutterCutter = 0; //0 =  loot hidden in grass, 1 = loot lifted and 2 = no grass
        dayz_spawnCrashSite_clutterCutter = 0;    // heli crash options 0 =  loot hidden in grass, 1 = loot lifted and 2 = no grass
        dayz_spawnInfectedSite_clutterCutter = 0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass 
        dayz_bleedingeffect = 3; //1= blood on the ground, 2= partical effect, 3 = both.
        dayz_OpenTarget_TimerTicks = 60 * 10; //how long can a player be freely attacked for after attacking someone unprovoked.
        dayz_temperature_override = false; // Set to true to disable all temperature changes.
        dayz_nutritionValuesSystem = true; //Enables nutrition system
        dayz_classicBloodBagSystem = false; //Enables one type of bloodbag
    };
};

switch (toLower worldName) do {
    case "napf";
    case "sauerland" : {dayz_minpos = -1000; dayz_maxpos = 26000;};
    case "tavi" : {dayz_minpos = -26000; dayz_maxpos = 26000;};
    case "chernarus" : {dayz_minpos = -1; dayz_maxpos = 16000;};
    case default {dayz_minpos = -20000; dayz_maxpos = 20000;};
};

//start achievements_init
//call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\achievements_init.sqf";

// EPOCH ADDITIONS
keypadCancel = false; //Brute force fix
keyPadReset = {uiSleep 2; keypadCancel = false;};
canbuild = true;
dayz_activeInvites = [];
dayz_combination = "";
dayz_disallowedVault = ["TentStorage","BuiltItems","ModularItems","DZE_Base_Object","Generator_DZ"];
// These work with just a running generator
dayz_fuelpumparray = ["FuelPump_DZ","Land_A_FuelStation_Feed","Land_Ind_FuelStation_Feed_EP1","Land_FuelStation_Feed_PMC","FuelStation","Land_ibr_FuelStation_Feed","Land_fuelstation_army","Land_fuelstation","land_fuelstation_w","Land_benzina_schnell"];
// Standard Fuel sources
dayz_fuelsources = ["Land_Ind_TankSmall","Land_fuel_tank_big","Land_fuel_tank_stairs","Land_fuel_tank_stairs_ep1","Land_wagon_tanker","Land_fuelstation","Land_fuelstation_army","land_fuelstation_w","Land_benzina_schnell"];
dayz_humanitytarget = "";
dayz_selectedVault = objNull;
dayz_selectedDoor = objNull;
DAYZ_woundHit_dog = [["body","hands","legs"],[0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2]];
DZE_fueltruckarray = ["KamazRefuel_DZ","UralRefuel_TK_EP1_DZ","MtvrRefuel_DES_EP1_DZ","V3S_Refuel_TK_GUE_EP1_DZ","MtvrRefuel_DZ","KamazRefuel_DZE","KamazRefuel_DZE1","KamazRefuel_DZE2","KamazRefuel_DZE3","KamazRefuel_DZE4","UralRefuel_TK_EP1_DZE","MtvrRefuel_DES_EP1_DZE","V3S_Refuel_TK_GUE_EP1_DZE","MtvrRefuel_DZE"];
DZE_Lock_Door = "";
DZE_HeliAllowTowFrom = ["CH_47F_EP1_DZE","CH_47F_EP1_DZ","CH_47F_BAF","CH_47F_EP1","BAF_Merlin_DZE","CH53_DZE"];
DZE_HeliAllowToTow = ["hilux1_civil_1_open","HMMWV_Base","Lada_base","Offroad_DSHKM_base","Pickup_PK_base","SkodaBase","tractor","VWGolf","Volha_TK_CIV_Base_EP1","S1203_TK_CIV_EP1","SUV_Base_EP1","ArmoredSUV_Base_PMC","UAZ_Base","LandRover_Base","Ship"];
DZE_REPLACE_WEAPONS = [["Crossbow","DMR","M14_EP1","SVD","SVD_CAMO"],["Crossbow_DZ","DMR_DZ","M14_CCO_DZ","SVD_DZ","SVD_Gh_DZ"]];
DZE_LockableStorage = ["VaultStorage","VaultStorageLocked","LockboxStorageLocked","LockboxStorage"];
DZE_LockedStorage = ["VaultStorageLocked","LockboxStorageLocked"];
DZE_UnLockedStorage = ["VaultStorage","LockboxStorage"];
DZE_maintainClasses = ["ModularItems","DZE_Housebase","LightPole_DZ","BuiltItems","Generator_DZ","DZ_buildables","Plastic_Pole_EP1_DZ","Fence_corrugated_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","StickFence_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","DeerStand_DZ","Scaffolding_DZ","FireBarrel_DZ","M240Nest_DZ"];
DZE_DoorsLocked = ["Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoorLocked","CinderWallDoorLocked_DZ","CinderWallDoorSmallLocked_DZ"];
// List of removable items that require crowbar
DZE_isRemovable = ["Fence_corrugated_DZ","M240Nest_DZ","ParkBench_DZ","Plastic_Pole_EP1_DZ","FireBarrel_DZ","Scaffolding_DZ","CanvasHut_DZ"];
DZE_isWreck = ["SKODAWreck","HMMWVWreck","UralWreck","datsun01Wreck","hiluxWreck","datsun02Wreck","UAZWreck","Land_Misc_Garb_Heap_EP1","Fort_Barricade_EP1","Rubbish2"];
DZE_isWreckBuilding = ["Land_wreck_cinder","Land_wood_wreck_quarter","Land_wood_wreck_floor","Land_wood_wreck_third","Land_wood_wreck_frame","Land_iron_vein_wreck","Land_silver_vein_wreck","Land_gold_vein_wreck","Land_ammo_supply_wreck"];
DZE_isNewStorage = ["VaultStorage","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","GunRack_DZ","WoodCrate_DZ"];
DZE_isDestroyableStorage = ["OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","GunRack_DZ","WoodCrate_DZ"];
helperDetach = false;
DZE_snapExtraRange = 0;
DZE_tradeVehicle = ["trade_any_vehicle","trade_any_vehicle_free","trade_any_vehicle_old","trade_any_bicycle","trade_any_bicycle_old","trade_any_boat","trade_any_boat_old"];
DZE_tradeVehicleKeyless = ["trade_any_bicycle","trade_any_bicycle_old","trade_any_vehicle_free"];
DZE_tradeObject = DZE_tradeVehicle + ["trade_backpacks"];
if (isNil "DZE_plotOwnershipExclusions") then {
    DZE_plotTakeOwnershipItems = DayZ_SafeObjects - (DZE_LockableStorage + ["Plastic_Pole_EP1_DZ","DZ_storage_base"]);
};

DZE_GearCheckBypass = false;
isInTraderCity = false;
inTraderCity = "Unknown Trader";
PlayerDeaths = [];
PVDZE_obj_Trade = []; // For all traders increment qty
PVDZE_plr_DeathB = [];
PVDZE_plr_TradeMenu = []; // For all traders
snapGizmos = [];
snapGizmosNearby = [];
s_player_combi = [];
s_player_lockunlock = [];
s_player_lockUnlockInside = [];
s_player_parts = [];
if (isNil "DZE_GodModeBase") then {DZE_GodModeBase = false;};
if (isNil "dayz_paraSpawn") then {dayz_paraSpawn = false;};
if (isNil "DZE_BuildingLimit") then {DZE_BuildingLimit = 150;};
if (isNil "DZE_BuildOnRoads") then {DZE_BuildOnRoads = false;};
if (isNil "DZE_SelfTransfuse") then {DZE_SelfTransfuse = false;};
if (isNil "DZE_selfTransfuse_Values") then {DZE_selfTransfuse_Values = [12000,15,120];};
if (isNil "DZE_PlotPole") then {DZE_PlotPole = [30,45];};
DZE_maintainRange = ((DZE_PlotPole select 0)+20);
if (isNil "DZE_slowZombies") then {DZE_slowZombies = false;};
TimeOutDisplayed = false;

if (isServer) then {
    dead_bodyCleanup = [];
    needUpdate_objects = [];
    needUpdate_FenceObjects = [];
    //dayz_spawnCrashSite_clutterCutter=0; // helicrash spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass 
    //dayz_spawnInfectedSite_clutterCutter=0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass 
    //Objects to remove when killed.
    DayZ_nonCollide = ["TentStorage","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4","StashSmall","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3", "StashMedium4", "DomeTentStorage", "DomeTentStorage0", "DomeTentStorage1", "DomeTentStorage2", "DomeTentStorage3", "DomeTentStorage4", "CamoNet_DZ", "DesertTentStorage", "DesertTentStorage0", "DesertTentStorage1", "DesertTentStorage2", "DomeTentStorage3", "DesertTentStorage4"];
    DayZ_WoodenFence = ["WoodenFence_1","WoodenFence_2","WoodenFence_3","WoodenFence_4","WoodenFence_5","WoodenFence_6","WoodenFence_7"];
    DayZ_WoodenGates = ["WoodenGate_1","WoodenGate_2","WoodenGate_3","WoodenGate_4"];
    DayZ_removableObjects = ["Wire_cat1","Sandbag1_DZ","Hedgehog_DZ","CamoNet_DZ","Trap_Cans","TrapTripwireFlare","TrapBearTrapSmoke","TrapTripwireGrenade","TrapTripwireSmoke","TrapBearTrapFlare"];
    //[10416.695, 4198.4634],[7982.2563, 1419.8256],[10795.93, 1419.8263],[7966.083, 4088.7463],[9259.7266, 2746.1985],[5200.5234, 3915.3274],[6494.1665, 2572.7798],[5216.6968, 1246.407],[2564.7244, 3915.3296],[3858.3674, 2572.782],[2580.8977, 1246.4092],[13398.995, 4400.5874],[12242.025, 2948.3196],[13551.842, 1832.2257],[14870.512, 3009.5117],[-178.19415, 1062.4478],[1099.2754, 2388.8206],[-194.36755, 3731.3679],[10394.215, 8322.1719],[7959.7759, 5543.5342],[10773.449, 5543.5342],
    dayz_grid =[[7943.6025, 8212.4551],[9237.2461, 6869.9063],[5178.043, 8039.0361],[6471.686, 6696.4883],[5194.2163, 5370.1152],[2542.2439, 8039.0381],[3835.887, 6696.4902],[2558.4172, 5370.1172],[13376.514, 8524.2969],[12219.544, 7072.0273],[13529.361, 5955.9336],[14848.032, 7133.2197],[-200.67474, 5186.1563],[1076.7949, 6512.5283],[-216.84814, 7855.0771],[10293.751, 12197.736],[7859.312, 9419.0996],[10672.988, 9419.0996],[7843.1387, 12088.021],[9136.7822, 10745.474],[5077.5791, 11914.601],[6371.2222, 10572.052],[5093.7524, 9245.6816],[2441.78, 11914.604],[3735.4231, 10572.055],[2457.9534, 9245.6816],[13276.053, 12399.861],[12119.08, 10947.596],[13428.897, 9831.501],[14747.566, 11008.786],[-301.13867, 9061.7207],[976.33112, 10388.096],[-317.31201, 11730.642],[10271.271, 16321.429],[7836.8315, 13542.813],[10650.506, 13542.813],[7820.6582, 16211.718],[9114.3018, 14869.175],[5055.0986, 16038.3],[6348.7417, 14695.758],[5071.272, 13369.392],[2419.2996, 16038.305],[3712.9426, 14695.76],[2435.4729, 13369.392],[13253.568, 16523.553],[12096.6, 15071.295],[13406.416, 13955.209],[14725.089, 15132.486],[-323.61914, 13185.43],[953.85059, 14511.8],[-339.79248, 15854.346]];
    dayz_choppedTrees = [];
    dayz_ghostPlayers = [];
    dayz_activePlayers = [];
    dayz_died = [];

    // EPOCH ADDITIONS
    DZE_safeVehicle = ["ParachuteWest","ParachuteC","HeliH","Garbage_container"];
//    if (isNil "EpochUseEvents") then {EpochUseEvents = true;};
//    if (isNil "EpochEvents") then {EpochEvents = [
EpochUseEvents = true; //Enable event scheduler. Define custom scripts in dayz_server\modules to run on a schedule.
EpochEvents = [
["any","any","any","any",2,"Construction"],  
//["any","any","any","any",5,"Construction"],
["any","any","any","any",15,"Military"],
["any","any","any","any",25,"Treasure"],
["any","any","any","any",35,"crash_spawner"],
["any","any","any","any",45,"Building"],
["any","any","any","any",55,"Military"],
["any","any","any","any",65,"Treasure"],
["any","any","any","any",75,"Construction"]
//["any","any","any","any",85,"SupplyItems"]
//["any","any","any","any",95,"Vault"]
    ];//};
    if (isNil "MaxDynamicDebris") then {MaxDynamicDebris = 100;};
    if (isNil "MaxVehicleLimit") then {MaxVehicleLimit = 50;};
    if (isNil "spawnArea") then {spawnArea = 1400;};
    if (isNil "spawnShoremode") then {spawnShoremode = 1;};
};

if (!isDedicated) then {
    dayz_buildingBubbleMonitor = [];

    //temperature variables
    dayz_temperatur = 36; //TeeChange
    dayz_temperaturnormal = 36; //TeeChange
    dayz_temperaturmax = 42; //TeeChange
    dayz_temperaturmin = 27; //TeeChange

    //player special variables
    dayz_bloodBagHumanity = 300;
    dayz_lastDamageSourceNull = false;
    dayz_lastDamageSource = "none";
    dayz_lastDamageTime = 0;
    dayz_lastMedicalSource = "none";
    dayz_lastMedicalTime = 0;
    dayz_lastClothesChange = 0;
    dayZ_lastPlayerUpdate = 0;
    dayz_lastSelfTransfusion = -(DZE_selfTransfuse_Values select 2);
    dayz_lastTransfusion = 0;
    dayz_playerName = "unknown";
    dayz_hunger = 0;
    dayz_thirst = 0;
    dayz_nutrition = 0;
    dayz_preloadFinished = true;
    dayz_soundMuted = false;
    dayz_statusArray = [1,1];
    dayz_disAudial = 0;
    dayz_disVisual = 0;
    dayz_firedCooldown = 0;
    dayz_damageCounter = time;
    dayz_lastSave = time;
    dayz_isSwimming = true;
    dayz_currentDay = 0;
    dayz_hasLight = false;
    dayz_surfaceNoise = 0;
    dayz_surfaceType = "None";
    dayz_noPenalty = [];
    dayz_heavenCooldown = 0;
    deathHandled = false;
    dayz_firstGroup = group player;
    dayz_originalPlayer = player;
    dayz_sourceBleeding = objNull;
    dayz_clientPreload = false;
    dayz_authed = false;
    dayz_panicCooldown = 0;
    dayz_areaAffect = 3.5;
    dayz_monitorPeriod = 0.6; // number of seconds between each player_zombieCheck calls
    dayz_heartBeat = false;
    dayz_spawnZombies = 0; // Current local
    dayz_swarmSpawnZombies = 0;
    dayz_maxLocalZombies = 15; // max quantity of Z controlled by local gameclient, used by player_spawnCheck. Below this limit we can spawn Z
    dayz_CurrentNearByZombies = 0;
    dayz_maxNearByZombies = 30; // max quantity of Z controlled by local gameclient, used by player_spawnCheck. Below this limit we can spawn Z
    dayz_currentGlobalZombies = 0; // Current total
    if(isNil "dayz_maxGlobalZeds") then {
        dayz_maxGlobalZeds = 1000;
    };
    //Animals
    dayz_currentGlobalAnimals =    0;
    dayz_maxGlobalAnimals =    50;
    //Plants    
    dayz_currentGlobalPlants = 0;
    dayz_maxGlobalPlants = 500;
    //Loot
    r_player_divideinvehicle = 0;
    dayz_currentWeaponHolders = 0;
    dayz_maxMaxWeaponHolders = 80;
    dayz_inVehicle = false;
    dayz_unsaved = false;
    dayz_scaleLight = 0;
    dayzDebug = false;
    dayzState = -1;
    dayz_onBack = "";
    dayz_fishingInprogress = false;
    dayz_siphonFuelInProgress = false;
    dayz_salvageInProgress = false;
    lastSpawned = diag_tickTime;
    lastSepsis = 0;
    NORRN_dropAction = -1;
    //uiNamespace setVariable ['DAYZ_GUI_display',displayNull];
    //if (uiNamespace getVariable ['DZ_displayUI', 0] == 2) then {
    //    dayzDebug = true;
    //};
    dayz_dodge = false;
    Dayz_constructionContext = [];
    Dayz_freefall = [ time, 0, 0.1 ];
    dayz_getout = objNull;
    dayz_getoutTime = 0;
    dayz_HitBy = objNull;
    voice_actions = ["voiceOverNet","PushToTalk","PushToTalkAll","PushToTalkCommand","PushToTalkDirect","PushToTalkGroup","PushToTalkSide","PushToTalkVehicle"];

    // EPOCH ADDITIONS
    if (isNil "DZE_BackpackAntiTheft") then {DZE_BackpackAntiTheft = false;};
    if (isNil "DZE_requireplot") then {DZE_requireplot = 1;};
    if (isNil "DZE_StaticConstructionCount") then {DZE_StaticConstructionCount = 0;};
    if (toLower DZE_DeathMsgChat in ["global","side"]) then {enableRadio true;}; //Needed for scripted global chat to show, doesn't seem to have any adverse effects
    autoRunActive = false;
    DZE_AntiWallCounter = 0;
    DZE_myHaloVehicle = objNull;
    dayz_myLiftVehicle = objNull;
    DZE_Friends = [];
    DZE_Q = false;
    DZE_Z = false;
    DZE_Q_alt = false;
    DZE_Z_alt = false;
    DZE_Q_ctrl = false;
    DZE_Z_ctrl = false;
    DZE_4 = false;
    DZE_5 = false;
    DZE_6 = false;
    DZE_F = false;
    DZE_cancelBuilding = false;
    DZE_TEMP_treedmg = 1;
    DZE_Surrender = false;
    DZE_Quarantine = false;
    DZE_InRadiationZone = false;
    DZE_myVehicle = objNull;
    dayz_groupNameTags = true;
};
 

 

 

:biggrin: do not worry this is the beauty of codes,, you fail and fail a lot of time,, but when you found the fix.. feel like a world champion :laugh:

Link to comment
Share on other sites

  • 0

@Th3-Hunter333  this work for me:

Arm_A2_OA_2016_12_27_23_05_53_35.jpg

//////////////////////////// garage rewrited by Th3-Hunter333//////////////////////////////////
	
	if ((_cursorTarget isKindOf "Garbage_container") && {speed player <= 1}) then {

_hasAccess = [player, _cursorTarget] call FNC_check_access;
_allowed = ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3) or (_hasAccess select 4));

if (s_player_garage < 0 && (_allowed or (_hasAccess select 1))) then {
s_player_garage = player addAction ["<t color='#66CCFF'>Garage Menu</t>", "custom\Garage\player_virtualgarage.sqf", [], 5, false];
};

} else {
        player removeAction s_player_garage;
        s_player_garage = -1;       
    };	
///////////////

 

near of bottom:

} else {
	//Engineering
 
//garage
player removeAction s_player_garage;
s_player_garage = -1;
//
	player removeAction s_player_plot_boundary;
	s_player_plot_boundary = -1;

 

so i think your problem is here:

} else {
            s_player_garage = player addAction ["<t color='#FF0000'>Garage Locked</t>", "",_cursorTarget, 2, true, true, "", ""];   
        };

i dont know why or for what you use it. i think only show Garage locked if is not an alloowed player.. same as remove the option.. right?

 

Link to comment
Share on other sites

  • 0

but if the option is to lock the garage then u can use:

if ((_cursorTarget isKindOf "Garbage_container") && {speed player <= 1}) then {

_hasAccess = [player, _cursorTarget] call FNC_check_access;
_allowed = ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3) or (_hasAccess select 4));

if (s_player_garage < 0 && (_allowed or (_hasAccess select 1))) then {
s_player_garage = player addAction ["<t color='#66CCFF'>Garage Menu</t>", "custom\Garage\player_virtualgarage.sqf", [], 5, false];
};

if (s_player_garagelock < 0 && (_allowed or (_hasAccess select 1))) then {
s_player_garagelock = player addAction ["<t color='#66CCFF'>Lock Garage</t>", "custom\Garage\script to lock.sqf", [], 5, false];
};


} else {
        player removeAction s_player_garage;
        s_player_garagelock = -1;
        player removeAction s_player_garage;
        s_player_garagelock = -1;
    };   

 

Link to comment
Share on other sites

  • 0

Well no im nowhere near an expert script editor myself, i just have a lot of help with a few things that i cant seem to dabble with or well i just cant find such as this

But the addAction garage locked portion was to hopefully lock out whoever is not actually on the garage manage menu (owner of the garage)


Basically it is like plot management, if they are on the menu they can do whatever if not then they are locked out with a garage locked option.

Thank you again, i will keep reporting back here with all my testings and let you know what i come up with 

Link to comment
Share on other sites

  • 0
1 hour ago, juandayz said:

but if the option is to lock the garage then u can use:


if ((_cursorTarget isKindOf "Garbage_container") && {speed player <= 1}) then {

_hasAccess = [player, _cursorTarget] call FNC_check_access;
_allowed = ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3) or (_hasAccess select 4));

if (s_player_garage < 0 && (_allowed or (_hasAccess select 1))) then {
s_player_garage = player addAction ["<t color='#66CCFF'>Garage Menu</t>", "custom\Garage\player_virtualgarage.sqf", [], 5, false];
};

if (s_player_garagelock < 0 && (_allowed or (_hasAccess select 1))) then {
s_player_garagelock = player addAction ["<t color='#66CCFF'>Lock Garage</t>", "custom\Garage\script to lock.sqf", [], 5, false];
};


} else {
        player removeAction s_player_garage;
        s_player_garagelock = -1;
        player removeAction s_player_garage;
        s_player_garagelock = -1;
    };   

 

Ok i did some furthur testing of this and have ran into another issue except for this error in client side rpt logs that is allowing me to access the garage menu but when you try to add yourself to the garage friends will throw this error here below

Error in expression <rage"];
_storedvehicles = VirtualGarage getVariable ["StoredVehicles",[]];
_maxs>
  Error position: <getVariable ["StoredVehicles",[]];
_maxs>
  Error getvariable: Type Array, expected Namespace,Object,Group,Control,Team member,Task,Location
File mpmissions\__CUR_MP.Chernarus\custom\Garage\garage_storedvehicles.sqf, line 3
Error in expression <_nearplayers;

_friends = VirtualGarage getVariable ["GarageFriends",[]];

{
lbA>
  Error position: <getVariable ["GarageFriends",[]];

{
lbA>
  Error getvariable: Type Array, expected Namespace,Object,Group,Control,Team member,Task,Location
File mpmissions\__CUR_MP.Chernarus\custom\Garage\garage_fillplayers.sqf, line 18
Error in expression <select _index;
_friends = VirtualGarage getVariable ["GarageFriends",[]];

_inLi>
  Error position: <getVariable ["GarageFriends",[]];

_inLi>
  Error getvariable: Type Array, expected Namespace,Object,Group,Control,Team member,Task,Location
File mpmissions\__CUR_MP.Chernarus\custom\Garage\garage_addfriend.sqf, line 7
Error in expression <select _index;
_friends = VirtualGarage getVariable ["GarageFriends",[]];

_inLi>
  Error position: <getVariable ["GarageFriends",[]];

_inLi>
  Error getvariable: Type Array, expected Namespace,Object,Group,Control,Team member,Task,Location
File mpmissions\__CUR_MP.Chernarus\custom\Garage\garage_addfriend.sqf, line 7
Error in expression <select _index;
_friends = VirtualGarage getVariable ["GarageFriends",[]];

_inLi>
  Error position: <getVariable ["GarageFriends",[]];

_inLi>
  Error getvariable: Type Array, expected Namespace,Object,Group,Control,Team member,Task,Location
File mpmissions\__CUR_MP.Chernarus\custom\Garage\garage_addfriend.sqf, line 7
Error in expression <select _index;
_friends = VirtualGarage getVariable ["GarageFriends",[]];

_inLi>
  Error position: <getVariable ["GarageFriends",[]];

_inLi>
  Error getvariable: Type Array, expected Namespace,Object,Group,Control,Team member,Task,Location
File mpmissions\__CUR_MP.Chernarus\custom\Garage\garage_addfriend.sqf, line 7
Error in expression <select _index;
_friends = VirtualGarage getVariable ["GarageFriends",[]];

_inLi>
  Error position: <getVariable ["GarageFriends",[]];

_inLi>
  Error getvariable: Type Array, expected Namespace,Object,Group,Control,Team member,Task,Location
File mpmissions\__CUR_MP.Chernarus\custom\Garage\garage_addfriend.sqf, line 7
Error in expression <rage"];
_storedvehicles = VirtualGarage getVariable ["StoredVehicles",[]];
_maxs>
  Error position: <getVariable ["StoredVehicles",[]];
_maxs>
  Error getvariable: Type Array, expected Namespace,Object,Group,Control,Team member,Task,Location
File mpmissions\__CUR_MP.Chernarus\custom\Garage\garage_storedvehicles.sqf, line 3
Error in expression <_nearplayers;

_friends = VirtualGarage getVariable ["GarageFriends",[]];

{
lbA>
  Error position: <getVariable ["GarageFriends",[]];

{
lbA>
  Error getvariable: Type Array, expected Namespace,Object,Group,Control,Team member,Task,Location
File mpmissions\__CUR_MP.Chernarus\custom\Garage\garage_fillplayers.sqf, line 18
Error in expression <select _index;
_friends = VirtualGarage getVariable ["GarageFriends",[]];

_inLi>
  Error position: <getVariable ["GarageFriends",[]];

_inLi>
  Error getvariable: Type Array, expected Namespace,Object,Group,Control,Team member,Task,Location
File mpmissions\__CUR_MP.Chernarus\custom\Garage\garage_addfriend.sqf, line 7
Cannot create non-ai vehicle c_grasstall,
Error in expression <



Now you may have to correct me but i think this issue is pertaining to the edit you have to do to the server_monitor

I will paste the entire server monitor for you here to see but check at around line 201 where it sets the variable for both garagefriends and storedvehicles

private ["_date","_year","_month","_day","_hour","_minute","_date1","_hiveResponse","_key","_objectCount","_dir","_point","_i","_action","_dam","_selection","_wantExplosiveParts","_entity","_worldspace","_damage","_booleans","_rawData","_ObjectID","_class","_CharacterID","_inventory","_hitpoints","_fuel","_id","_objectArray","_script","_result","_outcome"];
[] execVM "\z\addons\dayz_server\system\s_fps.sqf"; //server monitor FPS (writes each ~181s diag_fps+181s diag_fpsmin*)
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"

waitUntil {!isNil "BIS_MPF_InitDone" && initialized};
if (!isNil "sm_done") exitWith {}; // prevent server_monitor be called twice (bug during login of the first player)
sm_done = false;

_legacyStreamingMethod = false; //use old object streaming method, more secure but will be slower and subject to the callExtension return size limitation.

dayz_serverIDMonitor = [];
_DZE_VehObjects = [];
dayz_versionNo = getText (configFile >> "CfgMods" >> "DayZ" >> "version");
dayz_hiveVersionNo = getNumber (configFile >> "CfgMods" >> "DayZ" >> "hiveVersion");
_hiveLoaded = false;
_serverVehicleCounter = [];
_tempMaint = DayZ_WoodenFence + DayZ_WoodenGates;
diag_log "HIVE: Starting";

//Set the Time
_key = "CHILD:307:";
_result = _key call server_hiveReadWrite;
_outcome = _result select 0;
if (_outcome == "PASS") then {
    _date = _result select 1;
    _year = _date select 0;
    _month = _date select 1;
    _day = _date select 2;
    _hour = _date select 3;
    _minute = _date select 4;

    if (dayz_ForcefullmoonNights) then {_date = [2012,8,2,_hour,_minute];};
    diag_log ["TIME SYNC: Local Time set to:", _date, "Fullmoon:",dayz_ForcefullmoonNights,"Date given by HiveExt.dll:",_result select 1];
    setDate _date;
    dayzSetDate = _date;
    publicVariable "dayzSetDate";
};

//Stream in objects
/* STREAM OBJECTS */
//Send the key
_timeStart = diag_tickTime;
_key = format["CHILD:302:%1:%2:",dayZ_instance, _legacyStreamingMethod];
_result = _key call server_hiveReadWrite;

diag_log "HIVE: Request sent";
_myArray = [];
_val = 0;
_status = _result select 0; //Process result
_val = _result select 1;
if (_legacyStreamingMethod) then {
    if (_status == "ObjectStreamStart") then {
        _hiveLoaded = true;
        //Stream Objects
        diag_log ("HIVE: Commence Object Streaming...");
        for "_i" from 1 to _val do  {
            _result = _key call server_hiveReadWriteLarge;
            _status = _result select 0;
            _myArray set [count _myArray,_result];
        };
    };
} else {
    if (_val > 0) then {
        _fileName = _key call server_hiveReadWrite;
        _lastFN = profileNamespace getVariable["lastFN",""];
        profileNamespace setVariable["lastFN",_fileName];
        saveProfileNamespace;
        if (_status == "ObjectStreamStart") then {
            _hiveLoaded = true;
            _myArray = Call Compile PreProcessFile _fileName;
            _key = format["CHILD:302:%1:%2:",_lastFN, _legacyStreamingMethod];
            _result = _key call server_hiveReadWrite; //deletes previous object data dump
        };
    } else {
        if (_status == "ObjectStreamStart") then {
            _hiveLoaded = true;
        };
    };
};

diag_log ("HIVE: Streamed " + str(_val) + " objects");

{
    private ["_object","_posATL"];
    //Parse Array
    _action =         _x select 0; 
    _idKey =         _x select 1;
    _type =            _x select 2;
    _ownerID =         _x select 3;
    _worldspace =     _x select 4;
    _inventory =    _x select 5;
    _hitPoints =    _x select 6;
    _fuel =            _x select 7;
    _damage =         _x select 8;
    _storageMoney = _x select 9;

    //set object to be in maintenance mode
    _maintenanceMode = false;
    _maintenanceModeVars = [];
    
    _dir = 90;
    _pos = [0,0,0];
    _wsDone = false;
    _wsCount = count _worldspace;

    //Vector building
    _vector = [[0,0,0],[0,0,0]];
    _vecExists = false;
    _ownerPUID = "0";

    if (_wsCount >= 2) then {
        _dir = _worldspace select 0;
        _posATL = _worldspace select 1;
        if (count _posATL == 3) then {
            _pos = _posATL;
            _wsDone = true;                    
        };
        if (_wsCount >= 3) then{
            _ws2TN = typename (_worldspace select 2);
            _ws3TN = typename (_worldspace select 3);
            if (_wsCount == 3) then{
                    if (_ws2TN == "STRING") then{
                        _ownerPUID = _worldspace select 2;
                    } else {
                         if (_ws2TN == "ARRAY") then{
                            _vector = _worldspace select 2;
                            _vecExists = true;
                        };                  
                    };
            } else {
                if (_wsCount == 4) then{
                    if (_ws3TN == "STRING") then{
                        _ownerPUID = _worldspace select 3;
                    } else {
                        if (_ws2TN == "STRING") then{
                            _ownerPUID = _worldspace select 2;
                        };
                    };
                    if (_ws2TN == "ARRAY") then{
                        _vector = _worldspace select 2;
                        _vecExists = true;
                    } else {
                        if (_ws3TN == "ARRAY") then{
                            _vector = _worldspace select 3;
                            _vecExists = true;
                        };
                    };
                };
            };
        } else {
            _worldspace set [count _worldspace, "0"];
        };
    };

    if (!_wsDone) then {
        if ((count _posATL) >= 2) then {
            _pos = [_posATL select 0,_posATL select 1,0];
            diag_log format["MOVED OBJ: %1 of class %2 with worldspace array = %3 to pos: %4",_idKey,_type,_worldspace,_pos];
        } else {
            diag_log format["MOVED OBJ: %1 of class %2 with worldspace array = %3 to pos: [0,0,0]",_idKey,_type,_worldspace];
        };
    };

    //diag_log format["OBJ: %1 - %2,%3,%4,%5,%6,%7,%8", _idKey,_type,_ownerID,_worldspace,_inventory,_hitPoints,_fuel,_damage];
    /*
        if (_type in _tempMaint) then {
            //Use hitpoints for Maintenance system and other systems later.
            //Enable model swap for a damaged model.
            if ("Maintenance" in _hitPoints) then {
                _maintenanceModeVars = [_type,_pos];
                _type = _type + "_Damaged";
            };    
            //TODO add remove object and readd old fence (hideobject would be nice to use here :-( )
            //Pending change to new fence models\Layout
        };
    */
        _nonCollide = _type in DayZ_nonCollide;    
        //Create it
        if (_nonCollide) then {
            _object = createVehicle [_type, [0,0,0], [], 0, "NONE"];
        } else {
            _object = _type createVehicle [0,0,0]; //more than 2x faster than createvehicle array
        };
        _object setDir _dir;
        _object setPosATL _pos;
        _object setDamage _damage;
        if (_vecExists) then {
            _object setVectorDirAndUp _vector;
        };
        _object enableSimulation false;

        _doorLocked = _type in DZE_DoorsLocked;
        _isPlot = _type == "Plastic_Pole_EP1_DZ";
        
        // prevent immediate hive write when vehicle parts are set up
        _object setVariable ["lastUpdate",diag_ticktime];
        _object setVariable ["ObjectID", _idKey, true];
        _object setVariable ["OwnerPUID", _ownerPUID, true];
        
        // garage
        if ((typeOf _object) in DZE_Garage) then {
            _object setVariable ["StoredVehicles",_inventory,true];
            _object setVariable ["GarageFriends",_hitPoints,true];
        };
        
        if (Z_SingleCurrency && {_type in DZE_MoneyStorageClasses}) then {
            _object setVariable [Z_MoneyVariable, _storageMoney, true];
        };
        
        dayz_serverIDMonitor set [count dayz_serverIDMonitor,_idKey];
        
        if (!_wsDone) then {[_object,"position",true] call server_updateObject;};
        if (_type == "Base_Fire_DZ") then {_object spawn base_fireMonitor;};
        
        _isDZ_Buildable = _object isKindOf "DZ_buildables";
        _isTrapItem = _object isKindOf "TrapItems";
        _isSafeObject = _type in DayZ_SafeObjects;
        
        //Dont add inventory for traps.
        if (!_isDZ_Buildable && !_isTrapItem) then {
            clearWeaponCargoGlobal _object;
            clearMagazineCargoGlobal _object;
            clearBackpackCargoGlobal _object;
            if( (count _inventory > 0) && !_isPlot && !_doorLocked && !((typeOf _object) in DZE_Garage)) then {
                if (_type in DZE_LockedStorage) then {
                    // Do not send big arrays over network! Only server needs these
                    _object setVariable ["WeaponCargo",(_inventory select 0),false];
                    _object setVariable ["MagazineCargo",(_inventory select 1),false];
                    _object setVariable ["BackpackCargo",(_inventory select 2),false];
                } else {
                    _weaponcargo = _inventory select 0 select 0;
                    _magcargo = _inventory select 1 select 0;
                    _backpackcargo = _inventory select 2 select 0;
                   _weaponqty = _inventory select 0 select 1;
                    {_object addWeaponCargoGlobal [_x, _weaponqty select _foreachindex];} foreach _weaponcargo;

                    _magqty = _inventory select 1 select 1;
                    {_object addMagazineCargoGlobal [_x, _magqty select _foreachindex];} foreach _magcargo;

                    _backpackqty = _inventory select 2 select 1;
                    {_object addBackpackCargoGlobal [_x, _backpackqty select _foreachindex];} foreach _backpackcargo;
                };
            } else {
                if (DZE_permanentPlot && _isPlot) then {
                    _object setVariable ["plotfriends", _inventory, true];
                };
                if (DZE_doorManagement && _doorLocked) then {
                    _object setVariable ["doorfriends", _inventory, true];
                };
            };
        };
        
        if (_object isKindOf "AllVehicles") then {
            _object setVariable ["CharacterID", _ownerID, true];
            _isAir = _object isKindOf "Air";
            {
                _selection = _x select 0;
                _dam = if (!_isAir && {_selection in dayZ_explosiveParts}) then {(_x select 1) min 0.8;} else {_x select 1;};
                _strH = "hit_" + (_selection);
                _object setHit[_selection,_dam];
                _object setVariable [_strH,_dam,true];
            } foreach _hitpoints;
            [_object,"damage"] call server_updateObject;

            _object setFuel _fuel;
            if (!_isSafeObject) then {
                _DZE_VehObjects set [count _DZE_VehObjects,_object]; 
                _object call fnc_veh_ResetEH;
                if (_ownerID != "0" && {!(_object isKindOf "Bicycle")}) then {_object setVehicleLock "locked";};
                _serverVehicleCounter set [count _serverVehicleCounter,_type]; // total each vehicle
            } else {
                _object enableSimulation true;
            };
        } else {
            // Fix for leading zero issues on safe codes after restart
            _lockable = getNumber (configFile >> "CfgVehicles" >> _type >> "lockable");
            _codeCount = count (toArray _ownerID);
            switch (_lockable) do {
                case 4: {
                    switch (_codeCount) do {
                        case 3: {_ownerID = format["0%1",_ownerID];};
                        case 2: {_ownerID = format["00%1",_ownerID];};
                        case 1: {_ownerID = format["000%1",_ownerID];};
                    };
                };
                case 3: {
                    switch (_codeCount) do {
                        case 2: {_ownerID = format["0%1",_ownerID];};
                        case 1: {_ownerID = format["00%1",_ownerID];};
                    };
                };
            };
            _object setVariable ["CharacterID", _ownerID, true];
            if (_isDZ_Buildable || {(_isSafeObject && !_isTrapItem)}) then {
                _object setVariable["memDir",_dir,true];
                if (DZE_GodModeBase && {!(_type in DZE_GodModeBaseExclude)}) then {
                    _object addEventHandler ["HandleDamage",{false}];
                } else {
                    _object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];
                };
                _object setVariable ["OEMPos",_pos,true]; // used for inplace upgrades and lock/unlock of safe
            } else {
                _object enableSimulation true;
            };
            if (_isDZ_Buildable || {_isTrapItem}) then {
                //Use inventory for owner/clan info and traps armed state
                {
                    _xTypeName = typeName _x;
                    switch (_xTypeName) do {
                        case "ARRAY": {
                            _x1 = _x select 1;
                            switch (_x select 0) do {
                                case "ownerArray" : { _object setVariable ["ownerArray", _x1, true]; };
                                case "clanArray" : { _object setVariable ["clanArray", _x1, true]; };
                                case "armed" : { _object setVariable ["armed", _x1, true]; };
                                case "padlockCombination" : { _object setVariable ["dayz_padlockCombination", _x1, false]; };
                                case "BuildLock" : { _object setVariable ["BuildLock", _x1, true]; };
                            };
                        };
                        case "STRING": {_object setVariable ["ownerArray", [_x], true]; };
                        case "BOOLEAN": {_object setVariable ["armed", _x, true]};
                    };
                } foreach _inventory;
                
                if (_maintenanceMode) then { _object setVariable ["Maintenance", true, true]; _object setVariable ["MaintenanceVars", _maintenanceModeVars]; };
            };
        };
        dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object]; //Monitor the object
} forEach _myArray;

//enable simulation on vehicles after all buildables are spawned
{
    _x enableSimulation true;
    _x setVelocity [0,0,1];
} forEach _DZE_VehObjects;

diag_log format["HIVE: BENCHMARK - Server_monitor.sqf finished streaming %1 objects in %2 seconds (unscheduled)",_val,diag_tickTime - _timeStart];

// # END OF STREAMING #

call server_plantSpawner; // Draw the pseudo random seeds
[] execFSM "\z\addons\dayz_server\system\server_vehicleSync.fsm"; 
[] execVM "\z\addons\dayz_server\system\scheduler\sched_init.sqf"; // launch the new task scheduler

createCenter civilian;

actualSpawnMarkerCount = 0;
// count valid spawn markers, since different maps have different amounts
for "_i" from 0 to 10 do {
    if ((getMarkerPos format["spawn%1",_i]) distance [0,0,0] > 0) then {
        actualSpawnMarkerCount = actualSpawnMarkerCount + 1;
    } else {
        _i = 11; // exit since we did not find any further markers 
    };
};
diag_log format["Total Number of spawn locations %1", actualSpawnMarkerCount];

if (isDedicated) then {endLoadingScreen;};
[] ExecVM "\z\addons\dayz_server\WAI\init.sqf";
allowConnection = true;
sm_done = true;
publicVariable "sm_done";

// Trap loop
[] spawn {
    private ["_array","_array2","_array3","_script","_armed"];
    _array = str dayz_traps;
    _array2 = str dayz_traps_active;
    _array3 = str dayz_traps_trigger;

    while {1 == 1} do {
        if ((str dayz_traps != _array) || (str dayz_traps_active != _array2) || (str dayz_traps_trigger != _array3)) then {
            _array = str dayz_traps;
            _array2 = str dayz_traps_active;
            _array3 = str dayz_traps_trigger;
            //diag_log "DEBUG: traps";
            //diag_log format["dayz_traps (%2) -> %1", dayz_traps, count dayz_traps];
            //diag_log format["dayz_traps_active (%2) -> %1", dayz_traps_active, count dayz_traps_active];
            //diag_log format["dayz_traps_trigger (%2) -> %1", dayz_traps_trigger, count dayz_traps_trigger];
            //diag_log "DEBUG: end traps";
        };

        {
            if (isNull _x) then {
                dayz_traps = dayz_traps - [_x];
                _armed = false;
                _script = {};
            } else {
                _armed = _x getVariable ["armed", false];
                _script = call compile getText (configFile >> "CfgVehicles" >> typeOf _x >> "script");
            };
            
            if (_armed) then {
                if !(_x in dayz_traps_active) then {["arm", _x] call _script;};
            } else {
                if (_x in dayz_traps_active) then {["disarm", _x] call _script;};
            };
            uiSleep 0.01;
        } forEach dayz_traps;
        uiSleep 1;
    };
};

//Points of interest
[] execVM "\z\addons\dayz_server\compile\server_spawnInfectedCamps.sqf";
[] execVM "\z\addons\dayz_server\compile\server_spawnCarePackages.sqf";
[] execVM "\z\addons\dayz_server\compile\server_spawnCrashSites.sqf";

if (dayz_townGenerator) then {execVM "\z\addons\dayz_server\system\lit_fireplaces.sqf";};

"PVDZ_sec_atp" addPublicVariableEventHandler {
    _x = _this select 1;
    switch (1==1) do {
        case (typeName (_x select 0) == "SCALAR") : { // just some logs from the client
            diag_log (toString _x);
        };
        case (count _x == 2) : { // wrong side
            diag_log format["P1ayer %1 reports possible 'side' hack. Server may be compromised!",(_x select 1) call fa_plr2Str];
        };
        default { // player hit
            _unit = _x select 0;
            _source = _x select 1;
            if (((!(isNil {_source})) && {!(isNull _source)}) && {((_source isKindOf "CAManBase") && {owner _unit != owner _source})}) then {
                diag_log format ["P1ayer %1 hit by %2 %3 from %4 meters",
                    _unit call fa_plr2Str, _source call fa_plr2Str, toString (_x select 2), _x select 3];
                if (_unit getVariable ["processedDeath",0] == 0) then {
                    _unit setVariable ["attacker", name _source];
                    _unit setVariable ["noatlf4", diag_ticktime]; // server-side "not in combat" test, if player is not already dead
                };
            };
        };
    };
};

// preload server traders menu data into cache
if !(DZE_ConfigTrader) then {
    {
        // get tids
        _traderData = call compile format["menu_%1;",_x];
        if (!isNil "_traderData") then {
            {
                _traderid = _x select 1;
                _retrader = [];

                _key = format["CHILD:399:%1:",_traderid];
                _data = "HiveEXT" callExtension _key;
                _result = call compile format["%1",_data];
                _status = _result select 0;
        
                if (_status == "ObjectStreamStart") then {
                    _val = _result select 1;
                    call compile format["ServerTcache_%1 = [];",_traderid];
                    for "_i" from 1 to _val do {
                        _data = "HiveEXT" callExtension _key;
                        _result = call compile format ["%1",_data];
                        call compile format["ServerTcache_%1 set [count ServerTcache_%1,%2]",_traderid,_result];
                        _retrader set [count _retrader,_result];
                    };
                };
            } forEach (_traderData select 0);
        };
    } forEach serverTraders;
};

if (_hiveLoaded) then {
    _serverVehicleCounter spawn {
        //  spawn_vehicles
        // Get all buildings and roads only once. Very taxing, but only on first startup
        _serverVehicleCounter = _this;
        _vehiclesToUpdate = [];
        _startTime = diag_tickTime;
        _buildingList = [];
        _cfgLootFile = missionConfigFile >> "CfgLoot" >> "Buildings";
        {
            if (isClass (_cfgLootFile >> typeOf _x)) then {
                _buildingList set [count _buildingList,_x];
            };
        } count (getMarkerPos "center" nearObjects ["building",((getMarkerSize "center") select 1)]);
        _roadList = getMarkerPos "center" nearRoads ((getMarkerSize "center") select 1);
        
        _vehLimit = MaxVehicleLimit - (count _serverVehicleCounter);
        if (_vehLimit > 0) then {
            diag_log ("HIVE: Spawning # of Vehicles: " + str(_vehLimit));
            for "_x" from 1 to _vehLimit do {call spawn_vehicles;};
        } else {
            diag_log "HIVE: Vehicle Spawn limit reached!";
            _vehLimit = 0;
        };
        
        if (dayz_townGenerator) then {
            // Vanilla town generator spawns debris locally on each client
            MaxDynamicDebris = 0;
        } else {
            // Epoch global dynamic debris
            diag_log ("HIVE: Spawning # of Debris: " + str(MaxDynamicDebris));
            for "_x" from 1 to MaxDynamicDebris do {call spawn_roadblocks;};
        };

        diag_log ("HIVE: Spawning # of Ammo Boxes: " + str(MaxAmmoBoxes));
        for "_x" from 1 to MaxAmmoBoxes do {call spawn_ammosupply;};

        diag_log ("HIVE: Spawning # of Veins: " + str(MaxMineVeins));
        for "_x" from 1 to MaxMineVeins do {call spawn_mineveins;};
        
        diag_log format["HIVE: BENCHMARK - Server finished spawning %1 DynamicVehicles, %2 Debris, %3 SupplyCrates and %4 MineVeins in %5 seconds (scheduled)",_vehLimit,MaxDynamicDebris,MaxAmmoBoxes,MaxMineVeins,diag_tickTime - _startTime];
        
        //Update gear last after all dynamic vehicles are created to save random loot to database (low priority)
        {[_x,"gear"] call server_updateObject} count _vehiclesToUpdate;
    };
    [] ExecVM "\z\addons\dayz_server\WAI\init.sqf";
};

[] spawn server_spawnEvents;
/* //Causes issues with changing clothes
_debugMarkerPosition = getMarkerPos "respawn_west";
_debugMarkerPosition = [(_debugMarkerPosition select 0),(_debugMarkerPosition select 1),1];
_vehicle_0 = createVehicle ["DebugBox_DZ", _debugMarkerPosition, [], 0, "CAN_COLLIDE"];
_vehicle_0 setPos _debugMarkerPosition;
_vehicle_0 setVariable ["ObjectID","1",true];
*/
 

 

Im sure there is nothing wrong with the call to DZE_Garage = ["Garbage_container"]; which is defined at the very top of my variables.sqf

disableSerialization;

// garage
DZE_Garage = ["Garbage_container"];

//Model Variables
Bandit1_DZ = "Bandit1_DZ";
BanditW1_DZ = "BanditW1_DZ";
Survivor1_DZ = "Survivor1_DZ";
Survivor2_DZ = "Survivor2_DZ";
SurvivorW2_DZ = "SurvivorW2_DZ";
Sniper1_DZ = "Sniper1_DZ";
Camo1_DZ = "Camo1_DZ";
Soldier1_DZ = "Soldier1_DZ";
Rocket_DZ = "Rocket_DZ";
// EPOCH ADDITIONS
Bandit2_DZ = "Bandit2_DZ";
BanditW2_DZ = "BanditW2_DZ";
SurvivorW3_DZ = "SurvivorW2_DZ";

 

 

Link to comment
Share on other sites

  • 0
34 minutes ago, Th3-Hunter333 said:

Well no im nowhere near an expert script editor myself, i just have a lot of help with a few things that i cant seem to dabble with or well i just cant find such as this

But the addAction garage locked portion was to hopefully lock out whoever is not actually on the garage manage menu (owner of the garage)


Basically it is like plot management, if they are on the menu they can do whatever if not then they are locked out with a garage locked option.

Thank you again, i will keep reporting back here with all my testings and let you know what i come up with 

 

In your fn_selfActions, try this instead:

 

private ["_garageowner","_garagefriends","_garageallowed","_friend"];
_garageowner = _cursorTarget getVariable ["ownerPUID","0"];
_friend = _cursorTarget getVariable ["GarageFriends",[]];
_garagefriends = [];
{
	_garagefriends set [count _garagefriends,(_x select 0)];
} count _friend;
_garageallowed = [_owner] + _garagefriends;
if ((_typeOfCursorTarget in DZE_Garage) && (speed player <= 1)) then {
	if (s_player_garage < 0) then {
		if ((getPlayerUID player) in _garageallowed) then {
			s_player_garage =  player addAction ["<t color='#FFAA00'>Garage Menu</t>", "custom\Garage\player_virtualgarage.sqf", _cursorTarget, 2, false];
		} else {
			s_player_garage = player addAction ["<t color='#FF0000'>Garage Locked</t>", "",_cursorTarget, 2, true, true, "", ""];	
		};
	};
} else {
	player removeAction s_player_garage;
	s_player_garage = -1;		
};

 

And then remove the fn_check_access as it seems completely inefficient to copy over the whole file for a couple lines.

Link to comment
Share on other sites

  • 0
7 minutes ago, BigEgg said:

In your fn_selfActions, try this instead:

 


private ["_garageowner","_garagefriends","_garageallowed","_friend"];
_garageowner = _cursorTarget getVariable ["ownerPUID","0"];
_friend = _cursorTarget getVariable ["GarageFriends",[]];
_garagefriends = [];
{
	_garagefriends set [count _garagefriends,(_x select 0)];
} count _friend;
_garageallowed = [_owner] + _garagefriends;
if ((_typeOfCursorTarget in DZE_Garage) && (speed player <= 1)) then {
	if (s_player_garage < 0) then {
		if ((getPlayerUID player) in _garageallowed) then {
			s_player_garage =  player addAction ["<t color='#FFAA00'>Garage Menu</t>", "custom\Garage\player_virtualgarage.sqf", _cursorTarget, 2, false];
		} else {
			s_player_garage = player addAction ["<t color='#FF0000'>Garage Locked</t>", "",_cursorTarget, 2, true, true, "", ""];	
		};
	};
} else {
	player removeAction s_player_garage;
	s_player_garage = -1;		
};

 

And then remove the fn_check_access as it seems completely inefficient to copy over the whole file for a couple lines.

Thank you for the reply, it is erroring out with an undefined variable here

Error in expression <0)];
} count _friend;
_garageallowed = [_owner] + _garagefriends;
if ((_typeOfCu>
  Error position: <_owner] + _garagefriends;
if ((_typeOfCu>
  Error Undefined variable in expression: _owner
File mpmissions\__CUR_MP.Chernarus\custom\fn_selfActions.sqf, line 630
Error in expression <0)];
} count _friend;
_garageallowed = [_owner] + _garagefriends;
if ((_typeOfCu>
  Error position: <_owner] + _garagefriends;
if ((_typeOfCu>
  Error Undefined variable in expression: _owner
File mpmissions\__CUR_MP.Chernarus\custom\fn_selfActions.sqf, line 630
Error in expression <0)];
} count _friend;
_garageallowed = [_owner] + _garagefriends;
if ((_typeOfCu>
  Error position: <_owner] + _garagefriends;
if ((_typeOfCu>
  Error Undefined variable in expression: _owner

 

[spoiler/]

Link to comment
Share on other sites

  • 0
Just now, Th3-Hunter333 said:

Thank you for the reply, it is erroring out with an undefined variable here

  Hide contents

 

Error in expression <0)];
} count _friend;
_garageallowed = [_owner] + _garagefriends;
if ((_typeOfCu>
  Error position: <_owner] + _garagefriends;
if ((_typeOfCu>
  Error Undefined variable in expression: _owner
File mpmissions\__CUR_MP.Chernarus\custom\fn_selfActions.sqf, line 630
Error in expression <0)];
} count _friend;
_garageallowed = [_owner] + _garagefriends;
if ((_typeOfCu>
  Error position: <_owner] + _garagefriends;
if ((_typeOfCu>
  Error Undefined variable in expression: _owner
File mpmissions\__CUR_MP.Chernarus\custom\fn_selfActions.sqf, line 630
Error in expression <0)];
} count _friend;
_garageallowed = [_owner] + _garagefriends;
if ((_typeOfCu>
  Error position: <_owner] + _garagefriends;
if ((_typeOfCu>
  Error Undefined variable in expression: _owner

 

[spoiler/]

 
 

Whoops - my bad.

 

Use this:

private ["_garageowner","_garagefriends","_garageallowed","_friend"];
_garageowner = _cursorTarget getVariable ["ownerPUID","0"];
_friend = _cursorTarget getVariable ["GarageFriends",[]];
_garagefriends = [];
{
	_garagefriends set [count _garagefriends,(_x select 0)];
} count _friend;
_garageallowed = [_garageowner] + _garagefriends;
if ((_typeOfCursorTarget in DZE_Garage) && (speed player <= 1)) then {
	if (s_player_garage < 0) then {
		if ((getPlayerUID player) in _garageallowed) then {
			s_player_garage =  player addAction ["<t color='#FFAA00'>Garage Menu</t>", "custom\Garage\player_virtualgarage.sqf", _cursorTarget, 2, false];
		} else {
			s_player_garage = player addAction ["<t color='#FF0000'>Garage Locked</t>", "",_cursorTarget, 2, true, true, "", ""];	
		};
	};
} else {
	player removeAction s_player_garage;
	s_player_garage = -1;		
};

 

Link to comment
Share on other sites

  • 0
7 minutes ago, BigEgg said:

Whoops - my bad.

 

Use this:


private ["_garageowner","_garagefriends","_garageallowed","_friend"];
_garageowner = _cursorTarget getVariable ["ownerPUID","0"];
_friend = _cursorTarget getVariable ["GarageFriends",[]];
_garagefriends = [];
{
	_garagefriends set [count _garagefriends,(_x select 0)];
} count _friend;
_garageallowed = [_garageowner] + _garagefriends;
if ((_typeOfCursorTarget in DZE_Garage) && (speed player <= 1)) then {
	if (s_player_garage < 0) then {
		if ((getPlayerUID player) in _garageallowed) then {
			s_player_garage =  player addAction ["<t color='#FFAA00'>Garage Menu</t>", "custom\Garage\player_virtualgarage.sqf", _cursorTarget, 2, false];
		} else {
			s_player_garage = player addAction ["<t color='#FF0000'>Garage Locked</t>", "",_cursorTarget, 2, true, true, "", ""];	
		};
	};
} else {
	player removeAction s_player_garage;
	s_player_garage = -1;		
};

 

That did fix the error but now if is only poping up garage locked (not spamming it like the previous issue)

Just immediately garage locked right after building the garbage container (what i use for the actual garage)

Link to comment
Share on other sites

  • 0
Just now, Th3-Hunter333 said:

That did fix the error but now if is only poping up garage locked (not spamming it like the previous issue)

Just immediately garage locked right after building the garbage container (what i use for the actual garage)

 

What are you using to build the garbage container? Is this option now enabled in 1.0.6 or are you using an addon to build it?

Link to comment
Share on other sites

  • 0

Deployables script, here check this out and you will see how it is deployed just below dze deployables config 

//  **FORMAT** -- (note no comma after last array entry)
//
//  DZE_DEPLOYABLES_CONFIG = [
//      [_clickItem,_deployOffset,_packDistance,_damageLimit,_packAny,_cargo,_ammo,_hive,_plot,_simulation,_road,_deployables,_near,_parts,_condition],
//      [_clickItem,_deployOffset,_packDistance,_damageLimit,_packAny,_cargo,_ammo,_hive,_plot,_simulation,_road,_deployables,_near,_parts,_condition],
//      [...more stuff here...]
//  ];
//    
//  parameter    | description                                                         |  type  | example
// --------------|---------------------------------------------------------------------|--------|--------
// _clickItem    | class name of the item to click on                                  | string | "ItemToolbox"
// _deployOffset | [_side,_front,_up] array to offset the deployable when buiding      | array  | [0,2,1]
// _packDistance | how close does the packer need to be to pack the object?            | number | 5
// _damageLimit  | item can't be repacked if damage is > this. (-1 = no re-packing)    | number | 0.1
// _packAny      | can anyone repack the deployable?                                   | bool   | false
// _cargo        | clear the cargo of the deployable?                                  | bool   | false
// _ammo         | should vehicle ammo be cleared? (does not persist through restart)  | bool   | true
// _hive         | write deployable to database?                                       | bool   | false
// _plot         | require a plot from the owner to build the deployable?              | bool   | false
// _simulation   | enable simulation (movement/damage) for the object? (true for cars) | bool   | true
// _road         | enable road building for this object?                               | bool   | true
// _deployables  | array of class names that can be deployed with this method          | array  | ["MMT_Civ"]
// _near         | array of items required nearby to build (workshop/fire/fueltank)    | array  | []
// _parts        | array of parts required to build (will be taken from player)        | array  | ["ItemToolbox"]
// _condition    | string of code to evaluate to determine whether action is shown     | string | "!(isNull player) && {(getPlayerUID player) in DZE_DEPLOYABLE_ADMINS}"

DZE_DEPLOYABLES_CONFIG = [
    // deploy a non-permanent bike from a toolbox right in front of the player that can be re-packed by the owner as long as it's under 10% damage
    ["ItemToolbox",[0,7,1],5,0.9,false,false,true,false,false,true,true,["Old_bike_TK_INS_EP1"],[],["ItemToolbox"],"true"],
    ["ItemToolbox",[0,5,2],7,0.1,false,true,false,false,false,true,true,["CSJ_GyroC"],[],["PartVRotor","PartEngine","PartFueltank"],"true"],
    ["ItemToolbox",[0,10,0],5,-1,false,true,false,true,true,false,false,["Land_Mil_Guardhouse"],[],["cinder_wall_kit","cinder_wall_kit","cinder_wall_kit","cinder_door_kit"],"false"],
    ["ItemToolbox",[0,10,0],5,-1,false,true,false,true,true,false,false,["Land_Mil_Guardhouse"],[],["cinder_wall_kit","cinder_wall_kit","cinder_wall_kit","cinder_door_kit"],"false"],
    
    ["ItemToolbox",                     // class name of the item to click on   
    [0,4,1],                        // [_side,_front,_up] array to offset the deployable when buiding  
    5,                              // how close does the packer need to be to pack the object? 
    -1,                             // item can't be repacked if damage is > this. (-1 = no re-packing) 
    false,                          // can anyone repack the deployable?
    true,                             // clear the cargo of the deployable?   
    false,                             // should vehicle ammo be cleared?
    true,                              // write deployable to database?
    true,                            // require a plot from the owner to build the deployable?  
    false,                          // enable simulation (movement/damage) for the object? (true for cars)
    false,                          // enable road building for this object?
    ["Garbage_container"],     // array of class names that can be deployed with this method
    [],                                // array of items required nearby to build
    ["ItemBriefcase100oz","ItemBriefcase100oz","ItemBriefcase100oz","ItemBriefcase100oz","ItemBriefcase100oz","ItemBriefcase100oz","ItemBriefcase100oz","ItemBriefcase100oz","ItemBriefcase100oz"],
    "true"],
    
    ["ItemToolbox",                    // class name of the item to click on   
    [0,10,0],                       // [_side,_front,_up] array to offset the deployable when buiding  
    5,                              // how close does the packer need to be to pack the object? 
    -1,                             // item can't be repacked if damage is > this. (-1 = no re-packing) 
    false,                          // can anyone repack the deployable?
    true,                           // clear the cargo of the deployable?   
    false,                          // should vehicle ammo be cleared?
    true,                           // write deployable to database?
    true,                           // require a plot from the owner to build the deployable?  
    false,                          // enable simulation (movement/damage) for the object? (true for cars)
    false,                          // enable road building for this object?
    ["PARACHUTE_TARGET"],           // array of class names that can be deployed with this method
    [],                             // array of items required nearby to build
    ["ItemBriefcase100oz"],         // array of parts required to build
    "true"]
];

// **DZE_DEPLOYABLE_NAME_MAP format
//  
//  DZE_DEPLOYABLE_NAME_MAP = [
//      [_class,_name],
//      [_class,_name],
//      [... more ...]
//  ];
//
//  parameter    | description                                                         |  type  | example
// --------------|---------------------------------------------------------------------|--------|--------
// _class        | class name of the item you want to replace the name of              | string | "Notebook"
// _name         | new name to display when right clicking                             | string | "Macbook Pro"
//
DZE_DEPLOYABLE_NAME_MAP = [
    ["Notebook","Macbook Pro"]
];

DZE_DEPLOYABLE_ADMINS = [];
 

[spoiler/]


 

Link to comment
Share on other sites

  • 0
10 minutes ago, Th3-Hunter333 said:

Deployables script, here check this out and you will see how it is deployed just below dze deployables config 
 

  Reveal hidden contents

 

//  **FORMAT** -- (note no comma after last array entry)
//
//  DZE_DEPLOYABLES_CONFIG = [
//      [_clickItem,_deployOffset,_packDistance,_damageLimit,_packAny,_cargo,_ammo,_hive,_plot,_simulation,_road,_deployables,_near,_parts,_condition],
//      [_clickItem,_deployOffset,_packDistance,_damageLimit,_packAny,_cargo,_ammo,_hive,_plot,_simulation,_road,_deployables,_near,_parts,_condition],
//      [...more stuff here...]
//  ];
//    
//  parameter    | description                                                         |  type  | example
// --------------|---------------------------------------------------------------------|--------|--------
// _clickItem    | class name of the item to click on                                  | string | "ItemToolbox"
// _deployOffset | [_side,_front,_up] array to offset the deployable when buiding      | array  | [0,2,1]
// _packDistance | how close does the packer need to be to pack the object?            | number | 5
// _damageLimit  | item can't be repacked if damage is > this. (-1 = no re-packing)    | number | 0.1
// _packAny      | can anyone repack the deployable?                                   | bool   | false
// _cargo        | clear the cargo of the deployable?                                  | bool   | false
// _ammo         | should vehicle ammo be cleared? (does not persist through restart)  | bool   | true
// _hive         | write deployable to database?                                       | bool   | false
// _plot         | require a plot from the owner to build the deployable?              | bool   | false
// _simulation   | enable simulation (movement/damage) for the object? (true for cars) | bool   | true
// _road         | enable road building for this object?                               | bool   | true
// _deployables  | array of class names that can be deployed with this method          | array  | ["MMT_Civ"]
// _near         | array of items required nearby to build (workshop/fire/fueltank)    | array  | []
// _parts        | array of parts required to build (will be taken from player)        | array  | ["ItemToolbox"]
// _condition    | string of code to evaluate to determine whether action is shown     | string | "!(isNull player) && {(getPlayerUID player) in DZE_DEPLOYABLE_ADMINS}"

DZE_DEPLOYABLES_CONFIG = [
    // deploy a non-permanent bike from a toolbox right in front of the player that can be re-packed by the owner as long as it's under 10% damage
    ["ItemToolbox",[0,7,1],5,0.9,false,false,true,false,false,true,true,["Old_bike_TK_INS_EP1"],[],["ItemToolbox"],"true"],
    ["ItemToolbox",[0,5,2],7,0.1,false,true,false,false,false,true,true,["CSJ_GyroC"],[],["PartVRotor","PartEngine","PartFueltank"],"true"],
    ["ItemToolbox",[0,10,0],5,-1,false,true,false,true,true,false,false,["Land_Mil_Guardhouse"],[],["cinder_wall_kit","cinder_wall_kit","cinder_wall_kit","cinder_door_kit"],"false"],
    ["ItemToolbox",[0,10,0],5,-1,false,true,false,true,true,false,false,["Land_Mil_Guardhouse"],[],["cinder_wall_kit","cinder_wall_kit","cinder_wall_kit","cinder_door_kit"],"false"],
    
    ["ItemToolbox",                     // class name of the item to click on   
    [0,4,1],                        // [_side,_front,_up] array to offset the deployable when buiding  
    5,                              // how close does the packer need to be to pack the object? 
    -1,                             // item can't be repacked if damage is > this. (-1 = no re-packing) 
    false,                          // can anyone repack the deployable?
    true,                             // clear the cargo of the deployable?   
    false,                             // should vehicle ammo be cleared?
    true,                              // write deployable to database?
    true,                            // require a plot from the owner to build the deployable?  
    false,                          // enable simulation (movement/damage) for the object? (true for cars)
    false,                          // enable road building for this object?
    ["Garbage_container"],     // array of class names that can be deployed with this method
    [],                                // array of items required nearby to build
    ["ItemBriefcase100oz","ItemBriefcase100oz","ItemBriefcase100oz","ItemBriefcase100oz","ItemBriefcase100oz","ItemBriefcase100oz","ItemBriefcase100oz","ItemBriefcase100oz","ItemBriefcase100oz"],
    "true"],
    
    ["ItemToolbox",                    // class name of the item to click on   
    [0,10,0],                       // [_side,_front,_up] array to offset the deployable when buiding  
    5,                              // how close does the packer need to be to pack the object? 
    -1,                             // item can't be repacked if damage is > this. (-1 = no re-packing) 
    false,                          // can anyone repack the deployable?
    true,                           // clear the cargo of the deployable?   
    false,                          // should vehicle ammo be cleared?
    true,                           // write deployable to database?
    true,                           // require a plot from the owner to build the deployable?  
    false,                          // enable simulation (movement/damage) for the object? (true for cars)
    false,                          // enable road building for this object?
    ["PARACHUTE_TARGET"],           // array of class names that can be deployed with this method
    [],                             // array of items required nearby to build
    ["ItemBriefcase100oz"],         // array of parts required to build
    "true"]
];

// **DZE_DEPLOYABLE_NAME_MAP format
//  
//  DZE_DEPLOYABLE_NAME_MAP = [
//      [_class,_name],
//      [_class,_name],
//      [... more ...]
//  ];
//
//  parameter    | description                                                         |  type  | example
// --------------|---------------------------------------------------------------------|--------|--------
// _class        | class name of the item you want to replace the name of              | string | "Notebook"
// _name         | new name to display when right clicking                             | string | "Macbook Pro"
//
DZE_DEPLOYABLE_NAME_MAP = [
    ["Notebook","Macbook Pro"]
];

DZE_DEPLOYABLE_ADMINS = [];
 

[spoiler/]


 

 
 

Okay - try this:

 

In your player_deploy.sqf:

Find (around line 616)

PVDZ_obj_Publish = [call fnc_perm_deployable_id,_tmpbuilt,[_dir,_position],(_index call getDeployableClass)];
publicVariableServer "PVDZ_obj_Publish";

Replace it with:

private["_playerUID", "_OwnerUID"];
_playerUID = [player] call FNC_GetPlayerUID;
_OwnerUID = _playerUID;
_tmpbuilt setVariable["ownerPUID", _OwnerUID, true];
PVDZ_obj_Publish = [call fnc_perm_deployable_id,_tmpbuilt,[_dir,_position,_playerUID],(_index call getDeployableClass)];
publicVariableServer "PVDZ_obj_Publish";

 

Let me know how that works.

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...