Fire - Add ability to disable screams for individual units (#9863)

* Disable screams for individual units

* Update addons/fire/XEH_postInit.sqf

* Changed wording

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* isGlobal instead of true

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

---------

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
This commit is contained in:
Dart 2024-03-21 14:20:23 -05:00 committed by GitHub
parent 8c69bd25ea
commit af3c95a5a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 3 deletions

View File

@ -3,8 +3,8 @@
[QGVAR(burn), FUNC(burn)] call CBA_fnc_addEventHandler;
[QGVAR(playScream), {
params ["_scream", "_source"];
// only play sound if enabled in settings
if (GVAR(enableScreams)) then {
// only play sound if enabled in settings and enabled for the unit
if (GVAR(enableScreams) && {_source getVariable [QGVAR(enableScreams), true]}) then {
_source say3D _scream;
};
}] call CBA_fnc_addEventHandler;
@ -35,4 +35,3 @@
GVAR(fireSources) = [[], nil] call CBA_fnc_hashCreate;
};
}] call CBA_fnc_addEventHandler;

View File

@ -37,3 +37,12 @@ Use `CBA_fnc_serverEvent` to use the following features. Events are defined only
| Arguments | Type | Optional (default value)
---| --------- | ---- | ------------------------
0 | Fire source ID | Any | Required
## 2. Variables
Screams can be disabled for an individual unit by setting the `ace_fire_enableScreams` variable on the unit, which can be synced across machines.
```sqf
_unit setVariable ["ace_fire_enableScreams", false, _isGlobal];
```