forked from Giallustio/HeartsAndMinds
-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1371 from Vdauphin/Add-log_copypaste_inventory
Add: Copy and paste inventory from any boxes/vehicles to any objects with inventory
- Loading branch information
Showing
6 changed files
with
115 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/inventoryCopy.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
/* ---------------------------------------------------------------------------- | ||
Function: btc_log_fnc_inventoryCopy | ||
Description: | ||
Fill me when you edit me ! | ||
Parameters: | ||
_searchLocation - Object to search around. [Object] | ||
Returns: | ||
Examples: | ||
(begin example) | ||
_result = [] call btc_log_fnc_inventoryCopy; | ||
(end) | ||
Author: | ||
Vdauphin | ||
---------------------------------------------------------------------------- */ | ||
|
||
params [ | ||
["_searchLocation", objNull, [objNull]] | ||
]; | ||
|
||
private _objects = nearestObjects [_searchLocation, ["AllVehicles", "ThingX"], 3]; | ||
|
||
if (_objects isEqualTo []) exitWith {(localize "STR_BTC_HAM_O_COPY_NOOBJECTS") call CBA_fnc_notify}; | ||
|
||
btc_copy_inventory = [_objects select 0] call btc_log_fnc_inventoryGet; | ||
|
||
(localize "str_mission_completed") call CBA_fnc_notify; |
39 changes: 39 additions & 0 deletions
39
=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/inventoryPaste.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
/* ---------------------------------------------------------------------------- | ||
Function: btc_log_fnc_inventoryPaste | ||
Description: | ||
Fill me when you edit me ! | ||
Parameters: | ||
_copy_container - [Array] | ||
_searchLocation - Object to search around. [Object] | ||
Returns: | ||
Examples: | ||
(begin example) | ||
_result = [] call btc_log_fnc_inventoryPaste; | ||
(end) | ||
Author: | ||
Vdauphin | ||
---------------------------------------------------------------------------- */ | ||
|
||
params [ | ||
["_inventory", [], [[]]], | ||
["_searchLocation", objNull, [objNull]] | ||
]; | ||
|
||
private _objects = nearestObjects [_searchLocation, ["AllVehicles", "ThingX"], 3]; | ||
|
||
if ( | ||
isNil "_inventory" || | ||
{flatten _inventory isEqualTo []} | ||
) exitWith {(localize "STR_BTC_HAM_O_PASTE_NOCOPIEDI") call CBA_fnc_notify}; | ||
if (_objects isEqualTo []) exitWith {(localize "STR_BTC_HAM_O_COPY_NOOBJECTS") call CBA_fnc_notify}; | ||
|
||
[_objects select 0, _inventory] call btc_log_fnc_inventorySet; | ||
|
||
(localize "str_mission_completed") call CBA_fnc_notify; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters