Merge pull request #1918 from oiad/master

Add DZE_limitPlots so admins can limit plot poles to 1 per UID.
This commit is contained in:
icomrade
2017-03-28 08:53:14 -07:00
committed by GitHub
6 changed files with 642 additions and 619 deletions

View File

@@ -1,4 +1,5 @@
[NEW] Added a few loot positions for Namalsk and Takistan. @skigoggles [NEW] Added a few loot positions for Namalsk and Takistan. @skigoggles
[NEW] Added DZE_limitPlots so admins can limit plot poles to 1 per UID, disabled by default. @oiad
[UPDATED] Zombie pathing. Zeds should now run more direct to players. [UPDATED] Zombie pathing. Zeds should now run more direct to players.

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
//Checks if item is near a plot, if the player is plot owner or friendly, if there are too many items, and if the player has required tools //Checks if item is near a plot, if the player is plot owner or friendly, if there are too many items, and if the player has required tools
private ["_requireplot","_distance","_canBuild","_friendlies","_nearestPole","_ownerID","_pos","_item","_classname","_isPole","_isLandFireDZ","_IsNearPlot","_buildables","_center","_toolCheck","_plotcheck","_buildcheck","_isfriendly","_isowner","_require","_text","_near"]; private ["_requireplot","_distance","_canBuild","_friendlies","_nearestPole","_ownerID","_pos","_item","_classname","_isPole","_isLandFireDZ","_IsNearPlot","_buildables","_center","_toolCheck","_plotcheck","_buildcheck","_isfriendly","_isowner","_require","_text","_near","_hasPole"];
_pos = _this select 0; _pos = _this select 0;
_item = _this select 1; _item = _this select 1;
@@ -16,6 +16,7 @@ _isPole = (_classname == "Plastic_Pole_EP1_DZ");
_isLandFireDZ = (_classname == "Land_Fire_DZ"); _isLandFireDZ = (_classname == "Land_Fire_DZ");
_canBuild = false; _canBuild = false;
_hasPole = false;
_nearestPole = objNull; _nearestPole = objNull;
_ownerID = 0; _ownerID = 0;
_friendlies = []; _friendlies = [];
@@ -23,6 +24,7 @@ _friendlies = [];
if (_isPole) then { if (_isPole) then {
_plotcheck = [player, true] call FNC_find_plots; _plotcheck = [player, true] call FNC_find_plots;
_distance = DZE_PlotPole select 1; _distance = DZE_PlotPole select 1;
if (DZE_limitPlots && {!((getPlayerUID player) in DZE_PlotManagementAdmins)}) then {_hasPole = call FNC_plotCheck;};
} else { } else {
_plotcheck = [player, false] call FNC_find_plots; _plotcheck = [player, false] call FNC_find_plots;
_distance = DZE_PlotPole select 0; _distance = DZE_PlotPole select 0;
@@ -33,6 +35,8 @@ _nearestPole = _plotcheck select 2;
if (_isPole && {_IsNearPlot > 0}) exitWith {dayz_actionInProgress = false; format[localize "str_epoch_player_44",_distance] call dayz_rollingMessages; [_canBuild, _isPole];}; if (_isPole && {_IsNearPlot > 0}) exitWith {dayz_actionInProgress = false; format[localize "str_epoch_player_44",_distance] call dayz_rollingMessages; [_canBuild, _isPole];};
if (_hasPole) exitWith {dayz_actionInProgress = false; localize "STR_EPOCH_PLAYER_133" call dayz_rollingMessages; [_canBuild, _isPole];};
if (_IsNearPlot == 0) then { if (_IsNearPlot == 0) then {
if (_requireplot == 0 || {_isLandFireDZ}) then { if (_requireplot == 0 || {_isLandFireDZ}) then {
_canBuild = true; _canBuild = true;

View File

@@ -79,6 +79,7 @@ DZE_plotManagementMustBeClose = false; //Players must be within 10m of pole to b
DZE_PlotManagementAdmins = []; //Array of admin PlayerUIDs. UIDs in this list are able to access every pole's management menu and delete or build any buildable with a pole nearby. DZE_PlotManagementAdmins = []; //Array of admin PlayerUIDs. UIDs in this list are able to access every pole's management menu and delete or build any buildable with a pole nearby.
DZE_MaxPlotFriends = 10; //Max friends allowed on a plot. There is no character limit in the inventory field of the database, but lower values limit the max global setVariable size to improve performance. DZE_MaxPlotFriends = 10; //Max friends allowed on a plot. There is no character limit in the inventory field of the database, but lower values limit the max global setVariable size to improve performance.
DZE_maintainCurrencyRate = 100; //The currency rate of what maintaining an item will be, for instance: at 100, 10 items will have a worth of 1000 (1 10oz gold or 1k coins) see actions/maintain_area.sqf for more examples. DZE_maintainCurrencyRate = 100; //The currency rate of what maintaining an item will be, for instance: at 100, 10 items will have a worth of 1000 (1 10oz gold or 1k coins) see actions/maintain_area.sqf for more examples.
DZE_limitPlots = false; // Limit the amount of plot poles per person to 1, UIDS in the DZE_PlotManagementAdmins array are exempt.
DZE_isRemovable = ["Plastic_Pole_EP1_DZ"]; //Items that can be removed with a crowbar with no ownership or access required. To forbid base take overs remove plot pole from this list and add it to DZE_restrictRemoval. It is not necessary to add wrecks or items that inherit from 'BuiltItems' to this list. DZE_isRemovable = ["Plastic_Pole_EP1_DZ"]; //Items that can be removed with a crowbar with no ownership or access required. To forbid base take overs remove plot pole from this list and add it to DZE_restrictRemoval. It is not necessary to add wrecks or items that inherit from 'BuiltItems' to this list.
DZE_restrictRemoval = ["Fence_corrugated_DZ","M240Nest_DZ","ParkBench_DZ","FireBarrel_DZ","Scaffolding_DZ","CanvasHut_DZ","LightPole_DZ","DeerStand_DZ","MetalGate_DZ","StickFence_DZ"]; //Items that can be removed with a crowbar only with proper ownership or access. It is not necessary to add doors, storage or items that inherit from 'ModularItems' to this list. Items that inherit from 'BuiltItems' can be added to this list if desired. DZE_restrictRemoval = ["Fence_corrugated_DZ","M240Nest_DZ","ParkBench_DZ","FireBarrel_DZ","Scaffolding_DZ","CanvasHut_DZ","LightPole_DZ","DeerStand_DZ","MetalGate_DZ","StickFence_DZ"]; //Items that can be removed with a crowbar only with proper ownership or access. It is not necessary to add doors, storage or items that inherit from 'ModularItems' to this list. Items that inherit from 'BuiltItems' can be added to this list if desired.
@@ -115,4 +116,4 @@ dayz_requireRadio = false; // Require players to have a radio on their toolbelt
Variables that are map specific or frequently changed should be included in init.sqf by default Variables that are map specific or frequently changed should be included in init.sqf by default
with a corresponding if(isNil)then{}; in variables.sqf. with a corresponding if(isNil)then{}; in variables.sqf.
*/ */

View File

@@ -606,6 +606,19 @@ if (!isDedicated) then {
[(format ["%1<br />%2<br />%3<br />%4",death_1,death_2,death_3,death_4]),(safeZoneX + _offset),safeZoneY,10,0,0,8000] spawn BIS_fnc_dynamicText; [(format ["%1<br />%2<br />%3<br />%4",death_1,death_2,death_3,death_4]),(safeZoneX + _offset),safeZoneY,10,0,0,8000] spawn BIS_fnc_dynamicText;
}; };
fnc_plotCheck = {
private ["_hasPole","_plotFriends"];
_hasPole = false;
{
_plotFriends = _x getVariable ["plotfriends",[]];
if (((_plotFriends select 0) select 0) == dayz_playerUID) exitWith {_hasPole = true;};
} count (entities "Plastic_Pole_EP1_DZ");
_hasPole
};
dayz_originalPlayer = player; dayz_originalPlayer = player;
// database trader menu // database trader menu

View File

@@ -12117,6 +12117,10 @@
<French>%1 est rempli(e) à %2 pourcents de sa capacité.</French> <French>%1 est rempli(e) à %2 pourcents de sa capacité.</French>
<Czech>%1 je naplněno do %2 procent kapacity.</Czech> <Czech>%1 je naplněno do %2 procent kapacity.</Czech>
</Key> </Key>
<Key ID="STR_EPOCH_PLAYER_133">
<English>You can only have one active plot pole where you are the plot owner.</English>
<German>Du darfst maximal ein Grundstück besitzen.</German>
</Key>
<Key ID="STR_EPOCH_PLAYER_134"> <Key ID="STR_EPOCH_PLAYER_134">
<English>You do not have access to build on this plot.</English> <English>You do not have access to build on this plot.</English>
<German>Du darfst auf diesem Grundstück nichts bauen, da du kein eingetragener Eigentümer bist.</German> <German>Du darfst auf diesem Grundstück nichts bauen, da du kein eingetragener Eigentümer bist.</German>