mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
Fix plot friends return
This commit is contained in:
@@ -1,4 +1,10 @@
|
|||||||
private ["_findNearestPoles","_AdminAccess","_IsNearPlot","_pole","_friendUID","_owner","_allowed","_friends","_fuid","_FindNearestPole"];
|
/************************************************************************************************************************************************
|
||||||
|
This file is used to obtain plot pole owners and friends, which includes plot management admins depending on the third array element passed to the script
|
||||||
|
You should NOT call this file directly, you should call FNC_check_owner as below to obtain a list of the plot owner and friends.
|
||||||
|
[player, _nearestPole, DZE_plotManagement] call FNC_check_owner;
|
||||||
|
************************************************************************************************************************************************/
|
||||||
|
|
||||||
|
private ["_findNearestPoles","_AdminAccess","_IsNearPlot","_pole","_friendUID","_owner","_allowed","_friends","_FindNearestPole"];
|
||||||
_pole = _this select 0;
|
_pole = _this select 0;
|
||||||
_FindNearestPole = _this select 1;
|
_FindNearestPole = _this select 1;
|
||||||
_AdminAccess = _this select 2;
|
_AdminAccess = _this select 2;
|
||||||
@@ -13,16 +19,12 @@ if(!_FindNearestPole || {_IsNearPlot > 0}) then {
|
|||||||
_owner = if(DZE_plotforLife) then { _pole getVariable ["ownerPUID","0"]; } else { _pole getVariable ["characterID","0"]; };
|
_owner = if(DZE_plotforLife) then { _pole getVariable ["ownerPUID","0"]; } else { _pole getVariable ["characterID","0"]; };
|
||||||
_allowed = [_owner];
|
_allowed = [_owner];
|
||||||
_friends = _pole getVariable ["plotfriends", []];
|
_friends = _pole getVariable ["plotfriends", []];
|
||||||
_fuid = [];
|
|
||||||
{
|
{
|
||||||
_friendUID = _x select 0;
|
_friendUID = _x select 0;
|
||||||
_fuid set [(count _fuid), _friendUID];
|
_allowed set [(count _allowed), _friendUID];
|
||||||
} count _friends;
|
} count _friends;
|
||||||
if (_AdminAccess) then {
|
if (_AdminAccess) then {
|
||||||
_allowed set [1, DZE_PlotManagementAdmins];
|
_allowed = _allowed + DZE_PlotManagementAdmins;
|
||||||
_allowed set [2, _fuid];
|
|
||||||
} else {
|
|
||||||
_allowed set [1, _fuid];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
_allowed;
|
_allowed;
|
||||||
Reference in New Issue
Block a user