mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
108ff4f644
Regex used: \[(.+?),(.+?),(.+?)\]\s+call\s+E?FUNC\((common,)?(target|object)Event\) [$1,$3,$2] call CBA_fnc_targetEvent E?FUNC\((common,)?(server|global|local)Event\) CBA_fnc_$2Event E?FUNC\((common,)?(add|remove)EventHandler\) CBA_fnc_$2EventHandler
25 lines
633 B
Plaintext
25 lines
633 B
Plaintext
// 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);
|
|
};
|
|
}] call CBA_fnc_addEventHandler;
|