1.
```
addMissionEventHandler ["EntityCreated",OT_fnc_entityspawned];
OT_fnc_entityspawned = {
params ["_unit"];
if (_unit isKindOf "Man") then {
_unit allowdamage false;
_unit spawn {
sleep 3;
_this allowdamage true;
if !(isPlayer leader _this) then {
_this call OT_fnc_replace;
};
};
};
};
OT_fnc_replace = {
params ["_unit"];
_unit addEventHandler ["FiredMan", {
params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"];
diag_log format ["Unit of type %2 fired with params: %1",_this,typeof _unit];
if !(_muzzle isEqualType "" && {_muzzle == "LIB_FLARE_PISTOL" && {alive _unit && {(server getvariable ["NATOmanpower",3000]) > 100}}}) exitWith {};
[{
params ["_unit","_projectile","_hndl"];
diag_log "Doing something";
}, [_unit,_projectile,_thisEventHandler], 4] call CBA_fnc_waitAndExecute;
}];
};
```
The result was stable on dedicated, until I added an additional condition check.
2.
```
[_veh, ["EpeContactStart",{
params ["_o1", "_o2", "", "", "_force"];
if !(local _o1) exitWith {};
_exp = _o1 getvariable ["exp",0];
if (side _o1 in [west, civilian] && {side _o2 in [west, civilian]}) then {
diag_log "Doing something";
};
}]] remoteexeccall ["addEventHandler",0];
```
Rare result:
Error position: <side _o2 in [west, civilian]}) then {
Error side: Type String, expected Object,Group,Location
Happens randomly on the server, and I encountered it when I added EH via remoteexec on all machines.