Delete added trees after chopping down

Like 496681c, if a tree or plant was added with createVehicle it can be
deleted with deleteVehicle.
This commit is contained in:
ebayShopper
2017-04-04 13:55:43 -04:00
parent 496681cd9b
commit b70555e664
2 changed files with 19 additions and 11 deletions

View File

@@ -105,12 +105,16 @@ if (!isNull _tree) then {
format[localize "str_player_24_progress", _counter,_countOut] call dayz_rollingMessages;
};
if (_proceed ||(_counter > 0) ) then {
//remove vehicle, Need to ask server to remove.
if (_proceed || (_counter > 0)) then {
//localize "str_choppingTree" call dayz_rollingMessages;
//localize "str_player_25" call dayz_rollingMessages;
if (typeOf _tree == "") then {
// Ask server to setDamage on tree and sync for JIP
PVDZ_objgather_Knockdown = [_tree,player];
publicVariableServer "PVDZ_objgather_Knockdown";
//"Chopping down tree." call dayz_rollingMessages;
//localize "str_player_25" call dayz_rollingMessages;
} else {
deleteVehicle _tree;
};
};
if !(_proceed) then {
localize "str_player_24_Stoped" call dayz_rollingMessages;

View File

@@ -17,14 +17,18 @@ if (_ammo in ["Hatchet_Swing_Ammo","Chainsaw_Swing_Ammo"]) then {
// get 2d distance
_distance2d = [player, _tree] call BIS_fnc_distance2D;
if(_distance2d <= 5) then {
if (_distance2d <= 5) then {
// damage must be going down
_damage = damage _tree;
if (DZE_TEMP_treedmg < _damage) then {
if (_damage < 0.99 && {(random 1) > 0.9}) then {
PVDZ_objgather_Knockdown = [_tree,player]; // Ask server to setDamage on tree
if (typeOf _tree == "") then {
// Ask server to setDamage on tree and sync for JIP
PVDZ_objgather_Knockdown = [_tree,player];
publicVariableServer "PVDZ_objgather_Knockdown";
} else {
deleteVehicle _tree;
};
};
_itemOut = if (_ammo == "Chainsaw_Swing_Ammo") then {"PartWoodLumber"} else {"PartWoodPile"}; // Log can be crafted to > 2x plank > 4x woodpile
[_itemOut,1,1] call fn_dropItem;