ACE3/addons/noradio/XEH_post_initClient.sqf

30 lines
721 B
Plaintext
Raw Normal View History

// by commy2
2015-01-14 03:04:25 +00:00
#include "script_component.hpp"
/*
2015-01-14 03:36:53 +00:00
_setupPlayer = {
if (!isNull ACE_player) then {
[(_this select 1)] call cba_fnc_removePerFrameHandler;
[ACE_player, "isPlayer"] call EFUNC(common,muteUnit);
};
};
2015-01-14 03:36:53 +00:00
[_setupPlayer, 0, []] call CBA_fnc_addPerFrameHandler;
*/
if (!hasInterface) exitWith {};
2015-01-14 03:36:53 +00:00
// Mutes/unmutes units when the player changes
["playerChanged", {
EXPLODE_2_PVT(_this,_newPlayer,_oldPlayer);
// On player change mute the new player
[_newPlayer, "isPlayer"] call EFUNC(common,muteUnit);
// Unmute the old player
if (alive _oldPlayer) then {
[_oldPlayer, "isPlayer"] call EFUNC(common,unmuteUnit);
};
}] call EFUNC(common,addEventhandler);