Add option to disable the upgrade of buildables

This commit is contained in:
A Man
2020-05-27 17:38:34 +02:00
parent 709078c69f
commit 4040b784b5
3 changed files with 5 additions and 4 deletions

View File

@@ -13,10 +13,10 @@ s_player_upgrade_build = 1;
_obj = _this select 3;
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
if (_objectID == "0" && {_objectUID == "0"}) exitWith {dayz_actionInProgress = false; s_player_upgrade_build = -1; localize "str_epoch_player_50" call dayz_rollingMessages;};
_classname = typeOf _obj;
if ((_objectID == "0" && {_objectUID == "0"}) || _classname in DZE_DisableUpgrade) exitWith {dayz_actionInProgress = false; s_player_upgrade_build = -1; localize "str_epoch_player_50" call dayz_rollingMessages;};
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "upgradeBuilding");

View File

@@ -806,7 +806,7 @@ if (!isNull _cursorTarget && {!_inVehicle} && {!_isPZombie} && {player distance
};
// inplace upgrade tool
if ((_cursorTarget isKindOf "ModularItems") || (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") || (_cursorTarget isKindOf "CinderWallDoor_DZ_Base") || (_cursorTarget isKindOf "DZ_storage_base") || (_typeOfCursorTarget in DZE_isNewStorage)) then {
if (((_cursorTarget isKindOf "ModularItems") || (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") || (_cursorTarget isKindOf "CinderWallDoor_DZ_Base") || (_cursorTarget isKindOf "DZ_storage_base") || (_typeOfCursorTarget in DZE_isNewStorage)) && !(_typeOfCursorTarget in DZE_DisableUpgrade)) then {
if ((s_player_lastTarget select 0) != _cursorTarget) then {
if (s_player_upgrade_build > 0) then {
player removeAction s_player_upgrade_build;

View File

@@ -75,6 +75,7 @@ if (!isDedicated) then {
DZE_maintainCurrencyRate = 100; //The currency rate of what maintaining an item will be, for instance: at 100, 10 items will have a worth of 1000 (1 10oz gold or 1k coins) see actions/maintain_area.sqf for more examples.
DZE_limitPlots = 0; // Limit the amount of plot poles per person, Use 0 to disable. UIDS in the DZE_PlotManagementAdmins array are exempt.
DZE_restrictRemoval = ["Fence_corrugated_DZ","M240Nest_DZ","ParkBench_DZ","FireBarrel_DZ","Scaffolding_DZ","CanvasHut_DZ","LightPole_DZ","DeerStand_DZ","MetalGate_DZ","StickFence_DZ"]; //Items that can be removed with a crowbar only with proper ownership or access. It is not necessary to add doors, storage or items that inherit from 'ModularItems' to this list. Items that inherit from 'BuiltItems' can be added to this list if desired.
DZE_DisableUpgrade = []; //Array of buildables that are not allowed to be upgraded. For example: DZE_DisableUpgrade = ["WoodShack_DZ","StorageShed_DZ"];
// Snap Build and Build Vectors
DZE_modularBuild = true; // Enable Snap Building by @raymix and Build Vectors by @strikerforce.