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