Code Cleanup NoRadio

This commit is contained in:
commy2 2015-09-26 20:45:19 +02:00
parent f77242fce3
commit 0509e26690
4 changed files with 29 additions and 38 deletions

View File

@ -1,6 +1,6 @@
class Extended_PostInit_EventHandlers { class Extended_PostInit_EventHandlers {
class ADDON { class ADDON {
clientInit = QUOTE(call COMPILE_FILE(XEH_post_initClient)); init = QUOTE(call COMPILE_FILE(XEH_postInit));
serverInit = QUOTE(call COMPILE_FILE(XEH_post_initServer));
}; };
}; };

View File

@ -0,0 +1,24 @@
// 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 EFUNC(common,addEventhandler);

View File

@ -1,27 +0,0 @@
// by commy2
#include "script_component.hpp"
/*
[{
if (!isNull ACE_player) then {
[(_this select 1)] call cba_fnc_removePerFrameHandler;
[ACE_player, "isPlayer"] call EFUNC(common,muteUnit);
};
}, 0, []] call CBA_fnc_addPerFrameHandler;
*/
if (!hasInterface) exitWith {};
// 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);

View File

@ -1,6 +0,0 @@
// by commy2
#include "script_component.hpp"
addMissionEventHandler ["HandleDisconnect", {
[_this select 0, "isPlayer"] call EFUNC(common,unmuteUnit);
}];