fnc_jammersServerPFH.sqf 723 B

123456789101112131415161718192021222324
  1. params["_args", "_handle"];
  2. if(!isServer) exitWith {
  3. diag_log "[RD501 Jammers][Server PFH] Exiting :: Not Server";
  4. [_handle] call CBA_fnc_removePerFrameHandler;
  5. };
  6. private _jammers = localNamespace getVariable ["rd501_jammers_server",[]];
  7. if(count _jammers == 0) exitWith {
  8. diag_log "[RD501 Jammers][Server PFH] Exiting :: No Jammers";
  9. [_handle] call CBA_fnc_removePerFrameHandler;
  10. };
  11. {
  12. _x params["_jammer", "_radius", "_strength", "_active"];
  13. if(_jammer isEqualTo objNull || !(alive _jammer)) then {
  14. diag_log format["[RD501 Jammers][Server PFH] Removing Jammer %1",_jammer];
  15. _jammers set [_foreachIndex, []];
  16. };
  17. } forEach _jammers;
  18. _jammers = _jammers - [[]];
  19. [_jammers] call rd501_fnc_jammersUpdateServer;