Jump to content

chasEE

Member
  • Content Count

    1
  • Joined

  • Last visited

  • Medals

Everything posted by chasEE

  1. Hello! Recently, I've been trying to do a remake of my "kill-feed" script, but have ran into some difficulties. When trying out my script in single-player and on a locally hosted server, it works fine, but when I try my script on a dedicated server, it for some reason doesn't work. Let me explain. Here is the code for a function called fn_killfeedAIEH.sqf, which assigns two event handlers to an AI passed in a previous function. params ["_ai"]; if (isNull _ai) exitWith {}; _ai addEventHandler ["HitPart", { killfeedAIArray = _this; }]; _ai addEventHandler ["Killed", { _killed = _this select 0; _killer = _this select 1; _array = killfeedAIArray; (format ["%1",_array]) remoteExec ["hint", _killer]; // Used to see if _array is defined (debug thing) [_killed,_killer,_array] remoteExec ["kill_fnc_killfeedCompile", _killer]; //[_killed,_killer,killfeedAIArray] spawn kill_fnc_killfeedCompile; (ORIGIONAL) }]; As I said before, this part works fine in single-player and on a locally hosted server, but as soon as I try to host it on a dedicated server, the "killfeedAIArray" will not transfer to the other event handler. I found this out when I added "(format ["%1",_array]) remoteExec ["hint", _killer];" to the "Killed" event-handler and it displays "any" instead of the HitPart array you would usually get. One thing to note is that the event-handler HitPart IS working on a dedicated server; I found this out by adding "hint str _this" to the code: _ai addEventHandler ["HitPart", { killfeedAIArray = _this; hint str _this; }]; This would display the array on the client showing that it is in fact working as intended. I have already tried "slowing" down the function to see if maybe "HitPart" was executing after "Killed". I used this alteration of the code to test it: params ["_ai"]; if (isNull _ai) exitWith {}; _ai addEventHandler ["HitPart", { killfeedAIArray = _this; }]; _ai addEventHandler ["Killed", { _killed = _this select 0; _killer = _this select 1; // Spawn a function to delay [_killed,_killer] spawn { _killed = _this select 0; _killer = _this select 1; sleep 1; _array = killfeedAIArray; (format ["%1",_array]) remoteExec ["hint", _killer]; [_killed,_killer,_array] remoteExec ["kill_fnc_killfeedCompile", _killer]; }; }]; The array still displayed "any", and after hours of messing around with no success, I've reached out to see if maybe one of you guys could provide me some insight. If you want to see the whole code, PM me or if there is enough requests I will edit the post. Thanks! -chasEE
×