mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-28 10:41:50 +03:00
Add A Plot For Life modification by RimBlock
A Plot For Life also includes Precise Base Building by Mikeeeyy. Precise base building has no variable to switch it on or off, I don't think it should. Seems to work well enough, this may conflict with the duplicate object uid fix, it appears to spam my server rpt.
This commit is contained in:
@@ -9,63 +9,35 @@ DZE_ActionInProgress = true;
|
||||
|
||||
player removeAction s_player_upgrade_build;
|
||||
s_player_upgrade_build = 1;
|
||||
|
||||
|
||||
_distance = 30;
|
||||
_distance = DZE_PlotPole select 0;
|
||||
_needText = localize "str_epoch_player_246";
|
||||
|
||||
// check for near plot
|
||||
_findNearestPoles = nearestObjects [(vehicle player), ["Plastic_Pole_EP1_DZ"], _distance];
|
||||
_findNearestPole = [];
|
||||
|
||||
{
|
||||
if (alive _x) then {
|
||||
_findNearestPole set [(count _findNearestPole),_x];
|
||||
};
|
||||
} count _findNearestPoles;
|
||||
|
||||
_IsNearPlot = count (_findNearestPole);
|
||||
|
||||
_canBuildOnPlot = false;
|
||||
|
||||
_plotcheck = [player, false] call FNC_find_plots;
|
||||
_distance = _plotcheck select 0;
|
||||
_IsNearPlot = _plotcheck select 1;
|
||||
_nearestPole = _plotcheck select 2;
|
||||
|
||||
if(_IsNearPlot == 0) then {
|
||||
_canBuildOnPlot = true;
|
||||
} else {
|
||||
|
||||
// check nearby plots ownership && then for friend status
|
||||
_nearestPole = _findNearestPole select 0;
|
||||
|
||||
// Find owner
|
||||
_ownerID = _nearestPole getVariable["CharacterID","0"];
|
||||
|
||||
// diag_log format["DEBUG BUILDING: %1 = %2", dayz_characterID, _ownerID];
|
||||
|
||||
// check if friendly to owner
|
||||
if(dayz_characterID == _ownerID) then {
|
||||
_canBuildOnPlot = true;
|
||||
} else {
|
||||
// plotManagement //
|
||||
if( DZE_plotManagement ) then {
|
||||
_friendlies = _nearestPole getVariable ["plotfriends",[]];
|
||||
_fuid = [];
|
||||
{
|
||||
_friendUID = _x select 0;
|
||||
_fuid = _fuid + [_friendUID];
|
||||
} forEach _friendlies;
|
||||
// check if friendly to owner
|
||||
if(dayz_playerUID in _fuid) then {
|
||||
if (DZE_plotManagement || DZE_plotforLife) then {
|
||||
_buildcheck = [player, _nearestPole, DZE_plotManagement] call FNC_check_owner;
|
||||
_isowner = _buildcheck select 0;
|
||||
_isfriendly = _buildcheck select 1;
|
||||
if (_isowner || _isfriendly) then {
|
||||
_canBuildOnPlot = true;
|
||||
};
|
||||
} else {
|
||||
// plotManagement //
|
||||
_friendlies = player getVariable ["friendlyTo",[]];
|
||||
// check if friendly to owner
|
||||
if(_ownerID in _friendlies) then {
|
||||
_canBuildOnPlot = true;
|
||||
};
|
||||
// plotManagement //
|
||||
};
|
||||
// plotManagement //
|
||||
};
|
||||
};
|
||||
|
||||
@@ -166,6 +138,10 @@ if ((count _upgrade) > 0) then {
|
||||
|
||||
// Set location
|
||||
_object setPosATL _location;
|
||||
if (DZE_plotforLife) then {
|
||||
_ownerID = _obj getVariable["ownerPUID","0"];
|
||||
_object setVariable ["ownerPUID",_ownerID,true];
|
||||
};
|
||||
|
||||
if (_lockable == 3) then {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user