Add DZE_limitPlots so admins can limit plot poles to 1 per UID.

This adds DZE_limitPlots where admins can restrict a player to only
having 1 plot pole. Disabled by default.
This commit is contained in:
oiad
2017-03-23 22:39:22 +13:00
parent 665ecd9146
commit 73899d520f
5 changed files with 24 additions and 2 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 ["_requireplot","_distance","_canBuild","_friendlies","_nearestPole","_ownerID","_pos","_item","_classname","_isPole","_isLandFireDZ","_IsNearPlot","_buildables","_center","_toolCheck","_plotcheck","_buildcheck","_isfriendly","_isowner","_require","_text","_near"];
private ["_requireplot","_distance","_canBuild","_friendlies","_nearestPole","_ownerID","_pos","_item","_classname","_isPole","_isLandFireDZ","_IsNearPlot","_buildables","_center","_toolCheck","_plotcheck","_buildcheck","_isfriendly","_isowner","_require","_text","_near","_hasPole"];
_pos = _this select 0;
_item = _this select 1;
@@ -16,6 +16,7 @@ _isPole = (_classname == "Plastic_Pole_EP1_DZ");
_isLandFireDZ = (_classname == "Land_Fire_DZ");
_canBuild = false;
_hasPole = false;
_nearestPole = objNull;
_ownerID = 0;
_friendlies = [];
@@ -23,6 +24,7 @@ _friendlies = [];
if (_isPole) then {
_plotcheck = [player, true] call FNC_find_plots;
_distance = DZE_PlotPole select 1;
if (DZE_limitPlots && {!((getPlayerUID player) in DZE_PlotManagementAdmins)}) then {_hasPole = call FNC_plotCheck;};
} else {
_plotcheck = [player, false] call FNC_find_plots;
_distance = DZE_PlotPole select 0;
@@ -33,6 +35,8 @@ _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 (_IsNearPlot == 0) then {
if (_requireplot == 0 || {_isLandFireDZ}) then {
_canBuild = true;