mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
functions to mute unit
This commit is contained in:
parent
018854a7c3
commit
54f29d75f5
@ -41,4 +41,9 @@ class Extended_Respawn_EventHandlers {
|
||||
respawn = QUOTE(_this call FUNC(resetAllDefaults));
|
||||
};
|
||||
};
|
||||
class CAManBase {
|
||||
class GVAR(muteUnit) {
|
||||
respawn = QUOTE(_this call FUNC(muteUnitHandleRespawn));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -35,6 +35,7 @@ if (hasInterface) then {
|
||||
|
||||
["setDir", {(_this select 0) setDir (_this select 1)}] call FUNC(addEventhandler);
|
||||
["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler);
|
||||
["setSpeaker", {(_this select 0) setSpeaker (_this select 1)}] call FUNC(addEventhandler);
|
||||
|
||||
// hack to get PFH to work in briefing
|
||||
[QGVAR(onBriefingPFH), "onEachFrame", {
|
||||
|
@ -124,6 +124,7 @@ PREP(moduleCheckPBOs);
|
||||
PREP(moduleLSDVehicles);
|
||||
PREP(moveToTempGroup);
|
||||
PREP(muteUnit);
|
||||
PREP(muteUnitHandleRespawn);
|
||||
PREP(numberToDigits);
|
||||
PREP(numberToDigitsString);
|
||||
PREP(numberToString);
|
||||
|
12
addons/common/functions/fnc_muteUnitHandleRespawn.sqf
Normal file
12
addons/common/functions/fnc_muteUnitHandleRespawn.sqf
Normal file
@ -0,0 +1,12 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_unit";
|
||||
|
||||
_unit = _this select 0;
|
||||
|
||||
// setVariable is broken on JIP after respawn
|
||||
_unit setVariable [QGVAR(muteUnitReasons), _unit getVariable [QGVAR(muteUnitReasons), []], true];
|
||||
|
||||
// fix mp issues with respawning and the speaker
|
||||
["setSpeaker", [_unit, speaker _unit]] call FUNC(globalEvent);
|
@ -23,6 +23,3 @@ _respawnVariables pushBack "ACE_PersistentFunctions";
|
||||
{
|
||||
_unit setVariable [_x, _unit getVariable _x, true];
|
||||
} forEach _respawnVariables;
|
||||
|
||||
// fix speaker after respawn
|
||||
[_unit, format ["{_this setSpeaker '%1'}", speaker _unit], 2] call FUNC(execRemoteFnc);
|
||||
|
Loading…
Reference in New Issue
Block a user