Advertisement
Dimon_UA

Untitled

Oct 21st, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. private ["_unitID","_name","_text","_ctrl","_pos","_veh","_dst"];
  3. #define __GcVP(uvarname) (uiNamespace getVariable #uvarname)
  4. disableSerialization;
  5. 1 cutRsc ["Hud","PLAIN",0];
  6. while {true} do {
  7.     _unitID = 0;
  8.     sleep 0.03;
  9.     {
  10.         if (effectiveCommander vehicle _x == _x) then {_unitID = _unitID + 1};
  11.         _ctrl = __GcVP(HDPU) displayCtrl (5200 + _unitID);
  12.         _veh = vehicle _x;
  13.         _dst = round (_veh distance (vehicle player));
  14.         ctrlShow [_ctrl,false];
  15.         _ctrl ctrlSetStructuredText parseText "";
  16.         if (alive _x) then {
  17.             _pos = getPosATL _veh;
  18.             _mask = "<t size='%4' shadow='1' align='center' color='%5'>%1<t color='%6'>%2<br/><t color='%7'>%3m</t>";
  19.             if (_veh != _x)  then {
  20.                 _text = "<br/>["+gettext(configFile >> "CfgVehicles" >> (typeof _veh) >> "displayName")+"]";
  21.                 _name = parseText format [_mask,name _x,_text,_dst,1.0,"#AAFFAA","#FFFFFF","#AAAAFF"];
  22.                 _pos set [2,(_pos select 2)+5]
  23.             } else {
  24.                
  25.                 _text = (if (damage _x > 0.1) then {"<br/>[Ранен]"} else {""});
  26.                 _name = parseText format [_mask,name _x,_text,_dst,1.0,"#AAFFAA","#FF0000","#AAAAFF"];
  27.                 _pos set [2,(_pos select 2)+4];
  28.             };
  29.             _pos = worldToScreen _pos;     
  30.             if ((count _pos)!= 0) then {               
  31.                 ctrlShow [_ctrl,true];         
  32.                 _ctrl ctrlSetStructuredText _name;
  33.                 _ctrl ctrlSetPosition [(_pos select 0)-0.125,_pos select 1];
  34.                 _ctrl ctrlCommit 0;
  35.                 waitUntil {ctrlCommitted _ctrl}
  36.             }
  37.         }
  38.     } foreach allUnits
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement