mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 11:42:38 +03:00
Add option to limit static weapon access within plot radius.
If the config variable is set to true then then static weapon access within the plot radius is limited to plot owner and plot friends.
This commit is contained in:
@@ -147,6 +147,9 @@ if (isServer) then {
|
||||
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
|
||||
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
|
||||
};
|
||||
|
||||
// Static Weapon Plot Access
|
||||
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
|
||||
};
|
||||
|
||||
// Client
|
||||
|
||||
@@ -266,6 +266,36 @@ if ((playersNumber west + playersNumber civilian) == 0) exitWith {
|
||||
|
||||
if (_type isKindOf "StaticWeapon" || {_type in DZE_StaticWeapons}) then {
|
||||
[_object,DZE_clearStaticAmmo,false] call fn_vehicleAddons;
|
||||
|
||||
if (DZE_StaticWeaponPlotCheck) then {
|
||||
_object addEventHandler ["GetIn", {
|
||||
local _weapon = _this select 0;
|
||||
local _player = _this select 2;
|
||||
local _nearPlots = _weapon nearEntities ["Plastic_Pole_EP1_DZ", (DZE_PlotPole select 0)];
|
||||
if (count _nearPlots > 0) then {
|
||||
local _nearestPlot = _nearPlots select 0;
|
||||
local _plotFriends = _nearestPlot getVariable "plotfriends"; // owner is index 0.
|
||||
local _playerUID = getPlayerUID _player;
|
||||
local _isPlotFriend = false;
|
||||
{
|
||||
if((_x select 0) == _playerUID) exitWith {_isPlotFriend = true;};
|
||||
} count _plotFriends;
|
||||
|
||||
if (!_isPlotFriend) then {
|
||||
// "eject" action doesn't work on the static weapons for some reason.
|
||||
moveOut _player;
|
||||
|
||||
/* uncomment to log the offender to the server rpt.
|
||||
local _plotOwner = _plotFriends select 0;
|
||||
local _plotOwnerUID = _plotOwner select 0;
|
||||
local _plotOwnerName = _plotOwner select 1;
|
||||
_plotOwnerName = [_plotOwnerName, (toString _plotOwnerName)] select (typeName _plotOwnerName == "ARRAY");
|
||||
diag_log format ["Player [%1, %2] ejected from %3 on plot belonging to [%4, %5]",(name _player), _playerUID, (typeOf _weapon), _plotOwnerUID, _plotOwnerName];
|
||||
*/
|
||||
};
|
||||
};
|
||||
}];
|
||||
};
|
||||
};
|
||||
|
||||
_setGlobal = [false,true] select ((_type in DZE_LockedStorage) || (_type in DZE_DoorsLocked));
|
||||
|
||||
@@ -147,6 +147,9 @@ if (isServer) then {
|
||||
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
|
||||
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
|
||||
};
|
||||
|
||||
// Static Weapon Plot Access
|
||||
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
|
||||
};
|
||||
|
||||
// Client
|
||||
|
||||
@@ -147,6 +147,9 @@ if (isServer) then {
|
||||
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
|
||||
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
|
||||
};
|
||||
|
||||
// Static Weapon Plot Access
|
||||
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
|
||||
};
|
||||
|
||||
// Client
|
||||
|
||||
@@ -147,6 +147,9 @@ if (isServer) then {
|
||||
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
|
||||
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
|
||||
};
|
||||
|
||||
// Static Weapon Plot Access
|
||||
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
|
||||
};
|
||||
|
||||
// Client
|
||||
|
||||
@@ -147,6 +147,9 @@ if (isServer) then {
|
||||
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
|
||||
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
|
||||
};
|
||||
|
||||
// Static Weapon Plot Access
|
||||
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
|
||||
};
|
||||
|
||||
// Client
|
||||
|
||||
@@ -147,6 +147,9 @@ if (isServer) then {
|
||||
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
|
||||
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
|
||||
};
|
||||
|
||||
// Static Weapon Plot Access
|
||||
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
|
||||
};
|
||||
|
||||
// Client
|
||||
|
||||
@@ -147,6 +147,9 @@ if (isServer) then {
|
||||
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
|
||||
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
|
||||
};
|
||||
|
||||
// Static Weapon Plot Access
|
||||
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
|
||||
};
|
||||
|
||||
// Client
|
||||
|
||||
@@ -147,6 +147,9 @@ if (isServer) then {
|
||||
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
|
||||
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
|
||||
};
|
||||
|
||||
// Static Weapon Plot Access
|
||||
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
|
||||
};
|
||||
|
||||
// Client
|
||||
|
||||
@@ -147,6 +147,9 @@ if (isServer) then {
|
||||
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
|
||||
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
|
||||
};
|
||||
|
||||
// Static Weapon Plot Access
|
||||
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
|
||||
};
|
||||
|
||||
// Client
|
||||
|
||||
@@ -147,6 +147,9 @@ if (isServer) then {
|
||||
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
|
||||
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
|
||||
};
|
||||
|
||||
// Static Weapon Plot Access
|
||||
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
|
||||
};
|
||||
|
||||
// Client
|
||||
|
||||
@@ -147,6 +147,9 @@ if (isServer) then {
|
||||
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
|
||||
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
|
||||
};
|
||||
|
||||
// Static Weapon Plot Access
|
||||
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
|
||||
};
|
||||
|
||||
// Client
|
||||
|
||||
@@ -147,6 +147,9 @@ if (isServer) then {
|
||||
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
|
||||
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
|
||||
};
|
||||
|
||||
// Static Weapon Plot Access
|
||||
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
|
||||
};
|
||||
|
||||
// Client
|
||||
|
||||
@@ -147,6 +147,9 @@ if (isServer) then {
|
||||
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
|
||||
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
|
||||
};
|
||||
|
||||
// Static Weapon Plot Access
|
||||
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
|
||||
};
|
||||
|
||||
// Client
|
||||
|
||||
@@ -147,6 +147,9 @@ if (isServer) then {
|
||||
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
|
||||
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
|
||||
};
|
||||
|
||||
// Static Weapon Plot Access
|
||||
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
|
||||
};
|
||||
|
||||
// Client
|
||||
|
||||
@@ -147,6 +147,9 @@ if (isServer) then {
|
||||
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
|
||||
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
|
||||
};
|
||||
|
||||
// Static Weapon Plot Access
|
||||
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
|
||||
};
|
||||
|
||||
// Client
|
||||
|
||||
@@ -147,6 +147,9 @@ if (isServer) then {
|
||||
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
|
||||
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
|
||||
};
|
||||
|
||||
// Static Weapon Plot Access
|
||||
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
|
||||
};
|
||||
|
||||
// Client
|
||||
|
||||
@@ -147,6 +147,9 @@ if (isServer) then {
|
||||
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
|
||||
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
|
||||
};
|
||||
|
||||
// Static Weapon Plot Access
|
||||
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
|
||||
};
|
||||
|
||||
// Client
|
||||
|
||||
@@ -147,6 +147,9 @@ if (isServer) then {
|
||||
DZE_EVRFirstTime = [15, 60]; // Random time in minutes after server restart to begin the first EVR storm [min, max].
|
||||
DZE_EVRTimer = [45, 180]; // Random time in minutes between additional EVR storms [min, max].
|
||||
};
|
||||
|
||||
// Static Weapon Plot Access
|
||||
DZE_StaticWeaponPlotCheck = false; // Limits the use of static weapons within the plot radius to plot owner and plot friends.
|
||||
};
|
||||
|
||||
// Client
|
||||
|
||||
Reference in New Issue
Block a user