From 1f430b99204d8ea2ba24b2108813f9b1d4a0e8c5 Mon Sep 17 00:00:00 2001 From: krazey Date: Fri, 28 Jun 2013 18:40:25 +0200 Subject: [PATCH] Add chopped wood to a weaponholder This will spawn the wood in a weaponholder, which is much more reliable =) ..and prevents "flooding" of the inventory. --- SQF/dayz_code/actions/player_chopWood.sqf | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/SQF/dayz_code/actions/player_chopWood.sqf b/SQF/dayz_code/actions/player_chopWood.sqf index 22ba22a0c..cad0ca9ff 100644 --- a/SQF/dayz_code/actions/player_chopWood.sqf +++ b/SQF/dayz_code/actions/player_chopWood.sqf @@ -103,11 +103,12 @@ if (count(_findNearestTree) >= 1) then { _counter = _counter + 1; }; - cutText ["Chopping down tree, walk away at anytime to cancel.", "PLAIN DOWN"]; + cutText [format["Chopping down tree, walk away at anytime to cancel. (1%/2%)", _counter, _countOut], "PLAIN DOWN"]; if(_counter == _countOut) exitWith { _isOk = false; _proceed = true; + sleep 1; }; }; @@ -115,9 +116,11 @@ if (count(_findNearestTree) >= 1) then { _itemOut = "PartWoodPile"; - for "_x" from 1 to _countOut do { - player addMagazine _itemOut; - }; + _item = createVehicle ["WeaponHolder", getPosATL player, [], 1, "CAN_COLLIDE"]; + _item addMagazineCargoGlobal [_itemOut,_countOut]; + _item modelToWorld getPosATL player; + _item setdir (getDir player); + player reveal _item; // chop down tree if("" == typeOf _tree) then { @@ -125,7 +128,7 @@ if (count(_findNearestTree) >= 1) then { }; //diag_log format["DEBUG TREE DAMAGE: %1", _tree]; - cutText [format["%1 piles of wood has been successfully added to your inventory.", _countOut], "PLAIN DOWN"]; + cutText [format["%1 piles of wood has been successfully added in front of you.", _countOut], "PLAIN DOWN"]; } else { r_interrupt = false; @@ -143,4 +146,4 @@ if (count(_findNearestTree) >= 1) then { } else { cutText [localize "str_player_23", "PLAIN DOWN"]; }; -TradeInprogress = false; \ No newline at end of file +TradeInprogress = false;