fnc_jammersServerPFH.sqf 764 B

12345678910111213141516171819202122232425262728
  1. params["_args", "_handle"];
  2. if(!isServer) exitWith {
  3. [_handle] call CBA_fnc_removePerFrameHandler;
  4. };
  5. private _jammers = missionNamespace getVariable ["rd501_jammers",[]];
  6. private _toRemove = [];
  7. {
  8. _x params["_jammer", "_radius", "_strength"];
  9. systemChat format["%1 -- %2", _jammer, _radius];
  10. _jipId = _jammer getVariable ["rd501_jammer_jipId", -1];
  11. if(_jammer == objNull || !(alive _jammer)) then {
  12. _toRemove pushBack _x;
  13. if(_jipId != 1) then {
  14. [_jipId] call CBA_fnc_removeGlobalEventJIP;
  15. };
  16. };
  17. } forEach _jammers;
  18. _jammers = _jammers - _toRemove;
  19. missionNamespace setVariable ["rd501_jammers", _jammers, true];
  20. if(count _jammers == 0) exitWith {
  21. systemChat "Exiting Server PFH";
  22. [_handle] call CBA_fnc_removePerFrameHandler;
  23. };