2016-05-03 20:37:02 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Play the detector sound
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
2016-07-07 01:14:26 +00:00
|
|
|
* 1: Sound class <STRING>
|
2016-05-03 20:37:02 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2016-07-04 22:04:58 +00:00
|
|
|
* [player, "ace_buzz_1", 1] call ace_minedetector_fnc_playDetectorSound
|
2016-05-03 20:37:02 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-07-07 01:14:26 +00:00
|
|
|
params ["_unit", "_soundClass"];
|
2016-05-03 20:37:02 +00:00
|
|
|
|
2016-06-16 15:33:21 +00:00
|
|
|
if (isNull _unit) exitWith {
|
2016-10-02 10:55:31 +00:00
|
|
|
ERROR_1("unit does not exist [%1]",_unit);
|
2016-05-07 17:08:36 +00:00
|
|
|
};
|
2016-06-16 15:33:21 +00:00
|
|
|
if (!alive _unit) exitWith {
|
2016-10-02 10:55:31 +00:00
|
|
|
ERROR_1("unit is not alive [%1]",_unit);
|
2016-05-03 20:37:02 +00:00
|
|
|
};
|
|
|
|
|
2016-07-07 15:38:53 +00:00
|
|
|
if (_unit getVariable [QGVAR(isUsingHeadphones), false] && {_unit == ACE_player}) then {
|
2016-07-07 13:51:34 +00:00
|
|
|
playSound _soundClass;
|
2016-07-07 01:14:26 +00:00
|
|
|
} else {
|
|
|
|
private _posASL = AGLtoASL (_unit modelToWorld (_unit selectionPosition "granat"));
|
2016-07-09 23:00:53 +00:00
|
|
|
[_soundClass, _posASL, 3, 15] call EFUNC(common,playConfigSound3D);
|
2016-07-07 01:14:26 +00:00
|
|
|
};
|