Помогите создать глушилку для task force. Суть такова, что при включении, создаётся поле с помехами, которые слабеют, когда игрок отходит от центра этого поля помех
На просторах сети нашёл такой скрипт, но он не работает
Скрытый текст
//put code below into init.sqf (radioPole can be any object pre-placed in editor and called radioPole) //you can made any variation of names //it is not testet with many jammers but probably it will work some_fnc_jamTfar = compile loadFile "scripts\jamTfar.sqf"; [] spawn { [[radioPole, 5000, 60000]] call some_fnc_jamTfar; }; jammingStarted = false; ======================= //put code below into scripts\jamTfar.sqf private ["_multiplier", "_receive", "_func_calcMultiplier", "_interferenceObjects"]; _interferenceObjects = _this; if (count _this == 0) exitWith {}; if (isDedicated) exitWith {}; _func_calcMultiplier = { private ["_return"]; _return = 0; { private ["_jammer", "_distance", "_radius", "_terrainInterception", "_distCoef", "_mult", "_jammForce"]; _jammer = _x select 0; _radius = _x select 1; _jammForce = _x select 2; _distance = _jammer distance player; if(alive _jammer) then { if (_distance < _radius) then { if (_radius != 0 && _jammForce != 0 && jammingStarted) then { _terrainInterception = _jammer call TFAR_fnc_calcTerrainInterception; _distCoef = (_distance + _terrainInterception * TF_terrain_interception_coefficient + _terrainInterception * TF_terrain_interception_coefficient * (_distance / _jammForce)) / _radius; _mult = 1.0 - _distCoef; _return = _return + _mult; }; }; }; } forEach _this; if (_return > 1.0) then { _return = 1.0; }; _return }; sleep 1; while {true} do { _multiplier = _interferenceObjects call _func_calcMultiplier; player setVariable ["tf_sendingDistanceMultiplicator", 1.0 - _multiplier]; if (_multiplier > 0) then { if (_multiplier > 0.99) then { _receive = 50; } else { _receive = 1 / (1 - _multiplier); }; } else { _receive = 1.0; }; player setVariable ["tf_receivingDistanceMultiplicator", _receive]; sleep 3; }; ======================= //put code below in initLocalPlayer.sqf (if you will be close enough of radioPole, menu will appear) fnc_jamming_start = { jammingStarted = true; publicVariable "jammingStarted"; }; fnc_jamming_stop = { jammingStarted = false; publicVariable "jammingStarted"; }; player addAction ["<t color=""#FFFF00"">start jam", fnc_jamming_start, [], 7, true, true, "", "[radioPole, player] call BIS_fnc_inTrigger && !jammingStarted"]; player addAction ["<t color=""#FFFF00"">stop jam", fnc_jamming_stop, [], 7, true, true, "", "[radioPole, player] call BIS_fnc_inTrigger && jammingStarted"];
Edited by Coop, 28 March 2018 - 21:47.