mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
48 lines
1.1 KiB
Plaintext
48 lines
1.1 KiB
Plaintext
/*
|
|
* Author: commy2
|
|
* Someone opened your backpack. Play sound and camshake. Execute locally.
|
|
*
|
|
* Arguments:
|
|
* 0: Who accessed your inventory? (Object)
|
|
* 1: Unit that wields the backpack (Object)
|
|
* 2: The backpack object (Object)
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params ["_target", "_backpack"];
|
|
|
|
// do cam shake if the target is the player
|
|
if ([_target] call EFUNC(common,isPlayer)) then {
|
|
addCamShake [4, 0.5, 5];
|
|
};
|
|
|
|
// play a zipper sound effect
|
|
private ["_sounds", "_position"];
|
|
|
|
_sounds = [
|
|
/*"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWpstDnon_medic.wss",
|
|
"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWrflDnon_medic.wss",
|
|
"a3\sounds_f\characters\ingame\AinvPpneMstpSlayWpstDnon_medic.wss",
|
|
"a3\sounds_f\characters\ingame\AinvPpneMstpSlayWrflDnon_medic.wss"*/
|
|
|
|
QUOTE(PATHTO_R(sounds\zip_in.wav)),
|
|
QUOTE(PATHTO_R(sounds\zip_out.wav))
|
|
];
|
|
|
|
_position = AGLToASL (_target modelToWorldVisual (_target selectionPosition "Spine3"));
|
|
|
|
playSound3D [
|
|
_sounds select floor random count _sounds,
|
|
objNull,
|
|
false,
|
|
_position,
|
|
1,
|
|
1,
|
|
50
|
|
];
|