mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-11 10:42:58 +03:00
@@ -1,94 +0,0 @@
|
||||
// Plot Take Ownership by RimBlock (http://epochmod.com/forum/index.php?/user/12612-rimblock/)
|
||||
//
|
||||
// This script allows Plot pole owners to take ownership of all allowed buildables on their plot except lockable storage and tents.
|
||||
//
|
||||
// Note:
|
||||
// This code calls server_publishFullObject which also saves damage, inventory and fuel. Hitpoints are assumed to be empty as this is for buildables only.
|
||||
|
||||
private ["_distance","_plotpole","_hasAccess","_findNearestObjects","_classname","_objectID","_objectUID","_position",
|
||||
"_worldspace","_object","_key","_invW","_invM","_invB","_itemsExist","_charID","_inventory","_changecount"];
|
||||
|
||||
_distance = (DZE_PlotPole select 0) + 1;
|
||||
_plotpole = nearestobject [(vehicle player),"Plastic_Pole_EP1_DZ"];
|
||||
_changecount = 0;
|
||||
|
||||
// Check is owner of the plot pole.
|
||||
|
||||
_hasAccess = [player, _plotpole] call FNC_check_access;
|
||||
_itemsExist = false;
|
||||
|
||||
if (_hasAccess select 0) then {
|
||||
_findNearestObjects = (position _plotpole) nearEntities _distance;
|
||||
{
|
||||
_object = _x;
|
||||
_classname = typeOf _object;
|
||||
if (_classname in DZE_plotTakeOwnershipItems) then {
|
||||
|
||||
_hasAccess = [player, _object] call FNC_check_access;
|
||||
diag_log text "Plot Take Ownership: Object in DZE_plotTakeOwnershipItems";
|
||||
|
||||
if !(_hasAccess select 0) then{
|
||||
diag_log text "Plot Take Ownership: Is not already the owner";
|
||||
|
||||
_objectID = _object getVariable ["ObjectID","0"];
|
||||
_objectUID = _object getVariable ["ObjectUID","0"];
|
||||
|
||||
sleep 0.01;
|
||||
|
||||
PVDZ_obj_Destroy = [_objectID, _objectUID, player];
|
||||
publicVariableServer "PVDZ_obj_Destroy";
|
||||
|
||||
sleep 0.01;
|
||||
|
||||
_object setvariable["ObjectID", "0"];
|
||||
|
||||
if (_classname in DZE_DoorsLocked) then {
|
||||
_charID = _object getVariable ["characterID",dayz_characterID];
|
||||
} else {
|
||||
_charID = dayz_characterID;
|
||||
};
|
||||
|
||||
_position = getPosATL _object;
|
||||
_vector = [(vectorDir _object),(vectorUp _object)];
|
||||
_worldspace = [round(direction _object),_position,dayz_playerUID,_vector];
|
||||
|
||||
_invW = getWeaponCargo _object;
|
||||
{
|
||||
if ((count _x) != 0) then {_itemsExist = true;};
|
||||
} foreach _invW;
|
||||
|
||||
_invM = getMagazineCargo _object;
|
||||
if !(_itemsExist) then {
|
||||
{
|
||||
if ((count _x) != 0) then {_itemsExist = true;};
|
||||
}foreach _invM;
|
||||
};
|
||||
|
||||
_invB = getBackpackCargo _object;
|
||||
if !(_itemsExist) then {
|
||||
{
|
||||
if ((count _x) != 0) then {_itemsExist = true;};
|
||||
} foreach _invB;
|
||||
};
|
||||
|
||||
if (_itemsExist) then {
|
||||
_inventory = format["[%1,%2,%3]", _invW, _invM, _invB];
|
||||
} else {
|
||||
_inventory = "[]";
|
||||
};
|
||||
|
||||
_hitpoints = '[]';
|
||||
_damage = damage _object;
|
||||
_fuel = fuel _object;
|
||||
|
||||
PVDZE_fullobj_Publish = [_charID,_object,_worldspace,_classname,_inventory,_hitpoints,_damage,_fuel];
|
||||
publicVariableServer "PVDZE_fullobj_Publish";
|
||||
|
||||
_object setVariable ["ownerPUID",dayz_playerUID];
|
||||
|
||||
_changecount = _changecount + 1;
|
||||
};
|
||||
};
|
||||
} count _findNearestObjects;
|
||||
format[localize "STR_EPOCH_APLOTFORLIFE_TAKE_OWNERSHIP",_changecount] call dayz_rollingMessages;
|
||||
};
|
||||
@@ -619,11 +619,6 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
|
||||
if (s_player_plot_boundary < 0 && (_allowed or (_hasAccess select 1))) then {
|
||||
s_player_plot_boundary = player addAction [localize "STR_EPOCH_PLOTMANAGEMENT_SHOW_BOUNDARY", "\z\addons\dayz_code\actions\plotManagement\plotToggleMarkers.sqf", "", 1, false];
|
||||
};
|
||||
if (DZE_permanentPlot && DZE_PlotOwnership) then {
|
||||
if (s_player_plot_take_ownership < 0 && (_hasAccess select 0)) then {
|
||||
s_player_plot_take_ownership = player addAction [localize "STR_EPOCH_APLOTFORLIFE_TAKE_PLOT_OWNERSHIP", "\z\addons\dayz_code\actions\plot_take_ownership.sqf", "", 1, false];
|
||||
};
|
||||
};
|
||||
} else {
|
||||
player removeAction s_player_plotManagement;
|
||||
s_player_plotManagement = -1;
|
||||
@@ -635,8 +630,6 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
|
||||
s_player_maintain_area_preview = -1;
|
||||
player removeAction s_player_plot_boundary;
|
||||
s_player_plot_boundary = -1;
|
||||
player removeAction s_player_plot_take_ownership;
|
||||
s_player_plot_take_ownership = -1;
|
||||
};
|
||||
|
||||
if (DZE_HeliLift) then {
|
||||
@@ -1025,8 +1018,6 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
|
||||
//Engineering
|
||||
player removeAction s_player_plot_boundary;
|
||||
s_player_plot_boundary = -1;
|
||||
player removeAction s_player_plot_take_ownership;
|
||||
s_player_plot_take_ownership = -1;
|
||||
player removeAction s_player_plotManagement;
|
||||
s_player_plotManagement = -1;
|
||||
{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
|
||||
|
||||
@@ -76,7 +76,6 @@ DZE_permanentPlot = true; // Plot ownership saves after death. Enables Plot for
|
||||
DZE_plotManagementMustBeClose = false; //Players must be within 10m of pole to be added as a plot friend.
|
||||
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_PlotOwnership = true; //Allow plot owner to take ownership of buildables (except lockables) on the plot. Useful for servers that allow base capturing, so the new owner can modify, remove and upgrade existing structures.
|
||||
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.
|
||||
|
||||
// Snap Build and Build Vectors
|
||||
|
||||
@@ -100,7 +100,6 @@ if (isServer) then {
|
||||
"PVDZE_plr_TradeMenu" addPublicVariableEventHandler {(_this select 1) spawn server_traders};
|
||||
"PVDZE_plr_DeathB" addPublicVariableEventHandler {(_this select 1) spawn server_deaths};
|
||||
"PVDZE_handleSafeGear" addPublicVariableEventHandler {(_this select 1) spawn server_handleSafeGear};
|
||||
"PVDZE_fullobj_Publish" addPublicVariableEventHandler {(_this select 1) call server_publishFullObject}; // PlotForLife take base ownership
|
||||
if (dayz_groupSystem) then {
|
||||
"PVDZ_Server_UpdateGroup" addPublicVariableEventHandler {(_this select 1) spawn server_updateGroup};
|
||||
};
|
||||
|
||||
@@ -250,7 +250,6 @@ dayz_resetSelfActions = {
|
||||
s_player_toggleSnapSelectPoint = [];
|
||||
snapActions = -1;
|
||||
s_player_plot_boundary = -1;
|
||||
s_player_plot_take_ownership = -1;
|
||||
s_player_plotManagement = -1;
|
||||
s_player_toggleDegree = -1;
|
||||
s_player_toggleDegrees=[];
|
||||
@@ -533,9 +532,6 @@ DZE_snapExtraRange = 0;
|
||||
DZE_tradeVehicle = ["trade_any_vehicle","trade_any_vehicle_free","trade_any_vehicle_old","trade_any_bicycle","trade_any_bicycle_old","trade_any_boat","trade_any_boat_old"];
|
||||
DZE_tradeVehicleKeyless = ["trade_any_bicycle","trade_any_bicycle_old","trade_any_vehicle_free"];
|
||||
DZE_tradeObject = DZE_tradeVehicle + ["trade_backpacks"];
|
||||
if (isNil "DZE_plotOwnershipExclusions") then {
|
||||
DZE_plotTakeOwnershipItems = DayZ_SafeObjects - (DZE_LockableStorage + ["Plastic_Pole_EP1_DZ","DZ_storage_base"]);
|
||||
};
|
||||
DZE_GearCheckBypass = false;
|
||||
isInTraderCity = false;
|
||||
inTraderCity = "Unknown Trader";
|
||||
|
||||
@@ -15454,17 +15454,6 @@
|
||||
<English>Some change is hidden in the overflow slots of your gear.</English>
|
||||
</Key>
|
||||
|
||||
<!-- A PLOT FOR LIFE BELOW -->
|
||||
|
||||
<Key ID="STR_EPOCH_APLOTFORLIFE_TAKE_PLOT_OWNERSHIP">
|
||||
<English>Take plot items ownership</English>
|
||||
<German>Besitz aller Objekte übernehmen</German>
|
||||
</Key>
|
||||
<Key ID="STR_EPOCH_APLOTFORLIFE_TAKE_OWNERSHIP">
|
||||
<English>Take Ownership: %1 objects ownership changed.</English>
|
||||
<German>Besitz übernehmen: %1 Objekte haben Besitzer gewechselt.</German>
|
||||
</Key>
|
||||
|
||||
<!-- PLOT MANAGEMENT BELOW -->
|
||||
|
||||
<Key ID="STR_EPOCH_PLOTMANAGEMENT_MAINTAIN_NONE">
|
||||
|
||||
Reference in New Issue
Block a user