mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Restrict access to show plot boundary action
Only the owner, plot owner, plot friends and plot admins should be able to see the plot boundary. Randoms just use it for griefing. Also renamed the targetX variables to the more appropriate doorX in fn_check_access since they are only used if the target is a door.
This commit is contained in:
@@ -32,8 +32,8 @@ private [
|
|||||||
,"_isPlotOwner" // return value
|
,"_isPlotOwner" // return value
|
||||||
,"_isPlotFriend" // return value
|
,"_isPlotFriend" // return value
|
||||||
,"_isPlotAdmin" // return value
|
,"_isPlotAdmin" // return value
|
||||||
,"_isTargetFriend" // return value
|
,"_isDoorFriend" // Only applicable if target is a door
|
||||||
,"_isTargetAdmin" // return value
|
,"_isDoorAdmin" // Only applicable if target is a door
|
||||||
,"_targetType" // return value
|
,"_targetType" // return value
|
||||||
,"_targetOwnerUID" // UID or characterID of the owner of _target
|
,"_targetOwnerUID" // UID or characterID of the owner of _target
|
||||||
,"_playerUID" // UID of the _player
|
,"_playerUID" // UID of the _player
|
||||||
@@ -43,7 +43,7 @@ private [
|
|||||||
,"_nearestPlot" // plot object
|
,"_nearestPlot" // plot object
|
||||||
,"_plotOwnerUID" // plot owner's UID
|
,"_plotOwnerUID" // plot owner's UID
|
||||||
,"_plotFriends" // list of plot friends [["UID", "Name"], ..]
|
,"_plotFriends" // list of plot friends [["UID", "Name"], ..]
|
||||||
,"_targetFriends" // list of target friends [["UID", "Name"], ..]
|
,"_doorFriends" // list of door friends [["UID", "Name"], ..]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@@ -57,8 +57,8 @@ _isFriendly = false;
|
|||||||
_isPlotOwner = false;
|
_isPlotOwner = false;
|
||||||
_isPlotFriend = false;
|
_isPlotFriend = false;
|
||||||
_isPlotAdmin = false;
|
_isPlotAdmin = false;
|
||||||
_isTargetFriend = false;
|
_isDoorFriend = false;
|
||||||
_isTargetAdmin = false;
|
_isDoorAdmin = false;
|
||||||
_targetType = "";
|
_targetType = "";
|
||||||
|
|
||||||
|
|
||||||
@@ -120,16 +120,16 @@ if(_isNearPlot) then {
|
|||||||
if(_targetType == "DOOR") then {
|
if(_targetType == "DOOR") then {
|
||||||
// determine door friends
|
// determine door friends
|
||||||
// and check if player is one of them
|
// and check if player is one of them
|
||||||
_isTargetFriend = _isOwner; // Door owner is always a door friend
|
_isDoorFriend = _isOwner; // Door owner is always a door friend
|
||||||
_targetFriends = _target getVariable ["doorfriends",[]];
|
_doorFriends = _target getVariable ["doorfriends",[]];
|
||||||
{
|
{
|
||||||
if( (_x select 0) == _playerUID ) then { _isTargetFriend = true; };
|
if( (_x select 0) == _playerUID ) then { _isDoorFriend = true; };
|
||||||
} count _targetFriends;
|
} count _doorFriends;
|
||||||
|
|
||||||
|
|
||||||
// determine door management admins
|
// determine door management admins
|
||||||
// and check if player is one of them
|
// and check if player is one of them
|
||||||
if(_playerUID in DZE_DoorManagementAdmins) then { _isTargetAdmin = true; };
|
if(_playerUID in DZE_DoorManagementAdmins) then { _isDoorAdmin = true; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ if(_targetType == "DOOR") then {
|
|||||||
, _isPlotOwner
|
, _isPlotOwner
|
||||||
, _isPlotFriend
|
, _isPlotFriend
|
||||||
, _isPlotAdmin
|
, _isPlotAdmin
|
||||||
, _isTargetFriend
|
, _isDoorFriend
|
||||||
, _isTargetAdmin
|
, _isDoorAdmin
|
||||||
, _targetType
|
, _targetType
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ private ["_canPickLight","_text","_dir","_canDoThis","_w2m","_bb","_waterHoles",
|
|||||||
"_isModular","_isModularDoor","_isHouse","_isGate","_isFence","_isLockableGate","_isUnlocked","_isOpen","_isClosed","_ownerArray","_ownerBuildLock",
|
"_isModular","_isModularDoor","_isHouse","_isGate","_isFence","_isLockableGate","_isUnlocked","_isOpen","_isClosed","_ownerArray","_ownerBuildLock",
|
||||||
"_ownerPID","_speed","_dog","_vehicle","_inVehicle","_cursorTarget","_primaryWeapon","_currentWeapon","_magazinesPlayer","_onLadder","_canDo",
|
"_ownerPID","_speed","_dog","_vehicle","_inVehicle","_cursorTarget","_primaryWeapon","_currentWeapon","_magazinesPlayer","_onLadder","_canDo",
|
||||||
"_nearLight","_vehicleOwnerID","_hasHotwireKit","_isPZombie","_dogHandle","_allowedDistance","_id","_upgrade","_weaponsPlayer","_hasCrowbar",
|
"_nearLight","_vehicleOwnerID","_hasHotwireKit","_isPZombie","_dogHandle","_allowedDistance","_id","_upgrade","_weaponsPlayer","_hasCrowbar",
|
||||||
"_isPlane"];
|
"_isPlane","_allowed"];
|
||||||
|
|
||||||
_vehicle = vehicle player;
|
_vehicle = vehicle player;
|
||||||
_inVehicle = (_vehicle != player);
|
_inVehicle = (_vehicle != player);
|
||||||
@@ -664,13 +664,12 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
|
|||||||
s_player_breakinhouse = -1;
|
s_player_breakinhouse = -1;
|
||||||
};*/
|
};*/
|
||||||
if ((_cursorTarget isKindOf "Plastic_Pole_EP1_DZ") && {_canDo && speed player <= 1}) then {
|
if ((_cursorTarget isKindOf "Plastic_Pole_EP1_DZ") && {_canDo && speed player <= 1}) then {
|
||||||
if (DZE_permanentPlot) then {
|
|
||||||
if (s_player_plotManagement < 0) then {
|
|
||||||
_isOwner = [player, _cursorTarget] call FNC_check_access;
|
_isOwner = [player, _cursorTarget] call FNC_check_access;
|
||||||
if ((_isOwner select 0) or (_isOwner select 2) or (_isOwner select 3) or (_isOwner select 4)) then {
|
_allowed = ((_isOwner select 0) or (_isOwner select 2) or (_isOwner select 3) or (_isOwner select 4));
|
||||||
|
if (DZE_permanentPlot) then {
|
||||||
|
if (s_player_plotManagement < 0 && _allowed) then {
|
||||||
s_player_plotManagement = player addAction [format["<t color='#0059FF'>%1</t>",localize "STR_EPOCH_ACTIONS_MANAGEPLOT"], "\z\addons\dayz_code\actions\plotManagement\initPlotManagement.sqf", [], 5, false];
|
s_player_plotManagement = player addAction [format["<t color='#0059FF'>%1</t>",localize "STR_EPOCH_ACTIONS_MANAGEPLOT"], "\z\addons\dayz_code\actions\plotManagement\initPlotManagement.sqf", [], 5, false];
|
||||||
};
|
};
|
||||||
};
|
|
||||||
} else {
|
} else {
|
||||||
if (s_player_maintain_area < 0) then {
|
if (s_player_maintain_area < 0) then {
|
||||||
s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "\z\addons\dayz_code\actions\plotManagement\maintain_area.sqf", "maintain", 5, false];
|
s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "\z\addons\dayz_code\actions\plotManagement\maintain_area.sqf", "maintain", 5, false];
|
||||||
@@ -678,17 +677,14 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
|
|||||||
s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\plotManagement\maintain_area.sqf", "preview", 5, false];
|
s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\plotManagement\maintain_area.sqf", "preview", 5, false];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if (s_player_plot_boundary < 0) then {
|
if (s_player_plot_boundary < 0 && (_allowed or (_isOwner select 1))) then {
|
||||||
s_player_plot_boundary = player addAction [localize "STR_EPOCH_PLOTMANAGEMENT_SHOW_BOUNDARY", "\z\addons\dayz_code\actions\plotManagement\plotToggleMarkers.sqf", "", 1, false];
|
s_player_plot_boundary = player addAction [localize "STR_EPOCH_PLOTMANAGEMENT_SHOW_BOUNDARY", "\z\addons\dayz_code\actions\plotManagement\plotToggleMarkers.sqf", "", 1, false];
|
||||||
};
|
};
|
||||||
if (DZE_permanentPlot && DZE_PlotOwnership) then {
|
if (DZE_permanentPlot && DZE_PlotOwnership) then {
|
||||||
if (s_player_plot_take_ownership < 0) then {
|
if (s_player_plot_take_ownership < 0 && (_isOwner select 0)) then {
|
||||||
_isOwner = [player, _cursorTarget] call FNC_check_access;
|
|
||||||
if (_isOwner select 0) then {
|
|
||||||
s_player_plot_take_ownership = player addAction [localize "STR_EPOCH_APLOTFORLIFE_TAKE_PLOT_OWNERSHIP", "\z\addons\dayz_code\actions\A_Plot_for_Life\plot_take_ownership.sqf", "", 1, false];
|
s_player_plot_take_ownership = player addAction [localize "STR_EPOCH_APLOTFORLIFE_TAKE_PLOT_OWNERSHIP", "\z\addons\dayz_code\actions\A_Plot_for_Life\plot_take_ownership.sqf", "", 1, false];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
} else {
|
} else {
|
||||||
player removeAction s_player_plotManagement;
|
player removeAction s_player_plotManagement;
|
||||||
s_player_plotManagement = -1;
|
s_player_plotManagement = -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user