mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Update object_upgradeStorage.sqf
Vanilla commit: 6e4a697
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
/*
|
||||
This script is not part of dayz permission must be given to use. r4z0r49@gmail.com or skype me R4Z0R49.
|
||||
|
||||
Simple class system to use this script.
|
||||
class Upgrade {
|
||||
requiredTools[] = {"ItemToolbox"};
|
||||
requiredParts[] = {"equip_crate","PartWoodPile"};
|
||||
create = "TentStorage1";
|
||||
};
|
||||
|
||||
};
|
||||
*/
|
||||
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
|
||||
dayz_actionInProgress = true;
|
||||
@@ -19,6 +16,17 @@ private ["_cursorTarget","_item","_classname","_requiredTools","_requiredParts",
|
||||
|
||||
_cursorTarget = _this select 3;
|
||||
|
||||
//get ownerID from old tent.
|
||||
_ownerID = _cursorTarget getVariable ["characterID","0"];
|
||||
_objectID = _cursorTarget getVariable ["ObjectID","0"];
|
||||
_objectUID = _cursorTarget getVariable ["ObjectUID","0"];
|
||||
|
||||
//make sure the player is still looking at something to get the cursorTarget and UID
|
||||
if (isNil "_cursorTarget" or {isNull _cursorTarget} or {_objectUID == "0" && (_objectID == "0")}) exitWith {
|
||||
localize "str_cursorTargetNotFound" call dayz_rollingMessages;
|
||||
dayz_actionInProgress = false;
|
||||
};
|
||||
|
||||
_item = typeof _cursorTarget;
|
||||
//diag_log (str(_item));
|
||||
|
||||
@@ -57,10 +65,6 @@ _startUpgrade = true;
|
||||
|
||||
if(_isWater or _onLadder) exitWith {dayz_actionInProgress = false; localize "str_CannotUpgrade" call dayz_rollingMessages;};
|
||||
|
||||
// Make sure you are the closest player to the object
|
||||
_playerNear = _cursorTarget call dze_isnearest_player;
|
||||
if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_pickup_limit_5" call dayz_rollingMessages;};
|
||||
|
||||
// Make sure no other players are nearby
|
||||
_playerNear = {isPlayer _x} count (([_cursorTarget] call FNC_GetPos) nearEntities ["CAManBase",10]) > 1;
|
||||
if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_pickup_limit_5" call dayz_rollingMessages;};
|
||||
@@ -104,11 +108,6 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
|
||||
// Added Nutrition-Factor for work
|
||||
["Working",0,[100,15,5,0]] call dayz_NutritionSystem;
|
||||
|
||||
//get ownerID from old tent.
|
||||
_ownerID = _cursorTarget getVariable ["characterID","0"];
|
||||
_objectID = _cursorTarget getVariable ["ObjectID","0"];
|
||||
_objectUID = _cursorTarget getVariable ["ObjectUID","0"];
|
||||
|
||||
//Upgrade
|
||||
_alreadyupgrading = _cursorTarget getVariable["alreadyupgrading",0];
|
||||
|
||||
@@ -126,9 +125,9 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
|
||||
_cursorTarget setDir 0;
|
||||
_pos = getPosATL _cursorTarget;
|
||||
|
||||
diag_log [ "dir/angle/pos", _dir, _vector, _pos];
|
||||
//diag_log [ "dir/angle/pos", _dir, _vector, _pos];
|
||||
if (abs(((_vector select 1) select 2) - 1) > 0.001) then { _pos set [2,0]; };
|
||||
diag_log [ "dir/angle/pos - reset elevation if angle is straight", _dir, _vector, _pos];
|
||||
//diag_log [ "dir/angle/pos - reset elevation if angle is straight", _dir, _vector, _pos];
|
||||
|
||||
//get contents
|
||||
_weapons = getWeaponCargo _cursorTarget;
|
||||
|
||||
@@ -1611,7 +1611,13 @@
|
||||
<Czech>Na tomto objektu nelze provádět údržbu.</Czech>
|
||||
<German>Dieses Objekt muss nicht gewartet werden.</German>
|
||||
</Key>
|
||||
|
||||
<Key ID="str_cursorTargetNotFound">
|
||||
<English>You must be looking at the item to interact with it.</English>
|
||||
<Russian>Вы должны смотреть на предмет, тоже взаимодействующий с ним.</Russian>
|
||||
<French>Vous devez également regarder l'élément avec lui.</French>
|
||||
<Czech>Musíte se dívat na tento produkt příliš komunikovat s ním.</Czech>
|
||||
<German>Sie müssen sich das Produkt anschauen, das auch mit ihm interagiert.</German>
|
||||
</Key>
|
||||
<Key ID="str_CannotUpgrade">
|
||||
<English>Unable to upgrade at this time</English>
|
||||
<Russian>Невозможно улучшить в данный момент</Russian>
|
||||
|
||||
Reference in New Issue
Block a user