Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. if(isNil "life_markers") then {
  2. life_markers = false;
  3. };
  4. life_markers = !life_markers;
  5. if (life_markers) then {
  6. hint "Marker Acildi";
  7.  
  8.  
  9. life_markers_active = findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", "
  10. private _vehicles = [];
  11. private _crewNames = [];
  12. private _entitiesInVehicle = [];
  13. private _allUnits = [];
  14. private _allDeads = [];
  15. private ['_text','_vehicleTexture','_sideColor'];
  16. {_entitiesInVehicle pushBackUnique _x;} forEach (allUnits select {!(isNull objectParent _x) && !(isNull _x)});
  17. {_vehicles pushBackUnique _x;} forEach (vehicles select {((_x isKindOf ""LandVehicle"")||(_x isKindOf ""Air"")||(_x isKindOf ""Ship"")) && !(isNull _x)});
  18. {_allUnits pushBackUnique _x;} forEach (allUnits select {!isNull _x});
  19. {_allDeads pushBackUnique _x;} forEach (allDeadMen select {!(isNull _x) && !(_x in _allUnits)});
  20. {
  21. if !(isNull _x) then {
  22. _vehicleTexture = [getText (configfile >> ""CfgVehicles"" >> typeOf _x >> ""icon"")] call BIS_fnc_textureVehicleIcon;
  23. _sideColor = [side group _x] call BIS_fnc_sideColor;
  24. if (_x in _vehicles) then {
  25. if (crew _x isEqualTo []) then {
  26. _text = getText (configfile >> 'CfgVehicles' >> typeOf _x >> 'displayName')
  27. } else {
  28. _crewNames = [];
  29. {_crewNames pushBackUnique (_x getVariable['realname',name _x]);} forEach (crew _x select {alive _x});
  30. _text = format ['%1',_crewNames joinString ' , '];
  31. };
  32. } else {
  33. if (_x in _allDeads) then {
  34. _text = _x getVariable['realname',''];
  35. _sideColor = [East] call BIS_fnc_sideColor;
  36. _vehicleTexture = ""pictureHeal"";
  37. } else {
  38. _text = _x getVariable['realname',name _x];
  39. };
  40. };
  41.  
  42. _this select 0 drawIcon [_vehicleTexture, _sideColor, getPosASLVisual _x, 24.0, 24.0, getDirVisual _x, _text, 0, 0.04, 'TahomaB', 'right'];
  43. };
  44. } forEach (_allUnits + _allDeads + _vehicles - _entitiesInVehicle);
  45. "];
  46. } else {
  47. hint "Marker Kapatildi";
  48.  
  49. findDisplay 12 displayCtrl 51 ctrlRemoveEventHandler ["Draw", life_markers_active];
  50. };
  51. disableserialization;
  52. _display = (findDisplay 12);
  53. _map = _display displayCtrl 51;
  54. _event = _map ctrlAddEventHandler["Draw",{
  55. ["playersNames", "onEachFrame", {
  56. {
  57. if (_x != player && (player distance _x) < viewDistance) then {
  58. _color = [1,1,1,1];
  59. if (side _x == west) then { _color = [0.5,0.5,1,1]; };
  60. _pos = getPosVisual _x;
  61. _text = format["%1 [%2]", name _x, round(player distance _x)];
  62. drawIcon3D ["", _color, _pos, 0, 0, 0, _text, 0, 0.035, "puristaLight"];
  63. };
  64. } forEach playableUnits;
  65. }] call BIS_fnc_addStackedEventHandler;
  66. }];
  67.  
  68.  
  69.  
  70.  
  71.  
  72. (finddisplay 46) closeDisplay 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement