mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-22 20:12:20 +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:
33
SQF/dayz_code/compile/A_Plot_for_Life/fn_check_owner.sqf
Normal file
33
SQF/dayz_code/compile/A_Plot_for_Life/fn_check_owner.sqf
Normal file
@@ -0,0 +1,33 @@
|
||||
// Check Ownership by RimBlock (http://epochmod.com/forum/index.php?/user/12612-rimblock/)
|
||||
|
||||
private ["_player","_object","_playerUID","_ObjectOwner","_owner","_friendlies","_friendly"];
|
||||
|
||||
_player = _this select 0;
|
||||
_Object = _this select 1;
|
||||
_PlotManagement = _this select 2;
|
||||
|
||||
_Owner = false;
|
||||
_friendly = false;
|
||||
_friendlies = [];
|
||||
_ObjectOwner = "0";
|
||||
|
||||
if (_PlotManagement) then {
|
||||
_friendlies = [_Object, true, false] call dze_getPlotFriends;
|
||||
} else {
|
||||
_friendlies = _player getVariable ["friendlyTo",[]];
|
||||
};
|
||||
|
||||
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 {
|
||||
_friendly = true;
|
||||
};
|
||||
|
||||
[_owner, _friendly];
|
||||
24
SQF/dayz_code/compile/A_Plot_for_Life/fn_find_plots.sqf
Normal file
24
SQF/dayz_code/compile/A_Plot_for_Life/fn_find_plots.sqf
Normal file
@@ -0,0 +1,24 @@
|
||||
// Find Plots by RimBlock (http://epochmod.com/forum/index.php?/user/12612-rimblock/)
|
||||
|
||||
private ["_player","_ispole","_IsNearPlot","_nearestPole","_distance","_findNearestPoles","_findNearestPole","_friendly","_return"];
|
||||
|
||||
_player = _this select 0;
|
||||
_ispole = _this select 1;
|
||||
_IsNearPlot = 0;
|
||||
_nearestPole = "";
|
||||
_findNearestPole = [];
|
||||
|
||||
if(_isPole) then {
|
||||
_distance = DZE_PlotPole select 1;
|
||||
}else{
|
||||
_distance = DZE_PlotPole select 0;
|
||||
};
|
||||
|
||||
// check for near plot
|
||||
_findNearestPole = (position (vehicle _player)) nearEntities ["Plastic_Pole_EP1_DZ", _distance];
|
||||
|
||||
_IsNearPlot = count (_findNearestPole);
|
||||
if (_IsNearPlot > 0) then{_nearestPole = _findNearestPole select 0;}else{_nearestPole = objNull;};
|
||||
|
||||
_return = [_distance, _IsNearPlot, _nearestPole];
|
||||
_return
|
||||
Reference in New Issue
Block a user