Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
kamikaz333

player's addEventHandler not firing on dedicated server

Recommended Posts

Hi!

The problem I have is, that the eventHandler is not firing for the player on a dedicated server. The AI unit handles work, I can see them in the server log, but I can't see any log in my client's logfile. If I understand it correctly, then the player's handle should fire on the client, but it doesn't. Below is the code I'm trying to use in a test mission.

init.sqf

if (isServer) then
{
   {
       if (_x isKindOf "CAManBase" && !isPlayer _x) then { _x call compile 'handledamage.sqf';};
   } foreach allUnits;
}
else
{
   player call compile 'handledamage.sqf'; 
};

handledamage.sqf

fnc_HandleDamageEH = {
   diag_log format["HANDLEDAMAGE: %1", _this];
   _unit           = _this select 0;
   _selection      = _this select 1;
   _damage         = _this select 2;
   //_projectile = _this select 4;

   _damage;
};

_unit = _this;

waitUntil{alive _unit};

handleDamageEH = _unit addEventHandler ["HandleDamage", { if (local (_this select 0)) then { _this call fnc_HandleDamageEH; } }];

SOLUTION:

Found the problem. The mod @DevCon has a "feature" that makes the admin invincible by the "handleDamage" event. I've searched to disable it, but haven't found anything, so just removed the mod and that solved it. If you want debugging tools just add this "enableDebugConsole = 1;" line in description.ext, so you can use the ingame BIS tool.

Edited by kamikaz333
SOLVED

Share this post


Link to post
Share on other sites
Have you tried addMPEventHandler instead of addEventHandler?

It doesn't work. It's only for "MPHit" and "MPKilled" events.

Share this post


Link to post
Share on other sites

Found the problem. The mod @DevCon has a "feature" that makes the admin invincible by the "handleDamage" event. I've searched to disable it, but haven't found anything, so just removed the mod and that solved it. If you want debugging tools just add this "enableDebugConsole = 1;" line in description.ext, so you can use the ingame BIS tool.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×