From 2f0774d531b950c3ab89ad82b019bd46c0c10ba4 Mon Sep 17 00:00:00 2001 From: oiad Date: Tue, 18 Apr 2017 05:52:36 +1200 Subject: [PATCH] Forbid removing the plot/door owner from objects (#1948) This makes it so only the door or plot owner can remove them selves from doors/plots or the UIDS in DZE_PlotManagementAdmins/DZE_DoorManagementAdmins. --- SQF/dayz_code/actions/doorManagement/doorRemoveFriend.sqf | 3 +++ SQF/dayz_code/actions/plotManagement/plotRemoveFriend.sqf | 3 +++ SQF/dayz_code/stringtable.xml | 8 +++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/SQF/dayz_code/actions/doorManagement/doorRemoveFriend.sqf b/SQF/dayz_code/actions/doorManagement/doorRemoveFriend.sqf index ae3b0fb9b..6734ad34e 100644 --- a/SQF/dayz_code/actions/doorManagement/doorRemoveFriend.sqf +++ b/SQF/dayz_code/actions/doorManagement/doorRemoveFriend.sqf @@ -4,6 +4,9 @@ _pos = _this select 0; if (_pos < 0) exitWith {}; _friends = TheDoor getVariable ["doorfriends", []]; _toRemove = (_friends select _pos); + +if ((_toRemove select 0) == ((_friends select 0) select 0) && (!(dayz_playerUID in DZE_doorManagementAdmins) && !(dayz_playerUID == ((_friends select 0) select 0)))) exitWith {systemChat localize "STR_EPOCH_DOORMANAGEMENT_CANT_REMOVE";}; + _newList = []; { if(_x select 0 != _toRemove select 0) then { diff --git a/SQF/dayz_code/actions/plotManagement/plotRemoveFriend.sqf b/SQF/dayz_code/actions/plotManagement/plotRemoveFriend.sqf index cd46e996a..d13c23202 100644 --- a/SQF/dayz_code/actions/plotManagement/plotRemoveFriend.sqf +++ b/SQF/dayz_code/actions/plotManagement/plotRemoveFriend.sqf @@ -6,6 +6,9 @@ _plots = ([player] call FNC_getPos) nearEntities ["Plastic_Pole_EP1_DZ",15]; _thePlot = _plots select 0; _friends = _thePlot getVariable ["plotfriends", []]; _toRemove = (_friends select _pos); + +if ((_toRemove select 0) == ((_friends select 0) select 0) && (!(dayz_playerUID in DZE_PlotManagementAdmins) && !(dayz_playerUID == ((_friends select 0) select 0)))) exitWith {systemChat localize "STR_EPOCH_PLOTMANAGEMENT_CANT_REMOVE";}; + _newList = []; { if (_x select 0 != _toRemove select 0) then { diff --git a/SQF/dayz_code/stringtable.xml b/SQF/dayz_code/stringtable.xml index d57a0d241..770e4236e 100644 --- a/SQF/dayz_code/stringtable.xml +++ b/SQF/dayz_code/stringtable.xml @@ -15534,6 +15534,9 @@ Можно добавить друзей: %1 Nur %1 Freunde erlaubt. + + You can't remove the plot owner. + Show plot boundary Zeige Grundstücksgrenze @@ -16899,7 +16902,10 @@ Du darfst diese Tür nicht verwalten. У вас нет прав доступа. - + + You can't remove the door owner. + + Open Ramp Rampe öffnen