mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
more vault fixes
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
private["_obj","_bag","_pos"];
|
||||
hintSilent format["DEBUG: %1",_this];
|
||||
_obj = _this select 3;
|
||||
_obj spawn player_packVault;
|
||||
|
||||
@@ -26,6 +26,7 @@ if(_ownerID == dayz_characterID) then {
|
||||
//place tent (local)
|
||||
_holder = createVehicle ["VaultStorageLocked",_pos,[], 0, "CAN_COLLIDE"];
|
||||
_holder setdir _dir;
|
||||
_holder setpos _pos;
|
||||
player reveal _holder;
|
||||
|
||||
_holder setVariable["CharacterID",_ownerID,true];
|
||||
@@ -44,32 +45,12 @@ if(_ownerID == dayz_characterID) then {
|
||||
|
||||
deleteVehicle _obj;
|
||||
|
||||
//Add weapons
|
||||
_objWpnTypes = _weapons select 0;
|
||||
_objWpnQty = _weapons select 1;
|
||||
_countr = 0;
|
||||
{
|
||||
_holder addweaponcargoGlobal [_x,(_objWpnQty select _countr)];
|
||||
_countr = _countr + 1;
|
||||
} forEach _objWpnTypes;
|
||||
|
||||
//Add Magazines
|
||||
_objWpnTypes = _magazines select 0;
|
||||
_objWpnQty = _magazines select 1;
|
||||
_countr = 0;
|
||||
{
|
||||
_holder addmagazinecargoGlobal [_x,(_objWpnQty select _countr)];
|
||||
_countr = _countr + 1;
|
||||
} forEach _objWpnTypes;
|
||||
|
||||
//Add Backpacks
|
||||
_objWpnTypes = _backpacks select 0;
|
||||
_objWpnQty = _backpacks select 1;
|
||||
_countr = 0;
|
||||
{
|
||||
_holder addbackpackcargoGlobal [_x,(_objWpnQty select _countr)];
|
||||
_countr = _countr + 1;
|
||||
} forEach _objWpnTypes;
|
||||
// Fill variables with loot
|
||||
_holder setVariable ["WeaponCargo", _weapons, true];
|
||||
_holder setVariable ["MagazineCargo", _magazines, true];
|
||||
_holder setVariable ["BackpackCargo", _backpacks, true];
|
||||
|
||||
cutText ["Your vault has been locked", "PLAIN DOWN"];
|
||||
} else {
|
||||
|
||||
@@ -26,15 +26,16 @@ if(_ownerID == dayz_characterID) then {
|
||||
//place tent (local)
|
||||
_holder = createVehicle ["VaultStorage",_pos,[], 0, "CAN_COLLIDE"];
|
||||
_holder setdir _dir;
|
||||
_holder setpos _pos;
|
||||
player reveal _holder;
|
||||
|
||||
_holder setVariable["CharacterID",_ownerID,true];
|
||||
_holder setVariable["ObjectID",_objectID,true];
|
||||
_holder setVariable["ObjectUID",_objectUID,true];
|
||||
|
||||
_weapons = getWeaponCargo _obj;
|
||||
_magazines = getMagazineCargo _obj;
|
||||
_backpacks = getBackpackCargo _obj;
|
||||
_weapons = _obj getVariable["WeaponCargo",[]];
|
||||
_magazines = _obj getVariable["MagazineCargo",[]];
|
||||
_backpacks = _obj getVariable["BackpackCargo",[]];
|
||||
|
||||
// dayzDeleteObj = [_objectID,_objectUID];
|
||||
// publicVariableServer "dayzDeleteObj";
|
||||
@@ -44,6 +45,8 @@ if(_ownerID == dayz_characterID) then {
|
||||
|
||||
deleteVehicle _obj;
|
||||
|
||||
|
||||
|
||||
//Add weapons
|
||||
_objWpnTypes = _weapons select 0;
|
||||
_objWpnQty = _weapons select 1;
|
||||
|
||||
@@ -1931,14 +1931,9 @@ class CfgVehicles
|
||||
model = "\dayz_equip\models\safe1.p3d";
|
||||
destrType = "DestructNo";
|
||||
armor = 2000;
|
||||
memoryPointSupply = "";
|
||||
supplyRadius = 0;
|
||||
transportMaxWeapons = 0;
|
||||
transportMaxMagazines = 0;
|
||||
transportMaxWeapons = 0;
|
||||
transportMaxBackpacks = 0;
|
||||
transportAmmo = 0;
|
||||
transportRepair = 0;
|
||||
transportFuel = 0;
|
||||
};
|
||||
|
||||
class CardboardBox: ReammoBox
|
||||
|
||||
@@ -90,7 +90,7 @@ diag_log "HIVE: Starting";
|
||||
_pos set [2,0];
|
||||
_object setpos _pos;
|
||||
};
|
||||
if (_object isKindOf "VaultStorage") then {
|
||||
if (_object isKindOf "VaultStorageLocked") then {
|
||||
_pos set [2,0];
|
||||
_object setpos _pos;
|
||||
};
|
||||
@@ -98,57 +98,61 @@ diag_log "HIVE: Starting";
|
||||
_object setDamage _damage;
|
||||
|
||||
if (count _intentory > 0) then {
|
||||
//Add weapons
|
||||
_objWpnTypes = (_intentory select 0) select 0;
|
||||
_objWpnQty = (_intentory select 0) select 1;
|
||||
_countr = 0;
|
||||
{
|
||||
_isOK = isClass(configFile >> "CfgWeapons" >> _x);
|
||||
if (_isOK) then {
|
||||
_block = getNumber(configFile >> "CfgWeapons" >> _x >> "stopThis") == 1;
|
||||
if (!_block) then {
|
||||
_object addWeaponCargoGlobal [_x,(_objWpnQty select _countr)];
|
||||
};
|
||||
};
|
||||
_countr = _countr + 1;
|
||||
} forEach _objWpnTypes;
|
||||
if (_object isKindOf "VaultStorageLocked") then {
|
||||
// Fill variables with loot
|
||||
_object setVariable ["WeaponCargo", (_intentory select 0), true];
|
||||
_object setVariable ["MagazineCargo", (_intentory select 1), true];
|
||||
_object setVariable ["BackpackCargo", (_intentory select 2), true];
|
||||
} else {
|
||||
|
||||
//Add Magazines
|
||||
_objWpnTypes = (_intentory select 1) select 0;
|
||||
_objWpnQty = (_intentory select 1) select 1;
|
||||
_countr = 0;
|
||||
{
|
||||
_isOK = isClass(configFile >> "CfgMagazines" >> _x);
|
||||
if (_isOK) then {
|
||||
_block = getNumber(configFile >> "CfgMagazines" >> _x >> "stopThis") == 1;
|
||||
if (!_block) then {
|
||||
_object addMagazineCargoGlobal [_x,(_objWpnQty select _countr)];
|
||||
//Add weapons
|
||||
_objWpnTypes = (_intentory select 0) select 0;
|
||||
_objWpnQty = (_intentory select 0) select 1;
|
||||
_countr = 0;
|
||||
{
|
||||
_isOK = isClass(configFile >> "CfgWeapons" >> _x);
|
||||
if (_isOK) then {
|
||||
_block = getNumber(configFile >> "CfgWeapons" >> _x >> "stopThis") == 1;
|
||||
if (!_block) then {
|
||||
_object addWeaponCargoGlobal [_x,(_objWpnQty select _countr)];
|
||||
};
|
||||
};
|
||||
};
|
||||
_countr = _countr + 1;
|
||||
} forEach _objWpnTypes;
|
||||
_countr = _countr + 1;
|
||||
} forEach _objWpnTypes;
|
||||
|
||||
//Add Backpacks
|
||||
_objWpnTypes = (_intentory select 2) select 0;
|
||||
_objWpnQty = (_intentory select 2) select 1;
|
||||
_countr = 0;
|
||||
{
|
||||
_isOK = isClass(configFile >> "CfgVehicles" >> _x);
|
||||
if (_isOK) then {
|
||||
_block = getNumber(configFile >> "CfgVehicles" >> _x >> "stopThis") == 1;
|
||||
if (!_block) then {
|
||||
_object addBackpackCargoGlobal [_x,(_objWpnQty select _countr)];
|
||||
//Add Magazines
|
||||
_objWpnTypes = (_intentory select 1) select 0;
|
||||
_objWpnQty = (_intentory select 1) select 1;
|
||||
_countr = 0;
|
||||
{
|
||||
_isOK = isClass(configFile >> "CfgMagazines" >> _x);
|
||||
if (_isOK) then {
|
||||
_block = getNumber(configFile >> "CfgMagazines" >> _x >> "stopThis") == 1;
|
||||
if (!_block) then {
|
||||
_object addMagazineCargoGlobal [_x,(_objWpnQty select _countr)];
|
||||
};
|
||||
};
|
||||
};
|
||||
_countr = _countr + 1;
|
||||
} forEach _objWpnTypes;
|
||||
_countr = _countr + 1;
|
||||
} forEach _objWpnTypes;
|
||||
|
||||
//Add Backpacks
|
||||
_objWpnTypes = (_intentory select 2) select 0;
|
||||
_objWpnQty = (_intentory select 2) select 1;
|
||||
_countr = 0;
|
||||
{
|
||||
_isOK = isClass(configFile >> "CfgVehicles" >> _x);
|
||||
if (_isOK) then {
|
||||
_block = getNumber(configFile >> "CfgVehicles" >> _x >> "stopThis") == 1;
|
||||
if (!_block) then {
|
||||
_object addBackpackCargoGlobal [_x,(_objWpnQty select _countr)];
|
||||
};
|
||||
};
|
||||
_countr = _countr + 1;
|
||||
} forEach _objWpnTypes;
|
||||
};
|
||||
};
|
||||
|
||||
if (_object isKindOf "AllVehicles") then {
|
||||
if(_ownerID != 0) then {
|
||||
_object setVehicleInit "this lock true; this lockCargo true;";
|
||||
processInitCommands;
|
||||
};
|
||||
{
|
||||
_selection = _x select 0;
|
||||
_dam = _x select 1;
|
||||
@@ -161,6 +165,10 @@ diag_log "HIVE: Starting";
|
||||
_position = ([(getPosATL _object),0,100,10,0,500,0] call BIS_fnc_findSafePos);
|
||||
_object setPosATL _position;
|
||||
};
|
||||
|
||||
if(_ownerID != "0") then {
|
||||
_object setvehiclelock "locked";
|
||||
};
|
||||
_object call fnc_vehicleEventHandler;
|
||||
_totalvehicles = _totalvehicles + 1;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user