mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
742626ff1a
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
34 lines
819 B
Plaintext
34 lines
819 B
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: commy2
|
|
* Handle the open inventory event. Camshake and sound on target client.
|
|
*
|
|
* Arguments:
|
|
* 0: Unit <OBJECT>
|
|
* 1: Backpack <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* false. Always open the inventory dialog. <BOOL>
|
|
*
|
|
* Example:
|
|
* [bob, backpack] call ace_backpacks_fnc_onOpenInventory
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_unit", "_backpack"];
|
|
|
|
// exit if the target is not a real backpack, i.e. parachute, static weapon bag etc.
|
|
if !(_backpack call FUNC(isBackpack)) exitWith {false};
|
|
|
|
// get the unit that wears the backpack object
|
|
private _target = objectParent _backpack;
|
|
|
|
if (isNull _target) exitWith {false};
|
|
|
|
// raise event on target unit
|
|
["ace_backpackOpened", [_target, _backpack], _target] call CBA_fnc_targetEvent;
|
|
|
|
// return false to open inventory as usual
|
|
false
|