Globally remove wrecked objects

using PVEH PVDZE_obj_Remove. Wrecks only exist for the players currently
in the server when the parent object is destroyed. Passing the object
through the PVEH does not work.
This commit is contained in:
icomrade
2016-08-21 15:46:33 -04:00
parent 2ef433dc93
commit 9aa1784f23
5 changed files with 77 additions and 57 deletions

View File

@@ -105,6 +105,7 @@
[FIXED] Players are no longer able to brute force doors or safes by the method described in #1187 @icomrade [FIXED] Players are no longer able to brute force doors or safes by the method described in #1187 @icomrade
[FIXED] Fix some items not displaying removal option #1135 @icomrade [FIXED] Fix some items not displaying removal option #1135 @icomrade
[FIXED] Study body message saying his/he on female players. @ebaydayz [FIXED] Study body message saying his/he on female players. @ebaydayz
[FIXED] Destroyed objects (i.e. ore veins, ammo crates and wrecked buildables) are now deleted globally after being removed. #1730 @icomrade
[UPDATED] .hpp files updated in dayz_code\Configs\CfgLoot\CfgBuildingPos. @Uro1 [UPDATED] .hpp files updated in dayz_code\Configs\CfgLoot\CfgBuildingPos. @Uro1
[UPDATED] .bat files updated in Config-Examples @Raziel23x [UPDATED] .bat files updated in Config-Examples @Raziel23x

View File

@@ -27,6 +27,9 @@ if (DZE_permanentPlot) then {
if (_obj in DZE_DoorsLocked) exitWith {DZE_ActionInProgress = false; localize "STR_EPOCH_ACTIONS_20" call dayz_rollingMessages;}; if (_obj in DZE_DoorsLocked) exitWith {DZE_ActionInProgress = false; localize "STR_EPOCH_ACTIONS_20" call dayz_rollingMessages;};
if (_obj getVariable ["GeneratorRunning", false]) exitWith {DZE_ActionInProgress = false; localize "str_epoch_player_89" call dayz_rollingMessages;}; if (_obj getVariable ["GeneratorRunning", false]) exitWith {DZE_ActionInProgress = false; localize "str_epoch_player_89" call dayz_rollingMessages;};
_PlayerNear = {isPlayer _x} count (([_obj] call FNC_GetPos) nearEntities ["CAManBase", 10]) > 1;
if (_PlayerNear) exitWith {localize "str_pickup_limit_5" call dayz_rollingMessages;};
_objectID = _obj getVariable ["ObjectID","0"]; _objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"]; _objectUID = _obj getVariable ["ObjectUID","0"];
@@ -90,6 +93,9 @@ while {_isOk} do {
_isOk = false; _isOk = false;
_proceed = false; _proceed = false;
}; };
format[localize "str_epoch_player_163",_nameVehicle,(_counter + 1),_limit] call dayz_rollingMessages;
["Working",0,[20,40,15,0]] call dayz_NutritionSystem; ["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
player playActionNow "Medic"; player playActionNow "Medic";
_dis=20; _dis=20;
@@ -138,8 +144,6 @@ while {_isOk} do {
_proceed = false; _proceed = false;
}; };
format[localize "str_epoch_player_163",_nameVehicle,_counter,_limit] call dayz_rollingMessages;
if(_counter == _limit) exitWith { if(_counter == _limit) exitWith {
_isOk = false; _isOk = false;
_proceed = true; _proceed = true;
@@ -179,15 +183,19 @@ if (_proceed && _success) then {
if(!isNull(_obj)) then { if(!isNull(_obj)) then {
_ipos = getPosATL _obj; _ipos = getPosATL _obj;
deleteVehicle _obj; deleteVehicle _obj;
if(!_isWreck) then { if(!_isWreck && !_isWreckBuilding) then {
_activatingPlayer = player; _activatingPlayer = player;
PVDZ_obj_Destroy = [_objectID,_objectUID, _activatingPlayer]; PVDZ_obj_Destroy = [_objectID,_objectUID, _activatingPlayer];
publicVariableServer "PVDZ_obj_Destroy"; publicVariableServer "PVDZ_obj_Destroy";
}; };
if (_isWreckBuilding) then {
PVDZ_send = [player,"RemoveObject",_ipos];
publicVariableServer "PVDZ_send";
};
format[localize "str_epoch_player_165",_nameVehicle] call dayz_rollingMessages; format[localize "str_epoch_player_165",_nameVehicle] call dayz_rollingMessages;
_preventRefund = false; _preventRefund = false;

View File

@@ -1,6 +1,6 @@
private "_pos"; private "_pos";
if (isNil {_this select 0}) exitWith {[0,0,0]}; //if (isNil {_this select 0}) exitWith {[0,0,0]};
_thingy = _this select 0; _thingy = _this select 0;
_pos = getPosASL _thingy; _pos = getPosASL _thingy;

View File

@@ -15,9 +15,10 @@
"PVDZE_veh_Lock" addPublicVariableEventHandler {(_this select 1) call local_lockUnlock}; "PVDZE_veh_Lock" addPublicVariableEventHandler {(_this select 1) call local_lockUnlock};
"PVDZE_plr_GutBodyZ" addPublicVariableEventHandler {(_this select 1) spawn local_gutObjectZ}; "PVDZE_plr_GutBodyZ" addPublicVariableEventHandler {(_this select 1) spawn local_gutObjectZ};
"PVDZE_veh_Init" addPublicVariableEventHandler {(_this select 1) call fnc_veh_ResetEH}; "PVDZE_veh_Init" addPublicVariableEventHandler {(_this select 1) call fnc_veh_ResetEH};
"PVDZE_obj_Remove" addPublicVariableEventHandler {_pos = (_this select 1); _obj = nearestObjects [_pos, DZE_isWreckBuilding, 5]; if (count _obj > 0) then {deleteVehicle (_obj select 0);};};
{ if (toLower worldName == "chernarus") then {
if (toLower worldName != "chernarus") exitWith {}; {
private ["_building","_fckingcode"]; private ["_building","_fckingcode"];
_fckingcode = { _fckingcode = {
@@ -55,7 +56,7 @@
_building = [_x select 0,_x select 1,0] nearestObject (_x select 2); _building = [_x select 0,_x select 1,0] nearestObject (_x select 2);
_building removeAllEventHandlers "handleDamage"; _building removeAllEventHandlers "handleDamage";
_building addEventHandler ["handleDamage", _fckingcode]; _building addEventHandler ["handleDamage", _fckingcode];
} forEach [ } forEach [
[7069,7727,206458], [6009,7815,203486], [10638,8016,272598], [6553,5598,223435], [6914,11431,141876], [7069,7727,206458], [6009,7815,203486], [10638,8016,272598], [6553,5598,223435], [6914,11431,141876],
[4660,9596,145234], [4788,10257,143923], [11467,7479,276453], [4628,10489,137736], [4551,6395,212964], [4660,9596,145234], [4788,10257,143923], [11467,7479,276453], [4628,10489,137736], [4551,6395,212964],
[3815,8948,132069], [3804,8925,132182], [11957,9120,261904], [12031,9158,261252], [12057,9103,261945], [3815,8948,132069], [3804,8925,132182], [11957,9120,261904], [12031,9158,261252], [12057,9103,261945],
@@ -68,7 +69,8 @@
[6679,2302,969332], [2587,5069,188570], [6537,2302,968797], [10424,2562,362226], [10420,2368,363222], [6679,2302,969332], [2587,5069,188570], [6537,2302,968797], [10424,2562,362226], [10420,2368,363222],
[10443,2345,363318], [10481,2358,363308], [10365,2241,363748], [10518,2288,364628], [10457,2256,363454], [10443,2345,363318], [10481,2358,363308], [10365,2241,363748], [10518,2288,364628], [10457,2256,363454],
[10174,1810,366820], [3589,2175,328944] [10174,1810,366820], [3589,2175,328944]
]; ];
};
// Server only // Server only
if (isServer) then { if (isServer) then {

View File

@@ -124,4 +124,13 @@ switch (_variable) do {
PVDZE_plr_FriendRQ = _arraytosend; PVDZE_plr_FriendRQ = _arraytosend;
_owner publicVariableClient "PVDZE_plr_FriendRQ"; _owner publicVariableClient "PVDZE_plr_FriendRQ";
}; };
case "RemoveObject": {
PVDZE_obj_Remove = _arraytosend;
{
if (isPlayer _x) then {
(owner _x) publicVariableClient "PVDZE_obj_Remove";
};
} forEach playableUnits;
};
}; };