mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
f73b6b1aad
- Add the possibility of switching between headphones or speaker - Move detector actions to their own submenu
35 lines
754 B
Plaintext
35 lines
754 B
Plaintext
/*
|
|
* Author: Glowbal
|
|
* Play the detector sound
|
|
*
|
|
* Arguments:
|
|
* 0: Unit <OBJECT>
|
|
* 1: Sound class <STRING>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [player, "ace_buzz_1", 1] call ace_minedetector_fnc_playDetectorSound
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
params ["_unit", "_soundClass"];
|
|
|
|
if (isNull _unit) exitWith {
|
|
ACE_LOGERROR_1("unit does not exist [%1]",_unit);
|
|
};
|
|
if (!alive _unit) exitWith {
|
|
ACE_LOGERROR_1("unit is not alive [%1]",_unit);
|
|
};
|
|
|
|
if (_unit getVariable [QGVAR(isUsingHeadphones), false]) then {
|
|
_unit say2D _soundClass;
|
|
} else {
|
|
private _posASL = AGLtoASL (_unit modelToWorld (_unit selectionPosition "granat"));
|
|
[_soundClass, _posASL, 5, 15] call EFUNC(common,playConfigSound3D);
|
|
};
|