2015-09-26 18:45:19 +00:00
|
|
|
// by commy2
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
// unmute unit if that player disconnects
|
|
|
|
if (isServer) then {
|
|
|
|
addMissionEventHandler ["HandleDisconnect", {
|
|
|
|
[_this select 0, "isPlayer"] call EFUNC(common,unmuteUnit);
|
|
|
|
}];
|
|
|
|
};
|
|
|
|
|
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
|
|
|
|
// mutes/unmutes units when the player changes
|
|
|
|
["playerChanged", {
|
|
|
|
params ["_newPlayer", "_oldPlayer"];
|
|
|
|
|
|
|
|
// mute the new player
|
|
|
|
[_newPlayer, "isPlayer"] call EFUNC(common,muteUnit);
|
|
|
|
|
|
|
|
// unmute the old player
|
|
|
|
if (alive _oldPlayer) then {
|
|
|
|
[_oldPlayer, "isPlayer"] call EFUNC(common,unmuteUnit);
|
|
|
|
};
|
2016-05-22 15:29:05 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|