Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "..\..\script_macros.hpp"
- if (!life_settings_tagson) exitWith {};
- private ["_ui","_units","_masks"];
- #define iconID 78000
- #define scale 0.8
- if (visibleMap || {!alive player} || {dialog}) exitWith {
- 500 cutText["","PLAIN"];
- };
- _ui = uiNamespace getVariable ["Life_HUD_nameTags",displayNull];
- if (isNull _ui) then {
- 500 cutRsc["Life_HUD_nameTags","PLAIN"];
- _ui = uiNamespace getVariable ["Life_HUD_nameTags",displayNull];
- };
- _units = nearestObjects[(visiblePosition player),["Man","Land_Pallet_MilBoxes_F","Land_Sink_F"],50];
- _units = _units - [player];
- _masks = LIFE_SETTINGS(getArray,"clothing_masks");
- private _index = -1; {
- private "_text";
- _idc = _ui displayCtrl (iconID + _forEachIndex);
- if (!(lineIntersects [eyePos player, eyePos _x, player, _x]) && alive _x && {!isNil {_x getVariable "realname"}}) then {
- _pos = switch (typeOf _x) do {
- case "Land_Pallet_MilBoxes_F": {[visiblePosition _x select 0, visiblePosition _x select 1, (getPosATL _x select 2) + 1.5]};
- case "Land_Sink_F": {[visiblePosition _x select 0, visiblePosition _x select 1, (getPosATL _x select 2) + 2]};
- default {[visiblePosition _x select 0, visiblePosition _x select 1, ((_x modelToWorld (_x selectionPosition "head")) select 2)+.5]};
- };
- _sPos = worldToScreen _pos;
- _distance = _pos distance player;
- if (count _sPos > 1 && {_distance < 15}) then {
- _text = switch (true) do {
- case (((headgear _x) in _masks || (goggles _x) in _masks || (uniform _x) in _masks) && side _x isEqualTo civilian): {format ["<t><img image='icons\ico_mask.paa' size='1'></img></t><t color='#000000'> Maskeli</t>"]};
- case (_x in (units group player) && playerSide isEqualTo civilian): {format ["<t color='#00FF00'>%1</t>",(_x getVariable ["realname",name _x])];};
- case (side _x isEqualTo west && {!isNil {_x getVariable "rank"}}): {format ["<img image='%1' size='1'></img><t color='#00CCFF'>%2</t>",switch ((_x getVariable "rank")) do {
- case 2: {"icons\ico_copRank2.paa"};
- case 3: {"icons\ico_copRank3.paa"};
- case 4: {"icons\ico_copRank4.paa"};
- case 5: {"icons\ico_copRank5.paa"};
- case 6: {"icons\ico_copRank6.paa"};
- case 7: {"icons\ico_copRank7.paa"};
- case 8: {"icons\ico_copRank8.paa"};
- default {"icons\ico_copRank1.paa"};
- },_x getVariable ["realname",name _x]]};
- case (side _x isEqualTo independent): {format ["<t><img image='icons\ico_medicRank.paa' size='1'></img></t><t color='#FF0000'>%1</t>",_x getVariable ["realname",name _x]]};
- default {
- if (!isNil {(group _x) getVariable "gang_name"}) then {
- format ["<t color='#FFFFFF'>%1</t><br/><t size='0.75' color='#CCCCCC'>%2</t>",_x getVariable ["realname",name _x],(group _x) getVariable ["gang_name",""]];
- } else {
- if (alive _x) then {
- format ["<t color='#FFFFFF'>%1</t>",(_x getVariable ["realname",name _x])];
- } else {
- if (!isPlayer _x) then {
- _x getVariable ["realname","ERROR"];
- };
- };
- };
- };
- };
- if(_x getVariable ["speaking",false] && side _x isEqualTo civilian) then {_text = "<img image='\A3\ui_f\data\igui\rscingameui\rscdisplayvoicechat\microphone_ca.paa' size='1.25'></img>" + _text};
- if(_x getVariable ["speaking",false] && side _x isEqualTo west) then {_text = "<t color='#00CCFF'><img image='\A3\ui_f\data\igui\rscingameui\rscdisplayvoicechat\microphone_ca.paa' size='1.25'></img></t>" + _text};
- if(_x getVariable ["speaking",false] && side _x isEqualTo independent) then {_text = "<t color='#FF0000'><img image='\A3\ui_f\data\igui\rscingameui\rscdisplayvoicechat\microphone_ca.paa' size='1.25'></img></t>" + _text};
- _idc ctrlSetStructuredText parseText _text;
- _idc ctrlSetPosition [_sPos select 0, _sPos select 1, 0.4, 0.65];
- _idc ctrlSetScale scale;
- _idc ctrlSetFade 0;
- _idc ctrlCommit 0;
- _idc ctrlShow true;
- } else {
- _idc ctrlShow false;
- };
- } else {
- _idc ctrlShow false;
- };
- _index = _forEachIndex;
- } forEach _units;
- (_ui displayCtrl (iconID + _index + 1)) ctrlSetStructuredText parseText "";
Advertisement