functions to mute unit

This commit is contained in:
commy2 2015-04-12 10:05:49 +02:00
parent 018854a7c3
commit 54f29d75f5
5 changed files with 19 additions and 3 deletions

View File

@ -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));
};
};
};

View File

@ -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", {

View File

@ -124,6 +124,7 @@ PREP(moduleCheckPBOs);
PREP(moduleLSDVehicles);
PREP(moveToTempGroup);
PREP(muteUnit);
PREP(muteUnitHandleRespawn);
PREP(numberToDigits);
PREP(numberToDigitsString);
PREP(numberToString);

View 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);

View File

@ -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);