ACE3/addons/backpacks/functions/fnc_backpackOpened.sqf

44 lines
891 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
/*
* Author: commy2
2015-09-26 18:29:08 +00:00
* Someone opened your backpack. Play sound and camshake. Execute locally.
*
2015-09-26 18:29:08 +00:00
* Arguments:
* 0: Who accessed your inventory? <Object>
* 1: Unit that wields the backpack <Object>
* 2: The backpack object <Object>
*
2015-09-26 18:29:08 +00:00
* Return Value:
* None
*
* Example:
* [bob, kevin, backpack] call ace_backpacks_fnc_backpackOpened
*
2015-09-26 18:29:08 +00:00
* Public: No
*/
2015-09-26 18:29:08 +00:00
params ["_target", "_backpack"];
// do cam shake if the target is the player
2016-01-06 21:42:02 +00:00
if (_target call EFUNC(common,isPlayer)) then {
addCamShake [4, 0.5, 5];
};
2015-09-26 18:29:08 +00:00
// play a zipper sound effect
2016-01-06 21:42:02 +00:00
private _sounds = [
2015-08-13 19:57:58 +00:00
QUOTE(PATHTO_R(sounds\zip_in.wav)),
QUOTE(PATHTO_R(sounds\zip_out.wav))
];
2016-01-06 21:42:02 +00:00
private _position = AGLToASL (_target modelToWorldVisual (_target selectionPosition "Spine3"));
playSound3D [
2015-11-29 15:33:25 +00:00
selectRandom _sounds,
objNull,
false,
_position,
1,
1,
50
];