mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-24 17:10:49 +03:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -895,10 +895,10 @@ class CfgMagazines {
|
||||
scope = 2;
|
||||
count = 1;
|
||||
type = 256;
|
||||
displayName = "Safe";
|
||||
displayName = $STR_EPOCH_SAFE;
|
||||
model = "\z\addons\dayz_epoch\models\safe_onside.p3d";
|
||||
picture = "\z\addons\dayz_epoch\pictures\equip_safe_ca.paa";
|
||||
descriptionShort = "Personal Safe: A placeable object that is used for very secure storage. WARNING!!! Placing your safe will give you a 4 digit number that is used to open the safe, save that number!";
|
||||
descriptionShort = $STR_EPOCH_SAFE_DESC;
|
||||
class ItemActions
|
||||
{
|
||||
class Build {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class VaultStorage: Land_A_tent {
|
||||
placement = "vertical";
|
||||
vehicleClass = "Survival";
|
||||
displayName = "Safe";
|
||||
displayName = $STR_EPOCH_SAFE;
|
||||
model = "\z\addons\dayz_epoch\models\safe.p3d";
|
||||
destrType = "DestructNo";
|
||||
armor = 800;
|
||||
@@ -14,7 +14,7 @@ class VaultStorage: Land_A_tent {
|
||||
class VaultStorageLocked: Land_A_tent {
|
||||
placement = "vertical";
|
||||
vehicleClass = "Survival";
|
||||
displayName = "Locked Safe";
|
||||
displayName = $STR_EPOCH_SAFE_LOCKED;
|
||||
model = "\z\addons\dayz_epoch\models\safe.p3d";
|
||||
destrType = "DestructNo";
|
||||
armor = 800;
|
||||
@@ -30,6 +30,6 @@ class VaultStorageLocked: Land_A_tent {
|
||||
|
||||
class WeaponHolder_ItemVault: WeaponHolder {
|
||||
scope = 2;
|
||||
displayName = "Safe";
|
||||
displayName = $STR_EPOCH_SAFE;
|
||||
seedItem = "ItemVault";
|
||||
};
|
||||
@@ -6,6 +6,8 @@ DZE_ActionInProgress = true;
|
||||
|
||||
{player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
|
||||
s_player_lockUnlock_crtl = 1;
|
||||
{DZE_myVehicle removeAction _x} count s_player_lockUnlockInside;s_player_lockUnlockInside = [];
|
||||
s_player_lockUnlockInside_ctrl = -1;
|
||||
|
||||
_removed = ([player,"ItemHotwireKit",1] call BIS_fnc_invRemove);
|
||||
|
||||
@@ -28,4 +30,5 @@ if (_removed == 1) then {
|
||||
};
|
||||
|
||||
s_player_lockUnlock_crtl = -1;
|
||||
s_player_lockUnlockInside_ctrl = -1;
|
||||
DZE_ActionInProgress = false;
|
||||
@@ -6,6 +6,8 @@ DZE_ActionInProgress = true;
|
||||
|
||||
{player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
|
||||
s_player_lockUnlock_crtl = 1;
|
||||
{DZE_myVehicle removeAction _x} count s_player_lockUnlockInside;s_player_lockUnlockInside = [];
|
||||
s_player_lockUnlockInside_ctrl = -1;
|
||||
|
||||
PVDZE_veh_Lock = [_vehicle,true];
|
||||
if(player distance _vehicle < 10) then {
|
||||
@@ -17,4 +19,5 @@ if(player distance _vehicle < 10) then {
|
||||
};
|
||||
|
||||
s_player_lockUnlock_crtl = -1;
|
||||
s_player_lockUnlockInside_ctrl = -1;
|
||||
DZE_ActionInProgress = false;
|
||||
@@ -13,7 +13,7 @@ _towTruckSize = (sizeOf typeOf _towTruck);
|
||||
_allowedSize = _towTruckSize-(_towTruckSize/3);
|
||||
|
||||
// Get all nearby vehicles within 10m
|
||||
_findNearestVehicles = nearestObjects [_towTruck, ["Car","Motorcycle"], 10];
|
||||
_findNearestVehicles = _towTruck nearEntities [["Car","Motorcycle"],10];
|
||||
_findNearestVehicle = [];
|
||||
{
|
||||
if (alive _x && _towTruck != _x) then {
|
||||
|
||||
@@ -7,6 +7,8 @@ DZE_ActionInProgress = true;
|
||||
|
||||
{player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
|
||||
s_player_lockUnlock_crtl = 1;
|
||||
{DZE_myVehicle removeAction _x} count s_player_lockUnlockInside;s_player_lockUnlockInside = [];
|
||||
s_player_lockUnlockInside_ctrl = -1;
|
||||
|
||||
PVDZE_veh_Lock = [_vehicle,false];
|
||||
if(player distance _vehicle < 10) then {
|
||||
@@ -20,4 +22,5 @@ if(player distance _vehicle < 10) then {
|
||||
};
|
||||
|
||||
s_player_lockUnlock_crtl = -1;
|
||||
s_player_lockUnlockInside_ctrl = -1;
|
||||
DZE_ActionInProgress = false;
|
||||
@@ -1,20 +1,23 @@
|
||||
private ["_cTarget","_isOk","_Dis","_display","_inVehicle"];
|
||||
disableSerialization;
|
||||
_display = (_this select 0);
|
||||
_inVehicle = (vehicle player) != player;
|
||||
_cTarget = cursorTarget;
|
||||
if(_inVehicle) then {
|
||||
_cTarget = (vehicle player);
|
||||
};
|
||||
private ["_cTarget","_dis","_display","_friendlies","_rcharID"];
|
||||
|
||||
_isOk = false;
|
||||
{
|
||||
if(!_isOk) then {
|
||||
_isOk = _cTarget isKindOf _x;
|
||||
// players inside vehicle can always access its gear
|
||||
if ((vehicle player) == player) then {
|
||||
disableSerialization;
|
||||
_display = _this select 0;
|
||||
_cTarget = cursorTarget;
|
||||
_dis = if (_cTarget isKindOf "USEC_ch53_E" || _cTarget isKindOf "MV22") then {25} else {12};
|
||||
|
||||
if ((locked _cTarget) && {(_cTarget isKindOf "LandVehicle") or {_cTarget isKindOf "Air"} or {_cTarget isKindOf "Ship"}} && {(player distance _cTarget) < _dis}) then {
|
||||
cutText [(localize "str_epoch_player_7"),"PLAIN DOWN"];
|
||||
_display closeDisplay 1;
|
||||
};
|
||||
} count ["LandVehicle","Air", "Ship"];
|
||||
_Dis = if (_cTarget isKindOf "USEC_ch53_E" || _cTarget isKindOf "MV22") then {25} else {12};
|
||||
if((locked _cTarget) && _isOk && (((vehicle player) distance _cTarget) < _Dis)) then {
|
||||
cutText [(localize "str_epoch_player_7") , "PLAIN DOWN"];
|
||||
_display closeDisplay 1;
|
||||
};
|
||||
|
||||
if (DZE_BackpackAntiTheft) then {
|
||||
_friendlies = player getVariable ["friendlies",[]];
|
||||
_rcharID = _cTarget getVariable ["CharacterID","0"];
|
||||
if ((!canbuild) && {_cTarget isKindOf "Man"} && {alive _cTarget} && {!((typeOf _cTarget) in serverTraders)} && {!(_rcharID in _friendlies)} && {(player distance _cTarget) < 12}) then {
|
||||
cutText [(localize "STR_EPOCH_PLAYER_316"),"PLAIN DOWN"];
|
||||
_display closeDisplay 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -4,11 +4,12 @@ scriptName "Functions\misc\fn_selfActions.sqf";
|
||||
- Function
|
||||
- [] call fnc_usec_selfActions;
|
||||
************************************************************/
|
||||
private ["_isWreckBuilding","_temp_keys","_magazinesPlayer","_isPZombie","_vehicle","_inVehicle","_hasFuelE","_hasRawMeat","_hasKnife","_hasToolbox","_onLadder","_nearLight","_canPickLight","_canDo","_text","_isHarvested","_isVehicle","_isVehicletype","_isMan","_traderType","_ownerID","_isAnimal","_isDog","_isZombie","_isDestructable","_isTent","_isFuel","_isAlive","_Unlock","_lock","_buy","_dogHandle","_lieDown","_warn","_hastinitem","_allowedDistance","_menu","_menu1","_humanity_logic","_low_high","_cancel","_metals_trader","_traderMenu","_isWreck","_isRemovable","_isDisallowRepair","_rawmeat","_humanity","_speed","_dog","_hasbottleitem","_isAir","_isShip","_playersNear","_findNearestGens","_findNearestGen","_IsNearRunningGen","_cursorTarget","_isnewstorage","_itemsPlayer","_ownerKeyId","_typeOfCursorTarget","_hasKey","_oldOwner","_combi","_key_colors","_player_deleteBuild","_player_flipveh","_player_lockUnlock_crtl","_player_butcher","_player_studybody","_player_cook","_player_boil","_hasFuelBarrelE","_hasHotwireKit","_player_SurrenderedGear","_isSurrendered","_isModular","_isModularDoor","_ownerKeyName","_temp_keys_names","_hasAttached","_allowTow","_liftHeli","_found","_posL","_posC","_height","_liftHelis","_attached"];
|
||||
private ["_isWreckBuilding","_temp_keys","_magazinesPlayer","_isPZombie","_vehicle","_inVehicle","_hasFuelE","_hasRawMeat","_hasKnife","_hasToolbox","_onLadder","_nearLight","_canPickLight","_canDo","_text","_isHarvested","_isVehicle","_isVehicletype","_isMan","_traderType","_ownerID","_isAnimal","_isDog","_isZombie","_isDestructable","_isTent","_isFuel","_isAlive","_Unlock","_lock","_buy","_dogHandle","_lieDown","_warn","_hastinitem","_allowedDistance","_menu","_menu1","_humanity_logic","_low_high","_cancel","_metals_trader","_traderMenu","_isWreck","_isRemovable","_isDisallowRepair","_rawmeat","_humanity","_speed","_dog","_hasbottleitem","_isAir","_isShip","_playersNear","_findNearestGens","_findNearestGen","_IsNearRunningGen","_cursorTarget","_isnewstorage","_itemsPlayer","_typeOfCursorTarget","_hasKey","_oldOwner","_combi","_player_deleteBuild","_player_flipveh","_player_lockUnlock_crtl","_player_butcher","_player_studybody","_player_cook","_player_boil","_hasFuelBarrelE","_hasHotwireKit","_player_SurrenderedGear","_isSurrendered","_isModular","_isModularDoor","_temp_keys_names","_hasAttached","_allowTow","_liftHeli","_found","_posL","_posC","_height","_liftHelis","_attached","_vehicleOwnerID","_totalKeys"];
|
||||
|
||||
if (DZE_ActionInProgress) exitWith {}; // Do not allow if any script is running.
|
||||
|
||||
_vehicle = vehicle player;
|
||||
_vehicleOwnerID = _vehicle getVariable ["CharacterID","0"];
|
||||
_isPZombie = player isKindOf "PZombie_VB";
|
||||
_inVehicle = (_vehicle != player);
|
||||
|
||||
@@ -37,6 +38,44 @@ if (_canPickLight && !dayz_hasLight && !_isPZombie) then {
|
||||
s_player_removeflare = -1;
|
||||
};
|
||||
|
||||
if (_inVehicle && {_vehicleOwnerID != "0"} && {!(_vehicle isKindOf "Bicycle")}) then {
|
||||
if (s_player_lockUnlockInside_ctrl < 0) then {
|
||||
DZE_myVehicle = _vehicle;
|
||||
_totalKeys = call epoch_tempKeys;
|
||||
_temp_keys = _totalKeys select 0;
|
||||
_temp_keys_names = _totalKeys select 1;
|
||||
_hasKey = _vehicleOwnerID in _temp_keys;
|
||||
_oldOwner = (_vehicleOwnerID == dayz_playerUID);
|
||||
_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, true, 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, true, true, "", ""];
|
||||
s_player_lockUnlockInside set [count s_player_lockUnlockInside,_lock];
|
||||
s_player_lockUnlockInside_ctrl = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
} else {
|
||||
if (!isNil "DZE_myVehicle") then {
|
||||
{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 {
|
||||
@@ -143,22 +182,8 @@ if (!isNull cursorTarget && !_inVehicle && !_isPZombie && (player distance curso
|
||||
_hasHotwireKit = "ItemHotwireKit" in _magazinesPlayer;
|
||||
|
||||
_itemsPlayer = items player;
|
||||
|
||||
_temp_keys = [];
|
||||
_temp_keys_names = [];
|
||||
// find available keys
|
||||
_key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
|
||||
{
|
||||
if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _key_colors) then {
|
||||
_ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _x >> "keyid");
|
||||
_ownerKeyName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
|
||||
_temp_keys_names set [_ownerKeyId,_ownerKeyName];
|
||||
_temp_keys set [count _temp_keys,str(_ownerKeyId)];
|
||||
};
|
||||
} count _itemsPlayer;
|
||||
|
||||
_hasKnife = "ItemKnife" in _itemsPlayer;
|
||||
_hasToolbox = "ItemToolbox" in _itemsPlayer;
|
||||
_hasKnife = "ItemKnife" in _itemsPlayer;
|
||||
_hasToolbox = "ItemToolbox" in _itemsPlayer;
|
||||
|
||||
_isMan = _cursorTarget isKindOf "Man";
|
||||
_traderType = _typeOfCursorTarget;
|
||||
@@ -282,7 +307,7 @@ if (!isNull cursorTarget && !_inVehicle && !_isPZombie && (player distance curso
|
||||
//diag_log format["CREW: %1 ALLOW: %2",(count (crew _cursorTarget)),_allowTow];
|
||||
|
||||
if (_allowTow) then {
|
||||
_liftHelis = nearestObjects [player, DZE_HeliAllowTowFrom, 15];
|
||||
_liftHelis = player nearEntities [DZE_HeliAllowTowFrom,15];
|
||||
{
|
||||
if(!_found) then {
|
||||
_posL = [_x] call FNC_getPos;
|
||||
@@ -315,6 +340,9 @@ if (!isNull cursorTarget && !_inVehicle && !_isPZombie && (player distance curso
|
||||
// Allow Owner to lock && 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 = _ownerID in _temp_keys;
|
||||
_oldOwner = (_ownerID == dayz_playerUID);
|
||||
if(locked _cursorTarget) then {
|
||||
|
||||
@@ -42,9 +42,11 @@ _dir = direction _obj;
|
||||
_pos = _obj getVariable["OEMPos",(getposATL _obj)];
|
||||
|
||||
if(!isNull _obj) then {
|
||||
|
||||
dze_waiting = nil;
|
||||
PVDZE_log_lockUnlock = [player, _obj,true];
|
||||
publicVariableServer "PVDZE_log_lockUnlock";
|
||||
publicVariableServer "PVDZE_log_lockUnlock";
|
||||
//wait for response from server to verify safe was logged and saved before proceeding
|
||||
waitUntil {!isNil "dze_waiting"};
|
||||
|
||||
//place vault
|
||||
_holder = createVehicle [_lockedClass,_pos,[], 0, "CAN_COLLIDE"];
|
||||
|
||||
@@ -57,9 +57,12 @@ if ((_ownerID == dayz_combination) || (_ownerID == dayz_playerUID)) then {
|
||||
if (_claimedBy == _playerID) then {
|
||||
|
||||
if(!isNull _obj && alive _obj) then {
|
||||
|
||||
|
||||
dze_waiting = nil;
|
||||
PVDZE_log_lockUnlock = [player, _obj, false];
|
||||
publicVariableServer "PVDZE_log_lockUnlock";
|
||||
//wait for response from server to verify safe was logged before proceeding
|
||||
waitUntil {!isNil "dze_waiting"};
|
||||
|
||||
_obj setVariable["packing",1];
|
||||
[1,1] call dayz_HungerThirst;
|
||||
|
||||
@@ -13,7 +13,7 @@ _upgrade = _this;
|
||||
if (vehicle player != player) exitWith {DZE_ActionInProgress = false; cutText [(localize "STR_EPOCH_ACTIONS_18"), "PLAIN DOWN"]};
|
||||
|
||||
// look for nearest empty vehicle
|
||||
_findNearestVehicles = nearestObjects [player, ["LandVehicle"], 10];
|
||||
_findNearestVehicles = player nearEntities [["LandVehicle"],10];
|
||||
_findNearestVehicle = [];
|
||||
{
|
||||
if (alive _x && (count (crew _x)) == 0) exitWith {
|
||||
@@ -129,7 +129,7 @@ if (_IsNearVehicle >= 1) then {
|
||||
publicVariableServer "PVDZE_veh_Upgrade";
|
||||
|
||||
cutText [(localize "STR_EPOCH_VEHUP_SUCCESS"), "PLAIN DOWN"];
|
||||
{player reveal _x;} count (nearestObjects [player,["AllVehicles"],30]);
|
||||
{player reveal _x;} count (player nearEntities [["LandVehicle"],10]);
|
||||
};
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -163,6 +163,23 @@ if (!isDedicated) then {
|
||||
dayz_hunger = dayz_hunger + (_this select 0);
|
||||
dayz_thirst = dayz_thirst + (_this select 1);
|
||||
};
|
||||
|
||||
epoch_tempKeys = {
|
||||
private ["_temp_keys","_temp_keys_names","_key_colors","_ownerKeyId","_ownerKeyName"];
|
||||
_temp_keys = [];
|
||||
_temp_keys_names = [];
|
||||
// find available keys
|
||||
_key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
|
||||
{
|
||||
if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _key_colors) then {
|
||||
_ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _x >> "keyid");
|
||||
_ownerKeyName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
|
||||
_temp_keys_names set [_ownerKeyId,_ownerKeyName];
|
||||
_temp_keys set [count _temp_keys,str(_ownerKeyId)];
|
||||
};
|
||||
} count (items player);
|
||||
[_temp_keys,_temp_keys_names]
|
||||
};
|
||||
|
||||
epoch_totalCurrency = {
|
||||
// total currency
|
||||
|
||||
@@ -258,6 +258,7 @@ dayz_resetSelfActions = {
|
||||
s_player_heli_lift = -1;
|
||||
s_player_heli_detach = -1;
|
||||
s_player_lockUnlock_crtl = -1;
|
||||
s_player_lockUnlockInside_ctrl = -1;
|
||||
s_player_toggleSnap = -1;
|
||||
s_player_toggleSnapSelect = -1;
|
||||
s_player_toggleSnapSelectPoint=[];
|
||||
@@ -269,6 +270,7 @@ call dayz_resetSelfActions;
|
||||
s_player_lastTarget = [objNull,objNull,objNull,objNull,objNull];
|
||||
s_player_repairActions = [];
|
||||
s_player_lockunlock = [];
|
||||
s_player_lockUnlockInside = [];
|
||||
|
||||
// Custom
|
||||
s_player_madsci = [];
|
||||
@@ -564,6 +566,9 @@ if (isNil "DZE_checkNearbyRadius") then {
|
||||
if (isNil "DZE_RestrictSkins") then {
|
||||
DZE_RestrictSkins = [];
|
||||
};
|
||||
if (isNil "DZE_BackpackAntiTheft") then {
|
||||
DZE_BackpackAntiTheft = false;
|
||||
};
|
||||
// needed on server
|
||||
if(isNil "DZE_PlotPole") then {
|
||||
DZE_PlotPole = [30,45];
|
||||
|
||||
Reference in New Issue
Block a user