2015-03-10 16:18:21 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
*
|
|
|
|
* Someone opened your backpack. Execute locally.
|
|
|
|
*
|
|
|
|
* Argument:
|
|
|
|
* 0: Who accessed your inventory? (Object)
|
|
|
|
* 1: Unit that wields the backpack (Object)
|
|
|
|
* 2: The backpack object (Object)
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* None.
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
private ["_unit", "_target"];
|
|
|
|
|
|
|
|
_unit = _this select 0;
|
|
|
|
_target = _this select 1;
|
|
|
|
_backpack = _this select 2;
|
|
|
|
|
|
|
|
// do cam shake if the target is the player
|
|
|
|
if ([_target] call EFUNC(common,isPlayer)) then {
|
|
|
|
addCamShake [4, 0.5, 5];
|
|
|
|
};
|
|
|
|
|
|
|
|
// play a rustling sound
|
|
|
|
private ["_sounds", "_position"];
|
|
|
|
|
|
|
|
_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"*/
|
|
|
|
|
|
|
|
QUOTE(PATHTO_R(sounds\zip_in.wav)),
|
|
|
|
QUOTE(PATHTO_R(sounds\zip_out.wav))
|
2015-03-10 16:18:21 +00:00
|
|
|
];
|
|
|
|
|
2015-04-03 22:26:27 +00:00
|
|
|
_position = _target modelToWorldVisual (_target selectionPosition "Spine3");
|
2015-03-10 16:18:21 +00:00
|
|
|
_position = _position call EFUNC(common,positionToASL);
|
|
|
|
|
|
|
|
playSound3D [
|
|
|
|
_sounds select floor random count _sounds,
|
|
|
|
objNull,
|
|
|
|
false,
|
|
|
|
_position,
|
|
|
|
1,
|
|
|
|
1,
|
|
|
|
50
|
|
|
|
];
|