Closed ToxaBes2 closed 7 years ago
Нужно что-то типа:
_allowedPlayers = ["B_engineer_F", "B_T_Engineer_F"];
_mineIcon = getText (configfile >> "CfgInGameUI" >> "Cursor" >> "explosive");
_mineColor = getArray (configfile >> "CfgInGameUI" >> "Cursor" >> "explosiveColor");
minesArray = [];
{
if (_x isEqualType "") then
{
_mineColor set [_forEachIndex, call compile _x];
};
} forEach _mineColor;
if ("MineDetector" in items player && (typeOf player) in _allowedPlayers) then { { if (mineActive _x && _x distance player <= 200) then { minesArray pushBack [[_mineIcon, _mineColor, CENTER_POS(_x), 1, 1, 0, "", 2, 0, "PuristaMedium", "", true], _x, _posCode]; }; } forEach detectedMines playerSide; };
2. отрисовка (возможно тут нужно добавить отрисовку на компоненте)
```sqf
somehandler = addMissionEventHandler ["Draw3D",
{
{
_x params ["_drawArr", "_obj", "_posCode"];
if (alive _obj) then { _drawArr set [2, _obj call _posCode] };
drawIcon3D _drawArr;
} forEach minesArray;
}];
По каким-то причинам БИСы выпилили его:
_display = uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull];
_display createDisplay "RscCustomInfoMineDetect";
Отображет детектор но он не работает. В configfile >> "RscCustomInfoMineDetect" есть:
onLoad = "[""onLoad"",_this,""RscCustomInfoMineDetect"",'IGUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay')";
onUnload = "[""onUnload"",_this,""RscCustomInfoMineDetect"",'IGUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay')";
scriptName = "RscCustomInfoMineDetect";
scriptPath = "IGUI";
Добавить компонент пока можно только модом. Ждем пока БИСы вернут этот компонент в дефолтный список или добавят команды для управления компонентами.
Нам нужно вот такое: