mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
Update maintain to new CHILD function
This commit is contained in:
@@ -82,7 +82,7 @@ switch _option do {
|
|||||||
cutText [format[(localize "STR_EPOCH_ACTIONS_4"), _count], "PLAIN DOWN", 5];
|
cutText [format[(localize "STR_EPOCH_ACTIONS_4"), _count], "PLAIN DOWN", 5];
|
||||||
while {3 >= _retry} do { // 3 Times
|
while {3 >= _retry} do { // 3 Times
|
||||||
_retry = _retry + 1;
|
_retry = _retry + 1;
|
||||||
PVDZE_maintainArea = [player,[_target, _objectClasses, _range],_uniqueID];
|
PVDZE_maintainArea = [player,1,[_target, _objectClasses, _range],_uniqueID];
|
||||||
publicVariableServer "PVDZE_maintainArea";
|
publicVariableServer "PVDZE_maintainArea";
|
||||||
sleep 20;
|
sleep 20;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -80,31 +80,18 @@ if (_proceed) then {
|
|||||||
// all parts removed proceed
|
// all parts removed proceed
|
||||||
if (_tobe_removed_total == _removed_total) then {
|
if (_tobe_removed_total == _removed_total) then {
|
||||||
|
|
||||||
// Get position
|
_uniqueID = random(99999);
|
||||||
_location = _obj getVariable["OEMPos",(getposATL _obj)];
|
_retry = 0;
|
||||||
|
cutText [format[(localize "STR_EPOCH_ACTIONS_4"), _count], "PLAIN DOWN", 5];
|
||||||
// Get direction
|
while {2 >= _retry} do { // 2 Times
|
||||||
_dir = getDir _obj;
|
_retry = _retry + 1;
|
||||||
|
PVDZE_maintainArea = [player,2,[_obj],_uniqueID];
|
||||||
// Find CharacterID
|
publicVariableServer "PVDZE_maintainArea";
|
||||||
_objectCharacterID = _obj getVariable ["CharacterID","0"];
|
sleep 20;
|
||||||
|
};
|
||||||
// Create new object
|
|
||||||
_object = createVehicle [_classname, [0,0,0], [], 0, "CAN_COLLIDE"];
|
|
||||||
|
|
||||||
// Set direction
|
|
||||||
_object setDir _dir;
|
|
||||||
|
|
||||||
// Set location
|
|
||||||
_object setPosATL _location;
|
|
||||||
|
|
||||||
PVDZE_obj_Swap = [_objectCharacterID,_object,[_dir,_location],_classname,_obj,player];
|
|
||||||
publicVariableServer "PVDZE_obj_Swap";
|
|
||||||
|
|
||||||
cutText [format[(localize "str_epoch_player_144"),_text], "PLAIN DOWN", 5];
|
cutText [format[(localize "str_epoch_player_144"),_text], "PLAIN DOWN", 5];
|
||||||
|
|
||||||
player reveal _object;
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
{player addMagazine _x;} forEach _temp_removed_array;
|
{player addMagazine _x;} forEach _temp_removed_array;
|
||||||
|
|||||||
@@ -1,24 +1,33 @@
|
|||||||
/* Maintain Area - written by Skaronator
|
/* Maintain Area - written by Skaronator */
|
||||||
How to use: PVDZE_maintainArea = [player,[_target, _objectClasses, _range]];
|
private ["_player","_ObjArray","_uniqueID","_objects","_key"];
|
||||||
*/
|
|
||||||
private ["_player","_area","_uniqueID","_objects","_key"];
|
|
||||||
_player = _this select 0;
|
_player = _this select 0;
|
||||||
_area = _this select 1;
|
_option = _this select 1;
|
||||||
_uniqueID = _this select 2;
|
/*
|
||||||
|
1: PVDZE_maintainArea = [player,1,[_target, _objectClasses, _range],_uniqueID];
|
||||||
|
2: PVDZE_maintainArea = [player,2,[_object],_uniqueID];
|
||||||
|
*/
|
||||||
|
_ObjArray = _this select 2;
|
||||||
|
_uniqueID = _this select 3;
|
||||||
|
|
||||||
if (_uniqueID in DZEMaintainCache) exitWith { }; //Just do it only one time
|
if (_uniqueID in DZEMaintainCache) exitWith { }; //Just do it only one time
|
||||||
|
|
||||||
DZEMaintainCache = DZEMaintainCache + [_uniqueID];
|
DZEMaintainCache = DZEMaintainCache + [_uniqueID];
|
||||||
|
|
||||||
_objects = nearestObjects _area;
|
if (_option == 1) then {
|
||||||
|
_objects = nearestObjects _ObjArray;
|
||||||
|
|
||||||
{
|
{
|
||||||
_objectID = _x getVariable ["ObjectID","0"];
|
_objectID = _x getVariable ["ObjectID","0"];
|
||||||
//_objectUID = _x getVariable ["ObjectUID","0"];
|
//_objectUID = _x getVariable ["ObjectUID","0"];
|
||||||
|
|
||||||
_key = format["CHILD:396:%1:", _objectID]; //Use ID instead of UID because ID is shorter
|
_key = format["CHILD:396:%1:", _objectID]; //Use ID instead of UID because ID is shorter
|
||||||
_key call server_maintainObj;
|
_key call server_maintainObj;
|
||||||
} forEach _objects;
|
} forEach _objects;
|
||||||
|
|
||||||
|
|
||||||
diag_log format ["MAINTAIN AREA BY %1 - %2 Objects at %3", name _player, count _objects, position _player];
|
diag_log format ["MAINTAIN AREA BY %1 - %2 Objects at %3", name _player, count _objects, position _player];
|
||||||
|
};
|
||||||
|
if (_option == 2) then {
|
||||||
|
_objectID = _ObjArray getVariable ["ObjectID","0"];
|
||||||
|
_key = format["CHILD:396:%1:", _objectID]; //Use ID instead of UID because ID is shorter
|
||||||
|
_key call server_maintainObj;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user