more vault fixes

This commit is contained in:
A Clark
2012-11-25 06:31:26 -06:00
parent 0037b7a6a6
commit c55f242fd3
5 changed files with 70 additions and 84 deletions

View File

@@ -1,4 +1,3 @@
private["_obj","_bag","_pos"];
hintSilent format["DEBUG: %1",_this];
_obj = _this select 3;
_obj spawn player_packVault;

View File

@@ -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 {

View File

@@ -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;

View File

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

View File

@@ -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,6 +98,13 @@ diag_log "HIVE: Starting";
_object setDamage _damage;
if (count _intentory > 0) then {
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 weapons
_objWpnTypes = (_intentory select 0) select 0;
_objWpnQty = (_intentory select 0) select 1;
@@ -143,12 +150,9 @@ diag_log "HIVE: Starting";
_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;
};