2015-03-10 16:18:21 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
2015-09-26 18:29:08 +00:00
|
|
|
* Someone opened your backpack. Play sound and camshake. Execute locally.
|
2015-03-10 16:18:21 +00:00
|
|
|
*
|
2015-09-26 18:29:08 +00:00
|
|
|
* Arguments:
|
2015-03-10 16:18:21 +00:00
|
|
|
* 0: Who accessed your inventory? (Object)
|
|
|
|
* 1: Unit that wields the backpack (Object)
|
|
|
|
* 2: The backpack object (Object)
|
2015-08-04 23:12:55 +00:00
|
|
|
*
|
2015-09-26 18:29:08 +00:00
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
2015-03-10 16:18:21 +00:00
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
2015-09-26 18:29:08 +00:00
|
|
|
|
2015-08-04 23:12:55 +00:00
|
|
|
params ["_target", "_backpack"];
|
2015-03-10 16:18:21 +00:00
|
|
|
|
|
|
|
// do cam shake if the target is the player
|
|
|
|
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
|
|
|
|
private ["_sounds", "_position"];
|
2015-03-10 16:18:21 +00:00
|
|
|
|
|
|
|
_sounds = [
|
2015-03-10 16:48:24 +00:00
|
|
|
/*"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWpstDnon_medic.wss",
|
2015-03-10 16:18:21 +00:00
|
|
|
"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWrflDnon_medic.wss",
|
|
|
|
"a3\sounds_f\characters\ingame\AinvPpneMstpSlayWpstDnon_medic.wss",
|
2015-03-10 16:48:24 +00:00
|
|
|
"a3\sounds_f\characters\ingame\AinvPpneMstpSlayWrflDnon_medic.wss"*/
|
|
|
|
|
2015-08-13 19:57:58 +00:00
|
|
|
QUOTE(PATHTO_R(sounds\zip_in.wav)),
|
|
|
|
QUOTE(PATHTO_R(sounds\zip_out.wav))
|
2015-03-10 16:18:21 +00:00
|
|
|
];
|
|
|
|
|
2015-09-26 18:29:08 +00:00
|
|
|
_position = AGLToASL (_target modelToWorldVisual (_target selectionPosition "Spine3"));
|
2015-03-10 16:18:21 +00:00
|
|
|
|
|
|
|
playSound3D [
|
2015-11-29 15:33:25 +00:00
|
|
|
selectRandom _sounds,
|
2015-03-10 16:18:21 +00:00
|
|
|
objNull,
|
|
|
|
false,
|
|
|
|
_position,
|
|
|
|
1,
|
|
|
|
1,
|
|
|
|
50
|
|
|
|
];
|