mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
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:
28
SQF/dayz_code/compile/dze_getPlotFriends.sqf
Normal file
28
SQF/dayz_code/compile/dze_getPlotFriends.sqf
Normal 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;
|
||||
Reference in New Issue
Block a user