AgentRev 22 Posted May 14, 2016 As per the title, those event handlers do not seem to work at all. I tried adding them server-side, but the assigned code never gets called. addMissionEventHandler ["PlayerDisconnected", { diag_log format ["test123 %1", _this] }]; Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted May 14, 2016 IIRC there is currently a bug where you must call the old event command prior to adding the mission event. This is how I run it, no issues. onPlayerConnected {}; // 1.58 bug, must be called before below mission event will work onPlayerDisconnected {}; // 1.58 bug, must be called before below mission event will work { addMissionEventHandler _x; } forEach [ ['Ended',{/* code */}], ['EntityKilled',{/* code */}], ['EntityRespawned',{/* code */}], ['HandleDisconnect',{/* code */}], ['PlayerConnected',{/* code */}], ['PlayerDisconnected',{/* code */}] ]; 2 Share this post Link to post Share on other sites
commy2 188 Posted May 15, 2016 Instead of "onPlayerConnected {}" one should use "BIS_fnc_addStackedEventHandler" with "onPlayerConnected" to initialize (?) the event. That way you at least don't overwrite other events that make use of "BIS_fnc_addStackedEventHandler". Example: https://github.com/CBATeam/CBA_A3/blob/62f7ee38861940146610bd26b09e17515863310e/addons/common/XEH_preInit.sqf#L40-L43 Last time I tried, this bug only applied to "onPlayerConnected" and not to the "Disconnected" variant. This should really be fixed. 2 Share this post Link to post Share on other sites
AgentRev 22 Posted May 16, 2016 Last time I tried, this bug only applied to "onPlayerConnected" and not to the "Disconnected" variant. Just tested, both oPC and oPD need a dummy stacked EH for their homologous mission EH to trigger. Can be setup anywhere before or after addMissionEventHandler. Share this post Link to post Share on other sites
commy2 188 Posted May 16, 2016 Interesting. For PlayerDisconnected this was supposedly fixed during 1.57 dev. It even appeared in a changelog. Maybe the change didn't make it into stable branch? https://forums.bistudio.com/topic/140837-development-branch-changelog/?p=3002942 Tweaked: The PlayerDisconnected mission Event Handler is now called even when the OnPlayerDisconnected command is not used Share this post Link to post Share on other sites
killzone_kid 1333 Posted May 16, 2016 This bug is known and the programmer is notified, it is a waiting game now ;) Share this post Link to post Share on other sites