mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-20 10:26:28 +03:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user