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:
ebaydayz
2016-10-07 17:39:06 -04:00
parent c0d7917603
commit 8a2d95295b
2 changed files with 20 additions and 24 deletions

View File

@@ -14,7 +14,7 @@ private ["_canPickLight","_text","_dir","_canDoThis","_w2m","_bb","_waterHoles",
"_isModular","_isModularDoor","_isHouse","_isGate","_isFence","_isLockableGate","_isUnlocked","_isOpen","_isClosed","_ownerArray","_ownerBuildLock",
"_ownerPID","_speed","_dog","_vehicle","_inVehicle","_cursorTarget","_primaryWeapon","_currentWeapon","_magazinesPlayer","_onLadder","_canDo",
"_nearLight","_vehicleOwnerID","_hasHotwireKit","_isPZombie","_dogHandle","_allowedDistance","_id","_upgrade","_weaponsPlayer","_hasCrowbar",
"_isPlane"];
"_isPlane","_allowed"];
_vehicle = vehicle player;
_inVehicle = (_vehicle != player);
@@ -664,12 +664,11 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
s_player_breakinhouse = -1;
};*/
if ((_cursorTarget isKindOf "Plastic_Pole_EP1_DZ") && {_canDo && speed player <= 1}) then {
_isOwner = [player, _cursorTarget] call FNC_check_access;
_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) then {
_isOwner = [player, _cursorTarget] call FNC_check_access;
if ((_isOwner select 0) or (_isOwner select 2) or (_isOwner select 3) or (_isOwner select 4)) 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];
};
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];
};
} else {
if (s_player_maintain_area < 0) then {
@@ -678,15 +677,12 @@ 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];
};
};
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];
};
if (DZE_permanentPlot && DZE_PlotOwnership) then {
if (s_player_plot_take_ownership < 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];
};
if (s_player_plot_take_ownership < 0 && (_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];
};
};
} else {