1
0

fnc_jammersAddServer.sqf 843 B

123456789101112131415161718
  1. params["_jammer", "_radius", "_strength", "_active"];
  2. if(!isServer) exitWith { diag_log "[RD501 Jammers] Attempted to add to jammers from a non server context"; };
  3. _jammers = localNamespace getVariable ["rd501_jammers_server",[]];;
  4. _jammers pushBack [_jammer, _radius, _strength, _active];
  5. diag_log format["[RD501 Jammers] Added Jammer '%1'", [_jammer, _radius, _strength, _active]];
  6. localNamespace setVariable ["rd501_jammers_server",_jammers];
  7. private _pfhHandle = localNamespace getVariable ["rd501_jammers_serverPFH", -1];
  8. if(_pfhHandle isEqualTo -1) then {
  9. private _handle = [{
  10. _this call rd501_fnc_jammersServerPFH;
  11. }, 2, []] call CBA_fnc_addPerFrameHandler;
  12. localNamespace getVariable ["rd501_jammers_serverPFH", _handle];
  13. diag_log format["[RD501 Jammers][Server Add] Started server PFH with handle '%1'", _handle];
  14. _handle
  15. };