mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-11 18:52:56 +03:00
remove any output if no space for all items
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
DayZ Base Building Upgrades
|
DayZ Base Building Upgrades
|
||||||
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
|
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
|
||||||
*/
|
*/
|
||||||
private ["_location","_dir","_classname","_text","_object","_objectID","_objectUID","_newclassname","_refund","_obj","_upgrade","_objectCharacterID","_canBuildOnPlot","_friendlies","_nearestPole","_ownerID","_distance","_needText","_findNearestPoles","_findNearestPole","_IsNearPlot","_i","_invResult","_itemOut","_countOut"];
|
private ["_location","_dir","_classname","_text","_object","_objectID","_objectUID","_newclassname","_refund","_obj","_upgrade","_objectCharacterID","_canBuildOnPlot","_friendlies","_nearestPole","_ownerID","_distance","_needText","_findNearestPoles","_findNearestPole","_IsNearPlot","_i","_invResult","_itemOut","_countOut","_abortInvAdd","_addedItems"];
|
||||||
|
|
||||||
if(TradeInprogress) exitWith { cutText ["Downgrade already in progress." , "PLAIN DOWN"]; };
|
if(TradeInprogress) exitWith { cutText ["Downgrade already in progress." , "PLAIN DOWN"]; };
|
||||||
TradeInprogress = true;
|
TradeInprogress = true;
|
||||||
@@ -87,7 +87,9 @@ if ((count _upgrade) > 0) then {
|
|||||||
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||||
|
|
||||||
_invResult = false;
|
_invResult = false;
|
||||||
|
_abortInvAdd = false;
|
||||||
_i = 0;
|
_i = 0;
|
||||||
|
_addedItems = [];
|
||||||
|
|
||||||
{
|
{
|
||||||
_itemOut = _x select 0;
|
_itemOut = _x select 0;
|
||||||
@@ -95,14 +97,20 @@ if ((count _upgrade) > 0) then {
|
|||||||
|
|
||||||
for "_x" from 1 to _countOut do {
|
for "_x" from 1 to _countOut do {
|
||||||
_invResult = [player,_itemOut] call BIS_fnc_invAdd;
|
_invResult = [player,_itemOut] call BIS_fnc_invAdd;
|
||||||
|
if(!_invResult) exitWith {
|
||||||
|
_abortInvAdd = true;
|
||||||
|
};
|
||||||
if(_invResult) then {
|
if(_invResult) then {
|
||||||
_i = _i + 1;
|
_i = _i + 1;
|
||||||
|
_addedItems set [(count _addedItems),[_itemOut,1]];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (_abortInvAdd) exitWith {};
|
||||||
|
|
||||||
} forEach _refund;
|
} forEach _refund;
|
||||||
|
|
||||||
// all parts removed proceed
|
// all parts added proceed
|
||||||
if(_i != 0) then {
|
if(_i != 0) then {
|
||||||
|
|
||||||
// Get position
|
// Get position
|
||||||
@@ -131,6 +139,10 @@ if ((count _upgrade) > 0) then {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
cutText [format["\n\n%1 of %2 could not be added to your inventory. (not enough room?)", _i,_itemOut], "PLAIN DOWN"];
|
cutText [format["\n\n%1 of %2 could not be added to your inventory. (not enough room?)", _i,_itemOut], "PLAIN DOWN"];
|
||||||
|
{
|
||||||
|
[player,(_x select 0),(_x select 1)] call BIS_fnc_invRemove;
|
||||||
|
} forEach _addedItems;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user