mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-27 02:01:49 +03:00
Use single config variable for Plot for Life and Plot Management
Plot for Life and Plot Management work best together. They essentially provide the same functionality. Both let you keep your plot after death by using UID instead of CharacterID. Plot Management doesn't even have an option to save characterID, so by default it is always keeping all friends and the owner permanently until they are removed. The only major difference between them is Plot For Life also adds permanent ownership of built items on the plot, which is behavior most people expect. It doesn't make sense to keep ownership of the plot after death but not the other objects built on it. The other functionality it adds (take ownership) can be toggled with a config variable. It is rare that someone would want Plot For Life enabled, but Plot Management disabled or vice versa. If they really want that they can still do it manually, but consolidating them to a single config option greatly simplifies things for everyone else. I removed links to mod githubs because many changes have been made to the 1.0.6 versions, so outdated information there will likely confuse people. Authors are already credited in the README and change log. In variables.sqf "DZ_storage_base" is now the parent class which includes all tents and stashes. DZE_checkNearbyRadius variable is not used (identical to DZE_PlotPole select 0).
This commit is contained in:
@@ -1,32 +1,56 @@
|
||||
// Check Ownership by RimBlock (http://epochmod.com/forum/index.php?/user/12612-rimblock/)
|
||||
/*
|
||||
Check object's ownership and friends
|
||||
Original concept by RimBlock (github.com/RimBlock)
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
private ["_player","_object","_playerUID","_ObjectOwner","_owner","_friendlies","_friendly"];
|
||||
private ["_player","_target","_playerUID","_targetOwner","_owner","_friendlies","_friendly","_findNearestPoles","_IsNearPlot","_pole","_friendUID","_ownerID","_friends"];
|
||||
|
||||
_player = _this select 0;
|
||||
_Object = _this select 1;
|
||||
|
||||
_Owner = false;
|
||||
_target = _this select 1;
|
||||
_owner = false;
|
||||
_friendly = false;
|
||||
_friendlies = [];
|
||||
_ObjectOwner = "0";
|
||||
_targetOwner = "0";
|
||||
|
||||
if (DZE_plotManagement) then {
|
||||
_friendlies = [_Object, true] call dze_getPlotFriends;
|
||||
if (DZE_permanentPlot) then {
|
||||
_pole = _target;
|
||||
_IsNearPlot = 0;
|
||||
_findNearestPoles = nearestObjects [[player] call FNC_getPos, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];
|
||||
_IsNearPlot = count _findNearestPoles;
|
||||
_pole = _findNearestPoles select 0;
|
||||
|
||||
if (_IsNearPlot > 0) then {
|
||||
_ownerID = _pole getVariable ["ownerPUID","0"];
|
||||
_friendlies = [_ownerID];
|
||||
_friends = _pole getVariable ["plotfriends", []];
|
||||
{
|
||||
_friendUID = _x select 0;
|
||||
_friendlies set [count _friendlies, _friendUID];
|
||||
} count _friends;
|
||||
if (count DZE_PlotManagementAdmins > 0) then {
|
||||
_friendlies = _friendlies + DZE_PlotManagementAdmins;
|
||||
};
|
||||
};
|
||||
|
||||
_playerUID = [_player] call FNC_GetPlayerUID;
|
||||
_targetOwner = _target getVariable ["ownerPUID","0"];
|
||||
_owner = (_playerUID == _targetOwner);
|
||||
} else {
|
||||
_friendlies = _player getVariable ["friendlyTo",[]];
|
||||
_targetOwner = _target getVariable ["CharacterID","0"];
|
||||
_owner = (_targetOwner == dayz_characterID);
|
||||
};
|
||||
|
||||
if (DZE_plotforLife) then {
|
||||
_playerUID = [_player] call FNC_GetPlayerUID;
|
||||
_ObjectOwner = _object getVariable ["ownerPUID","0"];
|
||||
_owner = (_playerUID == _ObjectOwner);
|
||||
} else {
|
||||
_ObjectOwner = _object getVariable["CharacterID","0"];
|
||||
_owner = (_ObjectOwner == dayz_characterID);
|
||||
};
|
||||
|
||||
if (_ObjectOwner in _friendlies) then {
|
||||
if (_targetOwner in _friendlies) then {
|
||||
_friendly = true;
|
||||
};
|
||||
|
||||
[_owner, _friendly];
|
||||
[_owner, _friendly]
|
||||
Reference in New Issue
Block a user