Plot Management cleanup + improvement

New compile DZE_GetPlotFriends

DZE_PlotManagementAdmins allows admin management of plot poles and
buildables near poles

DZE_MaxPlotFriends allows servers to allow more than 6 friends on a pole
at once
This commit is contained in:
icomrade
2016-05-01 13:20:21 -04:00
parent 9e2728af07
commit 1e65f7a959
8 changed files with 62 additions and 111 deletions

View File

@@ -0,0 +1,28 @@
private ["_findNearestPoles","_AdminAccess","_IsNearPlot","_pole","_friendUID","_owner","_allowed","_friends","_fuid","_FindNearestPole"];
_pole = _this select 0;
_FindNearestPole = _this select 1;
_AdminAccess = _this select 2;
_IsNearPlot = 0;
_allowed = [];
if (_FindNearestPole) then {
_findNearestPoles = nearestObjects[[player] call FNC_getPos, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];
_IsNearPlot = count (_findNearestPoles);
_pole = _findNearestPoles select 0;
};
if(!_FindNearestPole || {_IsNearPlot > 0}) then {
_owner = if(DZE_plotforLife) then { _pole getVariable ["ownerPUID","0"]; } else { _pole getVariable ["characterID","0"]; };
_allowed = [_owner];
_friends = _pole getVariable ["plotfriends", []];
_fuid = [];
{
_friendUID = _x select 0;
_fuid set [(count _fuid), _friendUID];
} count _friends;
if (_AdminAccess) then {
_allowed set [1, DZE_PlotManagementAdmins];
_allowed set [2, _fuid];
} else {
_allowed set [1, _fuid];
};
};
_allowed;