Jump to content


Photo

Глушилка Task forсe радиочастот


  • Please log in to reply
3 replies to this topic

#1 OFFLINE   Coop

Coop

    Рядовой

  • Пользователи
  • 2 posts

Posted 28 March 2018 - 21:43

Помогите создать глушилку для task force. Суть такова, что при включении, создаётся поле с помехами, которые слабеют, когда игрок отходит от центра этого поля помех

 

На просторах сети нашёл такой скрипт, но он не работает

 

 

Скрытый текст

Edited by Coop, 28 March 2018 - 21:47.

  • 0

#2 OFFLINE   евгений373

евгений373

    Ефрейтор

  • Пользователи
  • 38 posts

Posted 03 April 2018 - 17:08

активировать триггером пробовал?


  • 0

#3 OFFLINE   Coop

Coop

    Рядовой

  • Пользователи
  • 2 posts

Posted 04 April 2018 - 23:31

ага


  • 0

#4 OFFLINE   Sp0wN

Sp0wN

    Рядовой

  • Пользователи
  • 2 posts

Posted 23 April 2018 - 23:49

Так там же все написано: 

 

//put code below into init.sqf (radioPole can be any object pre-placed in editor and called radioPole)             прописать в свой init.sqf

//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             создать файл путь к которому папка 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)        Прописать код в свой initLocalPlayer.sqf (если нету создать)

 
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"]; //появится екшен ВЫКЛ. глушитель

  • 0




Яндекс.Метрика