Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private ["_unitID","_name","_text","_ctrl","_pos","_veh","_dst"];
- #define __GcVP(uvarname) (uiNamespace getVariable #uvarname)
- disableSerialization;
- 1 cutRsc ["Hud","PLAIN",0];
- while {true} do {
- _unitID = 0;
- sleep 0.03;
- {
- if (effectiveCommander vehicle _x == _x) then {_unitID = _unitID + 1};
- _ctrl = __GcVP(HDPU) displayCtrl (5200 + _unitID);
- _veh = vehicle _x;
- _dst = round (_veh distance (vehicle player));
- ctrlShow [_ctrl,false];
- _ctrl ctrlSetStructuredText parseText "";
- if (alive _x) then {
- _pos = getPosATL _veh;
- _mask = "<t size='%4' shadow='1' align='center' color='%5'>%1<t color='%6'>%2<br/><t color='%7'>%3m</t>";
- if (_veh != _x) then {
- _text = "<br/>["+gettext(configFile >> "CfgVehicles" >> (typeof _veh) >> "displayName")+"]";
- _name = parseText format [_mask,name _x,_text,_dst,1.0,"#AAFFAA","#FFFFFF","#AAAAFF"];
- _pos set [2,(_pos select 2)+5]
- } else {
- _text = (if (damage _x > 0.1) then {"<br/>[Ранен]"} else {""});
- _name = parseText format [_mask,name _x,_text,_dst,1.0,"#AAFFAA","#FF0000","#AAAAFF"];
- _pos set [2,(_pos select 2)+4];
- };
- _pos = worldToScreen _pos;
- if ((count _pos)!= 0) then {
- ctrlShow [_ctrl,true];
- _ctrl ctrlSetStructuredText _name;
- _ctrl ctrlSetPosition [(_pos select 0)-0.125,_pos select 1];
- _ctrl ctrlCommit 0;
- waitUntil {ctrlCommitted _ctrl}
- }
- }
- } foreach allUnits
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement