ACE3/addons/common/functions/fnc_muteUnitHandleRespawn.sqf

25 lines
696 B
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
2015-09-18 19:46:21 +00:00
/*
* Author: commy2
* Applies speaker changes on respawn. Used because speaker is respawning breaks the speaker on non-local clients. Also resets the public object variable (broken for JIP clients, that join after respawn)
*
* Arguments:
* 0: unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [bob] call ace_common_fnc_muteUnitHandleRespawn
*
2015-09-18 19:46:21 +00:00
* Public: No
*/
2015-04-12 08:05:49 +00:00
2015-09-18 19:46:21 +00:00
params ["_unit"];
2015-04-12 08:05:49 +00:00
// setVariable is broken on JIP after respawn
_unit setVariable [QGVAR(muteUnitReasons), _unit getVariable [QGVAR(muteUnitReasons), []], true];
// fix mp issues with respawning and the speaker
[QGVAR(setSpeaker), [_unit, speaker _unit]] call CBA_fnc_globalEvent;