mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Pullrequest/door management (#1694)
* Added doorManagement * Rename FNC_check_owner --> FNC_check_owner_friends * Fixed typo * Fixed bug in FNC_check_owner_friends which allowed every user to manage every plot and door. * Removed unused DZE_doorManagementHarderPenalty from configVariables.sqf * Now checking if _playerUID is in _friendlies for both cases. * DZE_plotforLife should be DZE_permanentPlot * Fixed case where DZE_permanentPlot is false. * Forgot to add STR_EPOCH_CANCEL * Changed translations to suggested string by ebaydayz. * Renamed EyeScanner to DoorAccess. * Reworked access rights for door management. * DZE_doorManagementMustBeClose = true; //Players must be within 10m of door to be added as a door friend. * Fixed copy-paste error. * Replace count with if * Remove redundant test. * Also replaced count in door management admins check. * Change plotManagement and doorManagement to be consistent to DayZ_UseSteamID (get UID from FNC_GetPlayerUID). * Use _playerUID and _characterID more consistent. * Added german translation to STR_EPOCH_PLOTMANAGEMENT_ADDFRIEND_ALREADYONTHELIST.
This commit is contained in:
@@ -299,7 +299,7 @@ class Land_DZE_WoodDoor: Land_DZE_WoodDoor_Base {
|
||||
{
|
||||
class Open_Door
|
||||
{
|
||||
displayName="Open Door";
|
||||
displayName=$STR_EPOCH_DOORS_OPEN;
|
||||
onlyforplayer = true;
|
||||
position="Door_knopf";
|
||||
radius=3; /* visibility distance of the entry */
|
||||
@@ -308,7 +308,7 @@ class Land_DZE_WoodDoor: Land_DZE_WoodDoor_Base {
|
||||
};
|
||||
class Close_Door : Open_Door
|
||||
{
|
||||
displayName="Close Door";
|
||||
displayName=$STR_EPOCH_DOORS_CLOSE;
|
||||
condition="this animationPhase ""Open_door"" >= 0.5";
|
||||
statement="this animate [""Open_door"", 0];";
|
||||
};
|
||||
@@ -340,7 +340,7 @@ class Land_DZE_WoodDoorLocked: Land_DZE_WoodDoorLocked_Base {
|
||||
{
|
||||
class Open_Door
|
||||
{
|
||||
displayName="Open Door";
|
||||
displayName=$STR_EPOCH_DOORS_OPEN;
|
||||
onlyforplayer = true;
|
||||
position="Door_knopf";
|
||||
radius=3; /* visibility distance of the entry */
|
||||
@@ -350,31 +350,31 @@ class Land_DZE_WoodDoorLocked: Land_DZE_WoodDoorLocked_Base {
|
||||
};
|
||||
class Close_Door : Open_Door
|
||||
{
|
||||
displayName="Close Door";
|
||||
displayName=$STR_EPOCH_DOORS_CLOSE;
|
||||
//condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_hinge"" == 1)";
|
||||
condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_hinge"" == 1)";
|
||||
statement="this animate [""Open_door"", 0]";
|
||||
};
|
||||
class Lock_Door : Open_Door
|
||||
{
|
||||
displayName="Lock Door";
|
||||
displayName=$STR_EPOCH_DOORS_LOCK;
|
||||
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 1)";
|
||||
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 1)";
|
||||
statement="this animate [""Open_hinge"", 0]";
|
||||
};
|
||||
class Unlock_Door : Open_Door
|
||||
{
|
||||
displayName="Unlock Door";
|
||||
displayName=$STR_EPOCH_DOORS_UNLOCK;
|
||||
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
|
||||
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
|
||||
statement="this animate [""Open_hinge"", 1]";
|
||||
};
|
||||
class Unlock_Door_Dialog : Open_Door
|
||||
{
|
||||
displayName="Unlock Door";
|
||||
displayName=$STR_EPOCH_DOORS_UNLOCK;
|
||||
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
|
||||
condition=" !keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])";
|
||||
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;createdialog ""ComboLockUI""";
|
||||
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -399,7 +399,7 @@ class Land_DZE_LargeWoodDoor: Land_DZE_WoodDoor_Base {
|
||||
{
|
||||
class Open_Door
|
||||
{
|
||||
displayName="Open Door";
|
||||
displayName=$STR_EPOCH_DOORS_OPEN;
|
||||
onlyforplayer = true;
|
||||
position="Door_knopf";
|
||||
radius=3; /* visibility distance of the entry */
|
||||
@@ -408,7 +408,7 @@ class Land_DZE_LargeWoodDoor: Land_DZE_WoodDoor_Base {
|
||||
};
|
||||
class Close_Door : Open_Door
|
||||
{
|
||||
displayName="Close Door";
|
||||
displayName=$STR_EPOCH_DOORS_CLOSE;
|
||||
condition="this animationPhase ""Open_door"" >= 0.5";
|
||||
statement="this animate [""Open_door"", 0]";
|
||||
};
|
||||
@@ -440,7 +440,7 @@ class Land_DZE_LargeWoodDoorLocked: Land_DZE_WoodDoorLocked_Base {
|
||||
{
|
||||
class Open_Door
|
||||
{
|
||||
displayName="Open Door";
|
||||
displayName=$STR_EPOCH_DOORS_OPEN;
|
||||
onlyforplayer = true;
|
||||
position="Door_knopf";
|
||||
radius=3; /* visibility distance of the entry */
|
||||
@@ -450,31 +450,31 @@ class Land_DZE_LargeWoodDoorLocked: Land_DZE_WoodDoorLocked_Base {
|
||||
};
|
||||
class Close_Door : Open_Door
|
||||
{
|
||||
displayName="Close Door";
|
||||
displayName=$STR_EPOCH_DOORS_CLOSE;
|
||||
//condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_hinge"" == 1)";
|
||||
condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_hinge"" == 1)";
|
||||
statement="this animate [""Open_door"", 0]";
|
||||
};
|
||||
class Lock_Door : Open_Door
|
||||
{
|
||||
displayName="Lock Door";
|
||||
displayName=$STR_EPOCH_DOORS_LOCK;
|
||||
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 1)";
|
||||
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 1)";
|
||||
statement="this animate [""Open_hinge"", 0]";
|
||||
};
|
||||
class Unlock_Door : Open_Door
|
||||
{
|
||||
displayName="Unlock Door";
|
||||
displayName=$STR_EPOCH_DOORS_UNLOCK;
|
||||
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
|
||||
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
|
||||
statement="this animate [""Open_hinge"", 1]";
|
||||
};
|
||||
class Unlock_Door_Dialog : Open_Door
|
||||
{
|
||||
displayName="Unlock Door";
|
||||
displayName=$STR_EPOCH_DOORS_UNLOCK;
|
||||
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
|
||||
condition=" !keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])";
|
||||
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;createdialog ""ComboLockUI""";
|
||||
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -499,7 +499,7 @@ class Land_DZE_GarageWoodDoor: Land_DZE_WoodDoor_Base {
|
||||
{
|
||||
class Open_Door
|
||||
{
|
||||
displayName="Open Door";
|
||||
displayName=$STR_EPOCH_DOORS_OPEN;
|
||||
onlyforplayer = true;
|
||||
position="Door_knopf";
|
||||
radius=3; /* visibility distance of the entry */
|
||||
@@ -508,7 +508,7 @@ class Land_DZE_GarageWoodDoor: Land_DZE_WoodDoor_Base {
|
||||
};
|
||||
class Close_Door : Open_Door
|
||||
{
|
||||
displayName="Close Door";
|
||||
displayName=$STR_EPOCH_DOORS_CLOSE;
|
||||
condition="this animationPhase ""Open_door"" >= 0.5";
|
||||
statement="this animate [""Open_door"", 0]";
|
||||
};
|
||||
@@ -540,7 +540,7 @@ class Land_DZE_GarageWoodDoorLocked: Land_DZE_WoodDoorLocked_Base {
|
||||
{
|
||||
class Open_Door
|
||||
{
|
||||
displayName="Open Door";
|
||||
displayName=$STR_EPOCH_DOORS_OPEN;
|
||||
onlyforplayer = true;
|
||||
position="Door_knopf";
|
||||
radius=3; /* visibility distance of the entry */
|
||||
@@ -550,31 +550,31 @@ class Land_DZE_GarageWoodDoorLocked: Land_DZE_WoodDoorLocked_Base {
|
||||
};
|
||||
class Close_Door : Open_Door
|
||||
{
|
||||
displayName="Close Door";
|
||||
displayName=$STR_EPOCH_DOORS_CLOSE;
|
||||
//condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_hinge"" == 1)";
|
||||
condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_hinge"" == 1)";
|
||||
statement="this animate [""Open_door"", 0]";
|
||||
};
|
||||
class Lock_Door : Open_Door
|
||||
{
|
||||
displayName="Lock Door";
|
||||
displayName=$STR_EPOCH_DOORS_LOCK;
|
||||
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 1)";
|
||||
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 1)";
|
||||
statement="this animate [""Open_hinge"", 0]";
|
||||
};
|
||||
class Unlock_Door : Open_Door
|
||||
{
|
||||
displayName="Unlock Door";
|
||||
displayName=$STR_EPOCH_DOORS_UNLOCK;
|
||||
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
|
||||
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
|
||||
statement="this animate [""Open_hinge"", 1]";
|
||||
};
|
||||
class Unlock_Door_Dialog : Open_Door
|
||||
{
|
||||
displayName="Unlock Door";
|
||||
displayName=$STR_EPOCH_DOORS_UNLOCK;
|
||||
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
|
||||
condition=" !keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])";
|
||||
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;createdialog ""ComboLockUI""";
|
||||
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -605,7 +605,7 @@ class CinderWallDoorLocked_DZ: CinderWallDoorLocked_DZ_Base {
|
||||
{
|
||||
class Open_Door
|
||||
{
|
||||
displayName="Open Door";
|
||||
displayName=$STR_EPOCH_DOORS_OPEN;
|
||||
onlyforplayer = true;
|
||||
position="Door_knopf";
|
||||
radius=3; /* visibility distance of the entry */
|
||||
@@ -615,31 +615,31 @@ class CinderWallDoorLocked_DZ: CinderWallDoorLocked_DZ_Base {
|
||||
};
|
||||
class Close_Door : Open_Door
|
||||
{
|
||||
displayName="Close Door";
|
||||
displayName=$STR_EPOCH_DOORS_CLOSE;
|
||||
//condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_hinge"" == 1)";
|
||||
condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_latch"" == 1)";
|
||||
statement="this animate [""Open_door"", 0]";
|
||||
};
|
||||
class Lock_Door : Open_Door
|
||||
{
|
||||
displayName="Lock Door";
|
||||
displayName=$STR_EPOCH_DOORS_LOCK;
|
||||
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 1)";
|
||||
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_latch"" == 1)";
|
||||
statement="this animate [""Open_latch"", 0]";
|
||||
};
|
||||
class Unlock_Door : Open_Door
|
||||
{
|
||||
displayName="Unlock Door";
|
||||
displayName=$STR_EPOCH_DOORS_UNLOCK;
|
||||
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
|
||||
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_latch"" == 0)";
|
||||
statement="this animate [""Open_latch"", 1]";
|
||||
};
|
||||
class Unlock_Door_Dialog : Open_Door
|
||||
{
|
||||
displayName="Unlock Door";
|
||||
displayName=$STR_EPOCH_DOORS_UNLOCK;
|
||||
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
|
||||
condition=" !keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])";
|
||||
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;createdialog ""ComboLockUI""";
|
||||
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -665,7 +665,7 @@ class CinderWallDoor_DZ: CinderWallDoor_DZ_Base {
|
||||
{
|
||||
class Open_Door
|
||||
{
|
||||
displayName="Open Door";
|
||||
displayName=$STR_EPOCH_DOORS_OPEN;
|
||||
onlyforplayer = true;
|
||||
position="Door_knopf";
|
||||
radius=3; /* visibility distance of the entry */
|
||||
@@ -674,7 +674,7 @@ class CinderWallDoor_DZ: CinderWallDoor_DZ_Base {
|
||||
};
|
||||
class Close_Door : Open_Door
|
||||
{
|
||||
displayName="Close Door";
|
||||
displayName=$STR_EPOCH_DOORS_CLOSE;
|
||||
condition="this animationPhase ""Open_door"" >= 0.5";
|
||||
statement="this animate [""Open_door"", 0]";
|
||||
};
|
||||
@@ -708,7 +708,7 @@ class CinderWallDoorSmallLocked_DZ: CinderWallDoorLocked_DZ_Base {
|
||||
{
|
||||
class Open_Door
|
||||
{
|
||||
displayName="Open Door";
|
||||
displayName=$STR_EPOCH_DOORS_OPEN;
|
||||
onlyforplayer = true;
|
||||
position="Door_knopf";
|
||||
radius=3; /* visibility distance of the entry */
|
||||
@@ -718,31 +718,31 @@ class CinderWallDoorSmallLocked_DZ: CinderWallDoorLocked_DZ_Base {
|
||||
};
|
||||
class Close_Door : Open_Door
|
||||
{
|
||||
displayName="Close Door";
|
||||
displayName=$STR_EPOCH_DOORS_CLOSE;
|
||||
//condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_hinge"" == 1)";
|
||||
condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_latch"" == 1)";
|
||||
statement="this animate [""Open_door"", 0]";
|
||||
};
|
||||
class Lock_Door : Open_Door
|
||||
{
|
||||
displayName="Lock Door";
|
||||
displayName=$STR_EPOCH_DOORS_LOCK;
|
||||
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 1)";
|
||||
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_latch"" == 1)";
|
||||
statement="this animate [""Open_latch"", 0]";
|
||||
};
|
||||
class Unlock_Door : Open_Door
|
||||
{
|
||||
displayName="Unlock Door";
|
||||
displayName=$STR_EPOCH_DOORS_UNLOCK;
|
||||
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
|
||||
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_latch"" == 0)";
|
||||
statement="this animate [""Open_latch"", 1]";
|
||||
};
|
||||
class Unlock_Door_Dialog : Open_Door
|
||||
{
|
||||
displayName="Unlock Door";
|
||||
displayName=$STR_EPOCH_DOORS_UNLOCK;
|
||||
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
|
||||
condition=" !keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])";
|
||||
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;createdialog ""ComboLockUI""";
|
||||
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -765,10 +765,10 @@ class CinderWallDoorSmall_DZ: CinderWallDoor_DZ_Base {
|
||||
|
||||
/* The entry to the actionmenu */
|
||||
class UserActions
|
||||
{
|
||||
{
|
||||
class Open_Door
|
||||
{
|
||||
displayName="Open Door";
|
||||
displayName=$STR_EPOCH_DOORS_OPEN;
|
||||
onlyforplayer = true;
|
||||
position="Door_knopf";
|
||||
radius=3; /* visibility distance of the entry */
|
||||
@@ -777,7 +777,7 @@ class CinderWallDoorSmall_DZ: CinderWallDoor_DZ_Base {
|
||||
};
|
||||
class Close_Door : Open_Door
|
||||
{
|
||||
displayName="Close Door";
|
||||
displayName=$STR_EPOCH_DOORS_CLOSE;
|
||||
condition="this animationPhase ""Open_door"" >= 0.5";
|
||||
statement="this animate [""Open_door"", 0]";
|
||||
};
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
class DoorAccess
|
||||
{
|
||||
idd = 61144;
|
||||
movingenable = 0;
|
||||
|
||||
onLoad = "keypadCancel = true;";
|
||||
onUnload = "if(keypadCancel) then {DZE_Lock_Door = ''; [] spawn keyPadReset;} else {DZE_Lock_Door = dayz_playerUID;};";
|
||||
|
||||
class Controls
|
||||
{
|
||||
class ZupaBackground_1
|
||||
{
|
||||
access = 0;
|
||||
type = 0;
|
||||
colorText[] = {0.8784,0.8471,0.651,1};
|
||||
text = "";
|
||||
fixedWidth = 0;
|
||||
style = 0;
|
||||
shadow = 2;
|
||||
font = "Zeppelin32";
|
||||
SizeEx = 0.03921;
|
||||
idc = -1;
|
||||
x = 0.35 * safezoneW + safezoneX;
|
||||
y = 0.30 * safezoneH + safezoneY;
|
||||
w = 0.20 * safezoneW;
|
||||
h = 0.50 * safezoneH;
|
||||
colorBackground[] = {0,0,0,0.8};
|
||||
};
|
||||
|
||||
class ZupaHeader_2: ZSC_RscTextT
|
||||
{
|
||||
idc = -1;
|
||||
x = 0.35 * safezoneW + safezoneX;
|
||||
y = 0.30 * safezoneH + safezoneY;
|
||||
w = 0.20 * safezoneW;
|
||||
h = 0.05 * safezoneH;
|
||||
text = $STR_EPOCH_DOORACCESS_TITLE;
|
||||
colorBackground[] = {0,0,0,0.8};
|
||||
colorText[] = {1,1,1,1};
|
||||
};
|
||||
|
||||
|
||||
class ZupaButton_1 : ZSC_RscButtonMenuBlue
|
||||
{
|
||||
idc = -1;
|
||||
text = $STR_EPOCH_DOORACCESS_SCAN;
|
||||
x = 0.40 * safezoneW + safezoneX;
|
||||
y = 0.40 * safezoneH + safezoneY;
|
||||
style = 2;
|
||||
w = 0.20;
|
||||
onButtonClick = "keypadCancel = false; call player_unlockDoor";
|
||||
};
|
||||
|
||||
class ZupaButton_4 : ZSC_RscButtonMenuBlue
|
||||
{
|
||||
idc = -1;
|
||||
text = $STR_EPOCH_DOORACCESS_MANUAL;
|
||||
x = 0.40 * safezoneW + safezoneX;
|
||||
y = 0.50 * safezoneH + safezoneY;
|
||||
style = 2;
|
||||
w = 0.20;
|
||||
onButtonClick = "call player_enterCode";
|
||||
};
|
||||
|
||||
class ZupaButton_2: ZSC_RscButtonMenuBlue
|
||||
{
|
||||
idc = -1;
|
||||
text = $STR_EPOCH_CANCEL;
|
||||
x = 0.40 * safezoneW + safezoneX;
|
||||
y = 0.70 * safezoneH + safezoneY;
|
||||
w = 0.20;
|
||||
onButtonClick = "((ctrlParent (_this select 0)) closeDisplay 3000);";
|
||||
};
|
||||
|
||||
class ZupaButton_3: ZSC_RscButtonMenuBlue
|
||||
{
|
||||
idc = -1;
|
||||
text = $STR_EPOCH_ACTIONS_MANAGEDOOR;
|
||||
x = 0.40 * safezoneW + safezoneX;
|
||||
y = 0.60 * safezoneH + safezoneY;
|
||||
w = 0.20;
|
||||
onButtonClick = "[] call player_manageDoor";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,97 @@
|
||||
class DoorManagement
|
||||
{
|
||||
idd = 711195;
|
||||
onLoad = "uiNamespace setVariable ['DoorManagement', _this select 0]";
|
||||
class Controls {
|
||||
class RscText_7100: ZSC_RscTextT
|
||||
{
|
||||
idc = 7100;
|
||||
x = 0.30 * safezoneW + safezoneX;
|
||||
y = 0.30 * safezoneH + safezoneY;
|
||||
w = 0.30 * safezoneW;
|
||||
h = 0.5 * safezoneH;
|
||||
colorBackground[] = {0,0,0,0.8};
|
||||
};
|
||||
class RscListbox_7101: RscListbox
|
||||
{
|
||||
idc = 7101;
|
||||
x = 0.31* safezoneW + safezoneX;
|
||||
y = 0.41 * safezoneH + safezoneY;
|
||||
w = 0.13 * safezoneW;
|
||||
h = 0.30 * safezoneH;
|
||||
soundSelect[] = {"",0.1,1};
|
||||
colorBackground[] = {0.1,0.1,0.1,0.8};
|
||||
};
|
||||
class RscListbox_7102: RscListbox
|
||||
{
|
||||
idc = 7102;
|
||||
x = 0.45 * safezoneW + safezoneX;
|
||||
y = 0.41* safezoneH + safezoneY;
|
||||
w = 0.13 * safezoneW;
|
||||
h = 0.30 * safezoneH;
|
||||
soundSelect[] = {"",0.1,1};
|
||||
colorBackground[] = {0.1,0.1,0.1,0.8};
|
||||
};
|
||||
class RscShortcutButton_7104: ZSC_RscButtonMenuBlue
|
||||
{
|
||||
idc = 7104;
|
||||
text = $STR_EPOCH_ADD;
|
||||
x = 0.33 * safezoneW + safezoneX;
|
||||
y = 0.70 * safezoneH + safezoneY;
|
||||
w = 0.08 * safezoneW;
|
||||
//h = 0.06 * safezoneH;
|
||||
onButtonClick = "[(lbCurSel 7101)] call DoorAddFriend;";
|
||||
};
|
||||
class RscShortcutButton_7105: ZSC_RscButtonMenuBlue
|
||||
{
|
||||
idc = 7105;
|
||||
text = $STR_EPOCH_DELETE;
|
||||
x = 0.47 * safezoneW + safezoneX;
|
||||
y = 0.70 * safezoneH + safezoneY;
|
||||
w = 0.08 * safezoneW;
|
||||
//h = 0.06 * safezoneH;
|
||||
onButtonClick = "[(lbCurSel 7102)] call DoorRemoveFriend;";
|
||||
};
|
||||
class RscShortcutButton_7106: ZSC_RscButtonMenuBlue
|
||||
{
|
||||
idc = 7106;
|
||||
text = $STR_UI_CLOSE;
|
||||
x = 0.40 * safezoneW + safezoneX;
|
||||
y = 0.74 * safezoneH + safezoneY;
|
||||
w = 0.08 * safezoneW;
|
||||
//h = 0.06 * safezoneH;
|
||||
onButtonClick = "((ctrlParent (_this select 0)) closeDisplay 9000);";
|
||||
};
|
||||
class RscText_7107: ZSC_RscTextT
|
||||
{
|
||||
idc = 7107;
|
||||
text = $STR_EPOCH_DOORMANAGEMENT_TITLE;
|
||||
x = 0.30 * safezoneW + safezoneX;
|
||||
y = 0.30 * safezoneH + safezoneY;
|
||||
w = 0.30 * safezoneW;
|
||||
h = 0.05 * safezoneH;
|
||||
colorBackground[] = {0,0,0,0.8};
|
||||
colorText[] = {1,1,1,1};
|
||||
};
|
||||
class RscText_7108: ZSC_RscTextT
|
||||
{
|
||||
idc = 7108;
|
||||
text = $STR_EPOCH_HUMANS_NEARBY;
|
||||
x = 0.31 * safezoneW + safezoneX;
|
||||
y = 0.38 * safezoneH + safezoneY;
|
||||
w = 0.13 * safezoneW;
|
||||
h = 0.03 * safezoneH;
|
||||
colorText[] = {1,1,1,1};
|
||||
};
|
||||
class RscText_7103: ZSC_RscTextT
|
||||
{
|
||||
idc = 71103;
|
||||
text = $STR_EPOCH_DOORMANAGEMENT_FRIENDS;
|
||||
x = 0.45 * safezoneW + safezoneX;
|
||||
y = 0.38 * safezoneH + safezoneY;
|
||||
w = 0.13 * safezoneW;
|
||||
h = 0.03 * safezoneH;
|
||||
colorText[] = {1,1,1,1};
|
||||
};
|
||||
};
|
||||
};
|
||||
22
SQF/dayz_code/actions/doorManagement/doorAddFriend.sqf
Normal file
22
SQF/dayz_code/actions/doorManagement/doorAddFriend.sqf
Normal file
@@ -0,0 +1,22 @@
|
||||
private ["_pos","_plots","_inList"];
|
||||
_pos = _this select 0;
|
||||
if (_pos < 0) exitWith {};
|
||||
_toAdd = (Humans select _pos);
|
||||
_friends = TheDoor getVariable ["doorfriends",[]];
|
||||
_inList = false;
|
||||
{
|
||||
if((_x select 0) == (_toAdd select 0)) exitWith { _inList = true; };
|
||||
} forEach _friends;
|
||||
if(_inList) exitWith { localize "STR_EPOCH_PLOTMANAGEMENT_ADDFRIEND_ALREADYONTHELIST" call dayz_rollingMessages; };
|
||||
if(count _friends >= DZE_doorManagementMaxFriends) exitWith { format[localize "STR_EPOCH_PLOTMANAGEMENT_ADDFRIEND_FRIENDLIMIT", DZE_doorManagementMaxFriends] call dayz_rollingMessages; };
|
||||
_friends set [count _friends, _toAdd];
|
||||
TheDoor setVariable ["doorfriends", _friends, true];
|
||||
PVDZ_veh_Save = [TheDoor,"gear"];
|
||||
if (isServer) then {
|
||||
PVDZ_veh_Save call server_updateObject;
|
||||
} else {
|
||||
publicVariableServer "PVDZ_veh_Save";
|
||||
};
|
||||
|
||||
call DoorGetFriends;
|
||||
call DoorNearbyHumans;
|
||||
6
SQF/dayz_code/actions/doorManagement/doorGetFriends.sqf
Normal file
6
SQF/dayz_code/actions/doorManagement/doorGetFriends.sqf
Normal file
@@ -0,0 +1,6 @@
|
||||
private ["_plots","_friendlies","_thePlot"];
|
||||
lbClear 7102;
|
||||
_friends = TheDoor getVariable ["doorfriends",[]];
|
||||
{
|
||||
lbAdd [7102, (_x select 1)];
|
||||
} forEach _friends;
|
||||
13
SQF/dayz_code/actions/doorManagement/doorNearbyHumans.sqf
Normal file
13
SQF/dayz_code/actions/doorManagement/doorNearbyHumans.sqf
Normal file
@@ -0,0 +1,13 @@
|
||||
private ["_close"];
|
||||
lbClear 7101;
|
||||
_closePeople = player nearEntities ["CAManBase", 10];
|
||||
if (!DZE_doorManagementMustBeClose) then {_closePeople = playableUnits};
|
||||
Humans = [];
|
||||
{
|
||||
if (isPlayer _x) then {
|
||||
_friendUID = [_x] call FNC_GetPlayerUID;
|
||||
_friendName = name _x;
|
||||
Humans set [count Humans, [_friendUID,_friendName]];
|
||||
lbAdd [7101, _friendName];
|
||||
};
|
||||
} forEach _closePeople;
|
||||
21
SQF/dayz_code/actions/doorManagement/doorRemoveFriend.sqf
Normal file
21
SQF/dayz_code/actions/doorManagement/doorRemoveFriend.sqf
Normal file
@@ -0,0 +1,21 @@
|
||||
private ["_list","_plots","_thePlot","_friends"];
|
||||
_pos = _this select 0;
|
||||
if (_pos < 0) exitWith {};
|
||||
_friends = TheDoor getVariable ["doorfriends", []];
|
||||
_toRemove = (_friends select _pos);
|
||||
_newList = [];
|
||||
{
|
||||
if(_x select 0 != _toRemove select 0) then {
|
||||
_newList set [count _newList, _x ];
|
||||
};
|
||||
} forEach _friends;
|
||||
TheDoor setVariable ["doorfriends", _newList, true];
|
||||
PVDZ_veh_Save = [TheDoor, "gear"];
|
||||
if (isServer) then {
|
||||
PVDZ_veh_Save call server_updateObject;
|
||||
} else {
|
||||
publicVariableServer "PVDZ_veh_Save";
|
||||
};
|
||||
|
||||
call DoorGetFriends;
|
||||
call DoorNearbyHumans;
|
||||
29
SQF/dayz_code/actions/doorManagement/initDoorManagement.sqf
Normal file
29
SQF/dayz_code/actions/doorManagement/initDoorManagement.sqf
Normal file
@@ -0,0 +1,29 @@
|
||||
disableSerialization;
|
||||
if(count(_this) > 0) then
|
||||
{
|
||||
TheDoor = _this select 3;
|
||||
} else {
|
||||
TheDoor = dayz_selectedDoor;
|
||||
};
|
||||
|
||||
// close DoorAccess if open
|
||||
_display = findDisplay 61144;
|
||||
_display closeDisplay 3000;
|
||||
|
||||
// Check player access
|
||||
_isowner = [player, TheDoor] call FNC_check_access;
|
||||
if( ((_isowner select 0) && DZE_doorManagementAllowManage_owner) // door owner
|
||||
|| ((_isowner select 1) && DZE_doorManagementAllowManage_ownerFriendlies) // door owner's friendly tagged
|
||||
|| ((_isowner select 2) && DZE_doorManagementAllowManage_plotOwner) // plot owner
|
||||
|| ((_isowner select 3) && DZE_doorManagementAllowManage_plotFriends) // plot friends
|
||||
|| ((_isowner select 4) && DZE_doorManagementAllowManage_plotAdmins) // plot management admins
|
||||
|| ((_isowner select 5) && DZE_doorManagementAllowManage_doorFriends) // door friends
|
||||
|| ((_isowner select 6) && DZE_doorManagementAllowManage_doorAdmins) // door management admins
|
||||
) then {
|
||||
createDialog "DoorManagement";
|
||||
call DoorNearbyHumans;
|
||||
call DoorGetFriends;
|
||||
} else {
|
||||
localize "STR_EPOCH_DOORMANAGEMENT_NORIGHTS" call dayz_rollingMessages;
|
||||
};
|
||||
|
||||
13
SQF/dayz_code/actions/doorManagement/player_enterCode.sqf
Normal file
13
SQF/dayz_code/actions/doorManagement/player_enterCode.sqf
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
// Close DoorAccess
|
||||
_display = findDisplay 61144;
|
||||
_display closeDisplay 3000;
|
||||
if(DZE_doorManagementAllowManualCode) then {
|
||||
//DZE_Lock_Door != (this getvariable['CharacterID','0']);
|
||||
DZE_topCombo = 0;
|
||||
DZE_midCombo = 0;
|
||||
DZE_botCombo = 0;
|
||||
createDialog "ComboLockUI";
|
||||
} else {
|
||||
localize "STR_EPOCH_DOORACCESS_NOMANUAL" call dayz_rollingMessages;
|
||||
};
|
||||
@@ -5,9 +5,9 @@ if (!DZE_plotManagementMustBeClose) then {_closePeople = playableUnits};
|
||||
Humans = [];
|
||||
{
|
||||
if (isPlayer _x) then {
|
||||
_friendUID = getPlayerUID _x;
|
||||
_friendUID = [_x] call FNC_GetPlayerUID;
|
||||
_friendName = name _x;
|
||||
Humans = Humans + [[_friendUID,_friendName]] ;
|
||||
Humans = Humans + [[_friendUID,_friendName]];
|
||||
lbAdd [7001, _friendName];
|
||||
};
|
||||
} forEach _closePeople; // count causes Error Type Number, expected Bool here
|
||||
@@ -42,15 +42,23 @@ if (DZE_permanentPlot) then {
|
||||
|
||||
_playerUID = [_player] call FNC_GetPlayerUID;
|
||||
_targetOwner = _target getVariable ["ownerPUID","0"];
|
||||
_owner = (_playerUID == _targetOwner);
|
||||
|
||||
// Check if player is a plot friend
|
||||
if (_playerUID in _friendlies) then {
|
||||
_friendly = true;
|
||||
};
|
||||
} else {
|
||||
_playerUID = dayz_characterID;
|
||||
_friendlies = _player getVariable ["friendlyTo",[]];
|
||||
_targetOwner = _target getVariable ["CharacterID","0"];
|
||||
_owner = (_targetOwner == dayz_characterID);
|
||||
|
||||
// Check if target object owner is a friend of player
|
||||
if (_targetOwner in _friendlies) then {
|
||||
_friendly = true;
|
||||
};
|
||||
};
|
||||
|
||||
if (_targetOwner in _friendlies) then {
|
||||
_friendly = true;
|
||||
};
|
||||
// Check if player is owner of target object
|
||||
_owner = (_playerUID == _targetOwner);
|
||||
|
||||
[_owner, _friendly]
|
||||
145
SQF/dayz_code/compile/doorManagement/fn_check_access.sqf
Normal file
145
SQF/dayz_code/compile/doorManagement/fn_check_access.sqf
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
Check object's ownership and friends (plot and door)
|
||||
Original concept by RimBlock (github.com/RimBlock)
|
||||
|
||||
Extended by Bruce-LXXVI to support different target objects
|
||||
and allow fine grained access policies
|
||||
|
||||
Parameters:
|
||||
_this select 0: object - player calling this function
|
||||
_this select 1: object - target to check ownership and friendlies of
|
||||
|
||||
Returns:
|
||||
_return select 0: bool - player is owner of target object
|
||||
_return select 1: bool - player is friends with owner of target object
|
||||
_return select 2: bool - player is plot owner
|
||||
_return select 3: bool - player is plot friend
|
||||
_return select 4: bool - player is plot management admin
|
||||
_return select 5: bool - player is target friend
|
||||
_return select 6: bool - player is target management admin
|
||||
_return select 7: string - detected target type
|
||||
|
||||
|
||||
2,3,4: always false if no plot nearby
|
||||
5,6: always false if _target is not a supported target
|
||||
*/
|
||||
|
||||
private [
|
||||
"_player" // Player, who wants to access the _target
|
||||
,"_target" // The target object the _player wants to access
|
||||
,"_isOwner" // return value
|
||||
,"_isFriendly" // return value
|
||||
,"_isPlotOwner" // return value
|
||||
,"_isPlotFriend" // return value
|
||||
,"_isPlotAdmin" // return value
|
||||
,"_isTargetFriend" // return value
|
||||
,"_isTargetAdmin" // return value
|
||||
,"_targetType" // return value
|
||||
,"_targetOwnerUID" // UID or characterID of the owner of _target
|
||||
,"_playerUID" // UID of the _player
|
||||
,"_characterID" // characterID of the _player
|
||||
,"_plotcheck" // takes return value of FNC_find_plots
|
||||
,"_isNearPlot" // player is in plot's reach
|
||||
,"_nearestPlot" // plot object
|
||||
,"_plotOwnerUID" // plot owner's UID
|
||||
,"_plotFriends" // list of plot friends [["UID", "Name"], ..]
|
||||
,"_targetFriends" // list of target friends [["UID", "Name"], ..]
|
||||
];
|
||||
|
||||
|
||||
// assign parameters
|
||||
_player = _this select 0;
|
||||
_target = _this select 1;
|
||||
|
||||
// Initialize return values
|
||||
_isOwner = false;
|
||||
_isFriendly = false;
|
||||
_isPlotOwner = false;
|
||||
_isPlotFriend = false;
|
||||
_isPlotAdmin = false;
|
||||
_isTargetFriend = false;
|
||||
_isTargetAdmin = false;
|
||||
_targetType = "";
|
||||
|
||||
|
||||
// determine target type
|
||||
_targetType = if(typeOf _target in DZE_DoorsLocked) then { "DOOR"; } else { "GENERIC"; };
|
||||
|
||||
|
||||
// determine owner and player id
|
||||
// and check if player is owner of target object
|
||||
_playerUID = [_player] call FNC_GetPlayerUID;
|
||||
_characterID = dayz_characterID;
|
||||
if(DZE_permanentPlot) then {
|
||||
_targetOwnerUID = _target getVariable ["ownerPUID","0"];
|
||||
_isOwner = (_playerUID == _targetOwnerUID);
|
||||
} else {
|
||||
_targetOwnerUID = _target getVariable ["characterID","0"];
|
||||
_isOwner = (_characterID == _targetOwnerUID);
|
||||
};
|
||||
|
||||
|
||||
// determine _players friends (tagged)
|
||||
// and check if owner of _target is tagged friendly
|
||||
_friendlies = _player getVariable ["friendlyTo",[]];
|
||||
_isFriendly = (_targetOwnerUID in _friendlies);
|
||||
|
||||
|
||||
// find nearest plot
|
||||
_plotcheck = [_player, false] call FNC_find_plots;
|
||||
_isNearPlot = ((_plotcheck select 1) > 0);
|
||||
_nearestPlot = _plotcheck select 2;
|
||||
if(_isNearPlot) then {
|
||||
// determine plot owner
|
||||
// and check if player is owner of plot
|
||||
if (DZE_permanentPlot) then {
|
||||
_plotOwnerUID = _nearestPlot getVariable ["ownerPUID","0"];
|
||||
_isPlotOwner = (_playerUID == _plotOwnerUID);
|
||||
} else {
|
||||
_plotOwnerUID = _nearestPlot getVariable ["characterID","0"];
|
||||
_isPlotOwner = (_characterID == _plotOwnerUID);
|
||||
};
|
||||
|
||||
|
||||
// determine plot friends
|
||||
// and check if player is one of them
|
||||
_isPlotFriend = _isPlotOwner; // Plot owner is always a plot friend
|
||||
_plotFriends = _nearestPlot getVariable ["plotfriends", []];
|
||||
{
|
||||
if( (_x select 0) == _playerUID ) then { _isPlotFriend = true; };
|
||||
} count _plotFriends;
|
||||
|
||||
|
||||
// determine plot management admins
|
||||
// and check if player is one of them
|
||||
if(_playerUID in DZE_PlotManagementAdmins) then { _isPlotAdmin = true; };
|
||||
};
|
||||
|
||||
|
||||
// Process target type DOOR
|
||||
if(_targetType == "DOOR") then {
|
||||
// determine door friends
|
||||
// and check if player is one of them
|
||||
_isTargetFriend = _isOwner; // Door owner is always a door friend
|
||||
_targetFriends = _target getVariable ["doorfriends",[]];
|
||||
{
|
||||
if( (_x select 0) == _playerUID ) then { _isTargetFriend = true; };
|
||||
} count _targetFriends;
|
||||
|
||||
|
||||
// determine door management admins
|
||||
// and check if player is one of them
|
||||
if(_playerUID in DZE_DoorManagementAdmins) then { _isTargetAdmin = true; };
|
||||
};
|
||||
|
||||
|
||||
// RESULT
|
||||
[ _isOwner
|
||||
, _isFriendly
|
||||
, _isPlotOwner
|
||||
, _isPlotFriend
|
||||
, _isPlotAdmin
|
||||
, _isTargetFriend
|
||||
, _isTargetAdmin
|
||||
, _targetType
|
||||
]
|
||||
@@ -767,6 +767,26 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
|
||||
s_player_SurrenderedGear = -1;
|
||||
};
|
||||
|
||||
// Allow manage door
|
||||
if( DZE_doorManagement && (_typeOfCursorTarget in DZE_DoorsLocked) ) then {
|
||||
// Check player access
|
||||
_isowner = [player, _cursorTarget] call FNC_check_access;
|
||||
if( (s_player_manageDoor < 0) && (
|
||||
((_isowner select 0) && DZE_doorManagementAllowManage_owner) // door owner
|
||||
|| ((_isowner select 1) && DZE_doorManagementAllowManage_ownerFriendlies) // door owner's friendly tagged
|
||||
|| ((_isowner select 2) && DZE_doorManagementAllowManage_plotOwner) // plot owner
|
||||
|| ((_isowner select 3) && DZE_doorManagementAllowManage_plotFriends) // plot friends
|
||||
|| ((_isowner select 4) && DZE_doorManagementAllowManage_plotAdmins) // plot management admins
|
||||
|| ((_isowner select 5) && DZE_doorManagementAllowManage_doorFriends) // door friends
|
||||
|| ((_isowner select 6) && DZE_doorManagementAllowManage_doorAdmins) // door management admins
|
||||
)) then {
|
||||
s_player_manageDoor = player addAction [format["<t color='#0059FF'>%1</t>", localize "STR_EPOCH_ACTIONS_MANAGEDOOR"], "\z\addons\dayz_code\actions\doorManagement\initDoorManagement.sqf", _cursorTarget, 5, false];
|
||||
};
|
||||
} else {
|
||||
player removeAction s_player_manageDoor;
|
||||
s_player_manageDoor = -1;
|
||||
};
|
||||
|
||||
//Allow owner to unlock vault
|
||||
if ((_typeOfCursorTarget in DZE_LockableStorage) && {_characterID != "0"} && {player distance _cursorTarget < 3} && {!keypadCancel}) then {
|
||||
if (s_player_unlockvault < 0) then {
|
||||
@@ -809,7 +829,7 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
|
||||
s_player_lockvault = -1;
|
||||
};
|
||||
|
||||
//Player Deaths
|
||||
//Player Deaths
|
||||
if (_typeOfCursorTarget == "Info_Board_EP1") then {
|
||||
if (s_player_information < 0) then {
|
||||
s_player_information = player addAction [localize "STR_EPOCH_ACTIONS_MURDERS", "\z\addons\dayz_code\actions\list_playerDeaths.sqf",[], 7, false, true];
|
||||
@@ -1170,6 +1190,8 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
|
||||
s_player_fuelauto = -1;
|
||||
player removeAction s_player_fuelauto2;
|
||||
s_player_fuelauto2 = -1;
|
||||
player removeAction s_player_manageDoor;
|
||||
s_player_manageDoor = -1;
|
||||
};
|
||||
|
||||
//Dog actions on player self
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
DayZ Unlock Door
|
||||
Usage: [_obj] call player_unlockDoor;
|
||||
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
|
||||
Modified for Zupa's DoorManagement.
|
||||
*/
|
||||
private ["_display","_obj","_objectCharacterID"];
|
||||
|
||||
@@ -9,6 +10,13 @@ if (!isNil "DZE_DYN_UnlockDoorInprogress") exitWith {localize "str_epoch_player_
|
||||
|
||||
DZE_DYN_UnlockDoorInprogress = true;
|
||||
|
||||
// find display and check the door opening method
|
||||
_doorMethod = '';
|
||||
_displayCombo = findDisplay 41144;
|
||||
_displayEye = findDisplay 61144;
|
||||
if(!isNull _displayEye) then {_display = _displayEye; _doorMethod = "Eye";};
|
||||
if(!isNull _displayCombo) then {_display = _displayCombo; _doorMethod = "Combo";};
|
||||
|
||||
if (!isNull dayz_selectedDoor) then {
|
||||
if (!isNil 'KeyCodeTryTimer') then {
|
||||
if (diag_tickTime > KeyCodeTryTimer) then {
|
||||
@@ -16,25 +24,40 @@ if (!isNull dayz_selectedDoor) then {
|
||||
KeyCodeTryTimer = nil;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
_obj = dayz_selectedDoor; // our target
|
||||
_notNearestPlayer = _obj call dze_isnearest_player;
|
||||
|
||||
|
||||
if (_notNearestPlayer) then {
|
||||
// close display since another player is closer
|
||||
_display = findDisplay 41144;
|
||||
_display closeDisplay 3000;
|
||||
localize "STR_EPOCH_ACTIONS_16" call dayz_rollingMessages;
|
||||
} else {
|
||||
// get object combination
|
||||
_objectCharacterID = _obj getVariable ["CharacterID","0"];
|
||||
|
||||
|
||||
if(DZE_doorManagement) then {
|
||||
// Check player access
|
||||
_isowner = [player, _obj] call FNC_check_access;
|
||||
if( ((_isowner select 0) && DZE_doorManagementAllowAccess_owner) // door owner
|
||||
|| ((_isowner select 1) && DZE_doorManagementAllowAccess_ownerFriendlies) // door owner's friendly tagged
|
||||
|| ((_isowner select 2) && DZE_doorManagementAllowAccess_plotOwner) // plot owner
|
||||
|| ((_isowner select 3) && DZE_doorManagementAllowAccess_plotFriends) // plot friends
|
||||
|| ((_isowner select 4) && DZE_doorManagementAllowAccess_plotAdmins) // plot management admins
|
||||
|| ((_isowner select 5) && DZE_doorManagementAllowAccess_doorFriends) // door friends
|
||||
|| ((_isowner select 6) && DZE_doorManagementAllowAccess_doorAdmins) // door management admins
|
||||
) then {
|
||||
DZE_Lock_Door = dayz_selectedDoor getVariable['CharacterID','0'];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Check combination
|
||||
if (DZE_Lock_Door == _objectCharacterID) then {
|
||||
[player,"combo_unlock",0,false] call dayz_zombieSpeak;
|
||||
|
||||
// close display
|
||||
_display = findDisplay 41144;
|
||||
_display closeDisplay 3000;
|
||||
|
||||
// unlock if locked
|
||||
@@ -44,6 +67,11 @@ if (!isNull dayz_selectedDoor) then {
|
||||
if (_obj animationPhase "Open_latch" == 0) then {
|
||||
_obj animate ["Open_latch", 1];
|
||||
};
|
||||
|
||||
if(_doorMethod == "Eye") then {
|
||||
localize "STR_EPOCH_DOORACCESS_SUCCESS" call dayz_rollingMessages;
|
||||
};
|
||||
|
||||
KeyCodeTry = nil;
|
||||
} else {
|
||||
["Working",0,[100,15,10,0]] call dayz_NutritionSystem;
|
||||
@@ -58,14 +86,17 @@ if (!isNull dayz_selectedDoor) then {
|
||||
if (KeyCodeTry >= ((round(random 4)) + 4)) then {
|
||||
if (isNil 'KeyCodeTryTimer') then {KeyCodeTryTimer = diag_tickTime+10;};
|
||||
localize "str_epoch_player_19" call dayz_rollingMessages;
|
||||
_display = findDisplay 41144;
|
||||
_display closeDisplay 3000;
|
||||
};
|
||||
|
||||
if(_doorMethod == "Eye") then {
|
||||
localize "STR_EPOCH_DOORACCESS_FAILURE" call dayz_rollingMessages;
|
||||
_display closeDisplay 3000;
|
||||
};
|
||||
};
|
||||
};
|
||||
} else {
|
||||
// close display since no target
|
||||
_display = findDisplay 41144;
|
||||
_display closeDisplay 3000;
|
||||
};
|
||||
DZE_DYN_UnlockDoorInprogress = nil;
|
||||
@@ -115,4 +115,7 @@ class CfgAddons
|
||||
#include "Configs\RscDisplay\plotManagement.hpp"
|
||||
#include "Configs\RscDisplay\deathboards.hpp"
|
||||
#include "Configs\CfgExtra\snappoints.hpp"
|
||||
#include "external\R3F_Realism\R3F_Weight\R3F_CfgWeight.hpp"
|
||||
#include "external\R3F_Realism\R3F_Weight\R3F_CfgWeight.hpp"
|
||||
#include "Configs\RscDisplay\doorManagement\doorManagement.hpp"
|
||||
#include "Configs\RscDisplay\doorManagement\doorAccess.hpp"
|
||||
|
||||
|
||||
@@ -75,6 +75,31 @@ DZE_buildMaxMoveDistance = 10; // Max distance player can walk from start positi
|
||||
DZE_buildMaxHeightDistance = 10; // Max distance player can raise or lower object from start position when building.
|
||||
|
||||
|
||||
/////////// doorManagement Variables ///////////
|
||||
// Let owner and plot friends and door friends manage door access
|
||||
DZE_doorManagement = true;
|
||||
DZE_doorManagementMustBeClose = true; //Players must be within 10m of door to be added as a door friend.
|
||||
DZE_doorManagementAdmins = []; //Array of admin PlayerUIDs enclosed in quotations, UIDs in this list are able to access every door's management menu and open it
|
||||
DZE_doorManagementAllowManualCode = true; //Allows opening doors still using PIN
|
||||
DZE_doorManagementMaxFriends = 10; //Maximum number of friends allowed on a door. (default 10)
|
||||
// Set access rights (unlock) for doors
|
||||
DZE_doorManagementAllowAccess_owner = true;
|
||||
DZE_doorManagementAllowAccess_ownerFriendlies = false;
|
||||
DZE_doorManagementAllowAccess_plotOwner = false;
|
||||
DZE_doorManagementAllowAccess_plotFriends = false;
|
||||
DZE_doorManagementAllowAccess_plotAdmins = false;
|
||||
DZE_doorManagementAllowAccess_doorFriends = true;
|
||||
DZE_doorManagementAllowAccess_doorAdmins = true;
|
||||
// Set management rights for doors (beware that managers can add theirselves and others as door friends)
|
||||
DZE_doorManagementAllowManage_owner = true;
|
||||
DZE_doorManagementAllowManage_ownerFriendlies = false;
|
||||
DZE_doorManagementAllowManage_plotOwner = false;
|
||||
DZE_doorManagementAllowManage_plotFriends = false;
|
||||
DZE_doorManagementAllowManage_plotAdmins = false;
|
||||
DZE_doorManagementAllowManage_doorFriends = false;
|
||||
DZE_doorManagementAllowManage_doorAdmins = true;
|
||||
|
||||
|
||||
/*
|
||||
Developers:
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ if (!isDedicated) then {
|
||||
fnc_SetPitchBankYaw = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BuildVectors\fnc_SetPitchBankYaw.sqf";
|
||||
FNC_check_owner_friends = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\A_Plot_for_Life\fn_check_owner_friends.sqf";
|
||||
FNC_find_plots = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\A_Plot_for_Life\fn_find_plots.sqf";
|
||||
|
||||
|
||||
player_buildVanilla = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_buildVanilla.sqf";
|
||||
fn_buildCamera = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildCamera.sqf";
|
||||
object_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\object_build.sqf";
|
||||
@@ -190,7 +190,14 @@ if (!isDedicated) then {
|
||||
PlotObjects = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\plotManagement\plotObjects.sqf";
|
||||
PlotPreview = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\plotManagement\plotToggleMarkers.sqf";
|
||||
MaintainPlot = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\plotManagement\maintain_area.sqf"; // use maintain_areaSC.sqf for single currency
|
||||
|
||||
DoorGetFriends = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\doorManagement\doorGetFriends.sqf";
|
||||
DoorNearbyHumans = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\doorManagement\doorNearbyHumans.sqf";
|
||||
DoorAddFriend = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\doorManagement\doorAddFriend.sqf";
|
||||
DoorRemoveFriend = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\doorManagement\doorRemoveFriend.sqf";
|
||||
player_manageDoor = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\doorManagement\initDoorManagement.sqf";
|
||||
player_enterCode = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\doorManagement\player_enterCode.sqf";
|
||||
FNC_check_access = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\doorManagement\fn_check_access.sqf";
|
||||
|
||||
dayz_losChance = {
|
||||
private["_agent","_maxDis","_dis","_val","_maxExp","_myExp"];
|
||||
_agent = _this select 0;
|
||||
|
||||
@@ -240,9 +240,9 @@ dayz_resetSelfActions = {
|
||||
s_player_lockUnlock_crtl = -1;
|
||||
s_player_lockUnlockInside_ctrl = -1;
|
||||
s_player_toggleSnap = -1;
|
||||
s_player_toggleSnapSelect = -1;
|
||||
s_player_toggleSnapSelectPoint = [];
|
||||
snapActions = -1;
|
||||
s_player_toggleSnapSelect = -1;
|
||||
s_player_toggleSnapSelectPoint = [];
|
||||
snapActions = -1;
|
||||
s_player_plot_boundary_on = -1;
|
||||
s_player_plot_boundary_off = -1;
|
||||
s_player_plot_take_ownership = -1;
|
||||
@@ -253,6 +253,7 @@ dayz_resetSelfActions = {
|
||||
s_player_toggleVector = -1;
|
||||
s_player_toggleVectors=[];
|
||||
vectorActions = -1;
|
||||
s_player_manageDoor = -1;
|
||||
};
|
||||
call dayz_resetSelfActions;
|
||||
|
||||
|
||||
@@ -15955,10 +15955,12 @@
|
||||
<Key ID="STR_EPOCH_PLOTMANAGEMENT_ADDFRIEND_ALREADYONTHELIST">
|
||||
<English>Already on the list</English>
|
||||
<Russian>Уже в списке друзей</Russian>
|
||||
<German>Schon auf der Liste</German>
|
||||
</Key>
|
||||
<Key ID="STR_EPOCH_PLOTMANAGEMENT_ADDFRIEND_FRIENDLIMIT">
|
||||
<English>Only %1 friends allowed</English>
|
||||
<Russian>Можно добавить друзей: %1</Russian>
|
||||
<German>Nur %1 Freunde erlaubt</German>
|
||||
</Key>
|
||||
<Key ID="STR_EPOCH_TRADER">
|
||||
<English>Trader</English>
|
||||
@@ -17584,6 +17586,7 @@
|
||||
</Key>
|
||||
<Key ID="STR_EPOCH_HUMANS_NEARBY">
|
||||
<English>Humans Nearby</English>
|
||||
<German>Spieler in der Nähe</German>
|
||||
</Key>
|
||||
<Key ID="STR_EPOCH_PLOT_FRIENDS">
|
||||
<English>Plot Friends</English>
|
||||
@@ -17600,5 +17603,75 @@
|
||||
<Key ID="STR_EPOCH_BUILD_FAIL_TOO_FAR">
|
||||
<English>Object is placed too far away from where you started building (within %1 meters)</English>
|
||||
</Key>
|
||||
<Key ID="STR_EPOCH_ACTIONS_MANAGEDOOR">
|
||||
<English>Manage Door</English>
|
||||
<German>Tür verwalten</German>
|
||||
</Key>
|
||||
|
||||
<Key ID="STR_EPOCH_DOORACCESS_TITLE">
|
||||
<English>Door Access Terminal</English>
|
||||
<German>Zutrittssystem</German>
|
||||
</Key>
|
||||
<Key ID="STR_EPOCH_DOORACCESS_SCAN">
|
||||
<English>Eye Scan</English>
|
||||
<German>Auge scannnen</German>
|
||||
</Key>
|
||||
<Key ID="STR_EPOCH_DOORACCESS_MANUAL">
|
||||
<English>Manual Code</English>
|
||||
<German>PIN manuell eingeben</German>
|
||||
</Key>
|
||||
<Key ID="STR_EPOCH_DOORACCESS_SUCCESS">
|
||||
<English>Eye Scan SUCCESS</English>
|
||||
<German>Iris-Scan ERFOLGREICH</German>
|
||||
</Key>
|
||||
<Key ID="STR_EPOCH_DOORACCESS_FAILURE">
|
||||
<English>Eye Scan FAILED</English>
|
||||
<German>Iris-Scan FEHLGESCHLAGEN</German>
|
||||
</Key>
|
||||
<Key ID="STR_EPOCH_DOORACCESS_NOMANUAL">
|
||||
<English>We do not allow manual codes.</English>
|
||||
<German>Die manuelle Eingabe ist nicht erlaubt.</German>
|
||||
</Key>
|
||||
|
||||
<Key ID="STR_EPOCH_DOORMANAGEMENT_TITLE">
|
||||
<English>Door Management</English>
|
||||
<German>Tür-Management</German>
|
||||
</Key>
|
||||
<Key ID="STR_EPOCH_DOORMANAGEMENT_FRIENDS">
|
||||
<English>Door Friends</English>
|
||||
<German>Tür-Freunde</German>
|
||||
</Key>
|
||||
<Key ID="STR_EPOCH_DOORMANAGEMENT_NORIGHTS">
|
||||
<English>You do not have the rights to manage.</English>
|
||||
<German>Du darfst diese Tür nicht verwalten.</German>
|
||||
</Key>
|
||||
|
||||
<Key ID="STR_EPOCH_DOORS_OPEN">
|
||||
<English>Open Door</English>
|
||||
<German>Tür öffnen</German>
|
||||
</Key>
|
||||
<Key ID="STR_EPOCH_DOORS_CLOSE">
|
||||
<English>Close Door</English>
|
||||
<German>Tür schliessen</German>
|
||||
</Key>
|
||||
<Key ID="STR_EPOCH_DOORS_UNLOCK">
|
||||
<English>Unlock Door</English>
|
||||
<German>Tür aufschliessen</German>
|
||||
</Key>
|
||||
<Key ID="STR_EPOCH_DOORS_LOCK">
|
||||
<English>Lock Door</English>
|
||||
<German>Tür abschliessen</German>
|
||||
</Key>
|
||||
<Key ID="STR_EPOCH_CANCEL">
|
||||
<English>Cancel</English>
|
||||
<French>Annuler</French>
|
||||
<Spanish>Cancelar</Spanish>
|
||||
<Italian>Annulla</Italian>
|
||||
<Hungarian>Mégse</Hungarian>
|
||||
<Polish>Anuluj</Polish>
|
||||
<Russian>Отмена</Russian>
|
||||
<German>Abbrechen</German>
|
||||
<Czech>Zrušit</Czech>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
|
||||
@@ -69,9 +69,19 @@ _object_inventory = {
|
||||
if (_object isKindOf "TrapItems") then {
|
||||
_inventory = [["armed",_object getVariable ["armed",false]]];
|
||||
} else {
|
||||
if (DZE_permanentPlot && (typeOf _object == "Plastic_Pole_EP1_DZ")) then {
|
||||
_isNormal = true;
|
||||
|
||||
if( DZE_permanentPlot && (typeOf (_object) == "Plastic_Pole_EP1_DZ") ) then {
|
||||
_isNormal = false;
|
||||
_inventory = _object getVariable ["plotfriends", []]; //We're replacing the inventory with UIDs for this item
|
||||
} else {
|
||||
};
|
||||
|
||||
if( DZE_doorManagement && (typeOf (_object) in DZE_DoorsLocked) ) then {
|
||||
_isNormal = false;
|
||||
_inventory = _object getVariable ["doorfriends", []]; //We're replacing the inventory with UIDs for this item
|
||||
};
|
||||
|
||||
if(_isNormal) then {
|
||||
_inventory = [getWeaponCargo _object, getMagazineCargo _object, getBackpackCargo _object];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -180,6 +180,10 @@ if (_status == "ObjectStreamStart") then {
|
||||
_object setVariable ["plotfriends", _inventory, true];
|
||||
};
|
||||
|
||||
if( DZE_doorManagement && (typeOf (_object) in DZE_DoorsLocked) ) then {
|
||||
_object setVariable ["doorfriends", _inventory, true];
|
||||
};
|
||||
|
||||
dayz_serverIDMonitor set [count dayz_serverIDMonitor,_idKey];
|
||||
// Fix for leading zero issues on safe codes after restart
|
||||
_lockable = if (isNumber (configFile >> "CfgVehicles" >> _type >> "lockable")) then {getNumber (configFile >> "CfgVehicles" >> _type >> "lockable")} else {0};
|
||||
@@ -209,7 +213,7 @@ if (_status == "ObjectStreamStart") then {
|
||||
clearWeaponCargoGlobal _object;
|
||||
clearMagazineCargoGlobal _object;
|
||||
clearBackpackCargoGlobal _object;
|
||||
if( (count _inventory > 0) && !(typeOf( _object) == "Plastic_Pole_EP1_DZ") ) then {
|
||||
if( (count _inventory > 0) && !(typeOf( _object) == "Plastic_Pole_EP1_DZ") && !(typeOf( _object) in DZE_DoorsLocked) ) then {
|
||||
if (_type in DZE_LockedStorage) then {
|
||||
_object setVariable ["WeaponCargo",(_inventory select 0),true];
|
||||
_object setVariable ["MagazineCargo",(_inventory select 1),true];
|
||||
|
||||
Reference in New Issue
Block a user