mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
48912be73c
* Block radio on captive/surrendered/unconscious via status effect * missing semicolon * Don't broadcast setVar if radio addon doesn't exist Co-authored-by: PabstMirror <pabstmirror@gmail.com>
51 lines
1.1 KiB
Plaintext
51 lines
1.1 KiB
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: Glowbal
|
|
* Sets the volume of the game, including third party radio modifications such as TFAR and ACRE.
|
|
*
|
|
* Arguments:
|
|
* 0: setVolume (default: false) <BOOL>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [true] call ace_common_fnc_setVolume
|
|
*
|
|
* Public: Yes
|
|
*
|
|
* Note: Uses player
|
|
*/
|
|
|
|
#define MUTED_LEVEL 0.2
|
|
#define NORMAL_LEVEL 1
|
|
#define NO_SOUND 0
|
|
|
|
params [
|
|
["_setVolume", false],
|
|
["_unit", player]
|
|
];
|
|
|
|
if (_setVolume) then {
|
|
// Vanilla Game
|
|
2 fadeSound NORMAL_LEVEL;
|
|
|
|
// TFAR
|
|
_unit setVariable ["tf_voiceVolume", NORMAL_LEVEL, true];
|
|
_unit setVariable ["tf_globalVolume", NORMAL_LEVEL];
|
|
|
|
// ACRE2
|
|
if (!isNil "acre_api_fnc_setGlobalVolume") then { [NORMAL_LEVEL^0.33] call acre_api_fnc_setGlobalVolume; };
|
|
|
|
} else {
|
|
// Vanilla Game
|
|
2 fadeSound MUTED_LEVEL;
|
|
|
|
// TFAR
|
|
_unit setVariable ["tf_voiceVolume", NO_SOUND, true];
|
|
_unit setVariable ["tf_globalVolume", MUTED_LEVEL];
|
|
|
|
// ACRE2
|
|
if (!isNil "acre_api_fnc_setGlobalVolume") then { [MUTED_LEVEL^0.33] call acre_api_fnc_setGlobalVolume; };
|
|
};
|