Jump to content
777eza

Friendly Fire Preventer icon?

Recommended Posts

Hello, does anyone know of a script to show friendly unit that aren't in a group. I need some kind of indicator to help prevent FF. To clarify I'm not looking for map markers for friendly unit but either a system that when you look at them there name is shown as green in the center of the screen or just all friendly units have a icon on them or something like that. both cases I've seen before but couldn't find any scripts about them. Any help would be really appreciated. :D

Share this post


Link to post
Share on other sites

Here you go! When you aim on a unit it will display their name in their side's colour.

[] spawn {
	["FriendlyHUD", "onEachFrame", {
		_target = cursorTarget;
		_isFriendly = if ( ( (side player) getFriend (side _target) ) > 0.6 ) then {true} else {false};
		if (alive _target && _isFriendly && (_target isKindOf "Man") && (player distance _target) <= 200) then {
			_markerPath = (configFile >> "CfgMarkers" >> "mil_dot" >> "icon") call BIS_fnc_getCfgData;
			_configColor = (configFile >> "CfgMarkerColors" >> (format["Color%1", (side _target)]) >> "color") call BIS_fnc_getCfgData;
			_color = _configColor call BIS_fnc_colorConfigToRGBA;
			_pos = _target modelToWorld (_target selectionPosition "head_axis");
			drawIcon3D [_markerPath, _color, [_pos select 0, _pos select 1, (_pos select 2) + 0.5], 1, 1, 0, (name _target), 0];
		};
	}] call BIS_fnc_addStackedEventHandler;
};
  • Like 1

Share this post


Link to post
Share on other sites

You could make people wear helmets like this. That will definitly help preventing FF.

XD I suppose that's one way.

 

 

Here you go! When you aim on a unit it will display their name in their side's colour.

[] spawn {
	["FriendlyHUD", "onEachFrame", {
		_target = cursorTarget;
		_isFriendly = if ( ( (side player) getFriend (side _target) ) > 0.6 ) then {true} else {false};
		if (alive _target && _isFriendly && (_target isKindOf "Man") && (player distance _target) <= 200) then {
			_markerPath = (configFile >> "CfgMarkers" >> "mil_dot" >> "icon") call BIS_fnc_getCfgData;
			_configColor = (configFile >> "CfgMarkerColors" >> (format["Color%1", (side _target)]) >> "color") call BIS_fnc_getCfgData;
			_color = _configColor call BIS_fnc_colorConfigToRGBA;
			_pos = _target modelToWorld (_target selectionPosition "head_axis");
			drawIcon3D [_markerPath, _color, [_pos select 0, _pos select 1, (_pos select 2) + 0.5], 1, 1, 0, (name _target), 0];
		};
	}] call BIS_fnc_addStackedEventHandler;
};

Thank you so much! This is exactly what I was looking for.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×