Change DZE_limitPlots to be configurable

This allows you to now specificy a maximum amount of plots per player
for them to place.

This is disabled by default.
This commit is contained in:
oiad
2018-03-31 15:53:56 +13:00
parent 6efd94f638
commit f65dedf9ed
3 changed files with 10 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
//Checks if item is near a plot, if the player is plot owner or friendly, if there are too many items, and if the player has required tools
private ["_isAdmin","_requireplot","_distance","_canBuild","_friendlies","_nearestPole","_ownerID","_pos","_item","_classname","_isPole","_isLandFireDZ","_IsNearPlot","_buildables","_center","_toolCheck","_plotcheck","_buildcheck","_isfriendly","_isowner","_require","_text","_near","_hasPole"];
private ["_isAdmin","_requireplot","_distance","_canBuild","_friendlies","_nearestPole","_ownerID","_pos","_item","_classname","_isPole","_isLandFireDZ","_IsNearPlot","_buildables","_center","_toolCheck","_plotcheck","_buildcheck","_isfriendly","_isowner","_require","_text","_near","_plotPoles"];
_pos = _this select 0;
_item = _this select 1;
@@ -36,7 +36,7 @@ _isPole = (_classname == "Plastic_Pole_EP1_DZ");
_isLandFireDZ = (_classname == "Land_Fire_DZ");
_canBuild = false;
_hasPole = false;
_plotPoles = 0;
_nearestPole = objNull;
_ownerID = 0;
_friendlies = [];
@@ -44,10 +44,10 @@ _friendlies = [];
if (_isPole) then {
_plotcheck = [player, true] call FNC_find_plots;
_distance = DZE_PlotPole select 1;
if (DZE_limitPlots && !_isAdmin) then {
if (DZE_limitPlots > 0 && !_isAdmin) then {
{
if (_x getVariable["ownerPUID","0"] == dayz_playerUID || (_x getVariable["CharacterID","0"] == dayz_characterID)) exitWith {
_hasPole = true;
if (_x getVariable["ownerPUID","0"] == dayz_playerUID || (_x getVariable["CharacterID","0"] == dayz_characterID)) then {
_plotPoles = _plotPoles +1;
};
} count (entities "Plastic_Pole_EP1_DZ");
};
@@ -61,7 +61,7 @@ _nearestPole = _plotcheck select 2;
if (_isPole && {_IsNearPlot > 0}) exitWith {dayz_actionInProgress = false; format[localize "str_epoch_player_44",_distance] call dayz_rollingMessages; [_canBuild, _isPole];};
if (_hasPole) exitWith {dayz_actionInProgress = false; localize "STR_EPOCH_PLAYER_133" call dayz_rollingMessages; [_canBuild, _isPole];};
if (DZE_limitPlots > 0 && {_plotPoles >= DZE_LimitPlots}) exitWith {dayz_actionInProgress = false; format[localize "STR_EPOCH_PLAYER_133",DZE_limitPlots] call dayz_rollingMessages; [_canBuild, _isPole];};
if (_IsNearPlot == 0) then {
if (_requireplot == 0 || {_isLandFireDZ}) then {

View File

@@ -83,7 +83,7 @@ DZE_plotManagementMustBeClose = false; //Players must be within 10m of pole to b
DZE_PlotManagementAdmins = []; //Array of admin PlayerUIDs. UIDs in this list are able to access every pole's management menu and delete or build any buildable with a pole nearby.
DZE_MaxPlotFriends = 10; //Max friends allowed on a plot. There is no character limit in the inventory field of the database, but lower values limit the max global setVariable size to improve performance.
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 = false; // Limit the amount of plot poles per person to 1, UIDS in the DZE_PlotManagementAdmins array are exempt.
DZE_limitPlots = 0; // Limit the amount of plot poles per person, Use 0 to disable. UIDS in the DZE_PlotManagementAdmins array are exempt.
DZE_isRemovable = ["Plastic_Pole_EP1_DZ"]; //Items that can be removed with a crowbar with no ownership or access required. To forbid base take overs remove plot pole from this list and add it to DZE_restrictRemoval. It is not necessary to add wrecks or items that inherit from 'BuiltItems' to this list.
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.

View File

@@ -11998,9 +11998,9 @@
<Czech>%1 je naplněno do %2 procent kapacity.</Czech>
</Key>
<Key ID="STR_EPOCH_PLAYER_133">
<English>You can only have one active plot pole where you are the plot owner.</English>
<German>Du darfst maximal ein Grundstück besitzen, auf welchem du der Eigentümer bist.</German>
<Russian>Вы можете быть владельцем только одного строительного столба.</Russian>
<English>You can only own %1 plot pole(s)</English>
<German>Du kannst nur %1 Gebiet(e) besitzen.</German>
<Russian>Вам может принадлежать только %1 участок/ов земли</Russian>
</Key>
<Key ID="STR_EPOCH_PLAYER_134">
<English>You do not have access to build on this plot.</English>