Advertisement
Guest User

Untitled

a guest
Dec 28th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 KB | None | 0 0
  1. /*
  2. File: fn_playerTags.sqf
  3. Author: Bryan "Tonic" Boardwine
  4.  
  5. Description:
  6. Adds the tags above other players heads when close and have visible range.
  7. */
  8. scopeName "main";
  9. onEachFrame
  10. {
  11. private["_vis","_pos","_near","_name","_icon","_width","_height","_gang"];
  12.  
  13. if (life_adminXray == 1) then {
  14. {
  15. if (isPlayer _x) then {
  16. _pos = visiblePosition _x;
  17. _pos set[2,(getPosATL _x select 2) + 2.2];
  18. _name = name _x;
  19. drawIcon3D ["",[1,1,1,1],_pos,0,0,0,_name,0,0.04];
  20. };
  21. } forEach allUnits;
  22. breakTo "main";
  23. };
  24.  
  25. //Handles showing icons for S.W.A.T. and Police to be able to see each other without being in the same group.
  26. if (side player == west) then
  27. {
  28. {
  29. if (side _x == west) then
  30. {
  31. if (_x getVariable["swatlevel",0] != 0 && player getVariable["swatlevel",0] == 0) then
  32. {
  33. _pos = visiblePosition _x;
  34. _pos set[2,(getPosATL _x select 2) + 2];
  35. _width = 0.85;
  36. _height = 0.85;
  37. _icon = [6,"texture"] call BIS_fnc_rankParams;
  38. drawIcon3D [_icon,[1,1,1,1],_pos,_width,_height,0,"",0,0.04];
  39. };
  40.  
  41. if (_x getVariable["swatlevel",0] == 0 && player getVariable["swatlevel",0] != 0) then
  42. {
  43. _pos = visiblePosition _x;
  44. _pos set[2,(getPosATL _x select 2) + 2];
  45. _width = 0.85;
  46. _height = 0.85;
  47. _icon = [0,"texture"] call BIS_fnc_rankParams;
  48. drawIcon3D [_icon,[1,1,1,1],_pos,_width,_height,0,"",0,0.04];
  49. };
  50. };
  51. } foreach allUnits;
  52. };
  53.  
  54. _near = getPos player nearEntities ["Man",10];
  55. {
  56. if(player distance _x < 10 && isPlayer _x && _x != player) then
  57. {
  58. _vis = lineIntersects [eyePos player, eyePos _x,player, _x];
  59. if(!_vis) then
  60. {
  61. _icon = "";
  62. _pos = visiblePosition _x;
  63. _pos set[2,(getPosATL _x select 2) + 2.2];
  64. _width = 0.85;
  65. _height = 0.85;
  66. switch (_x getVariable["coplevel", 0]) do
  67. {
  68. case (1) : {_name = format["Police Cadet %1", name _x];};
  69. case (2) : {_name = format["Police Constable %1", name _x];};
  70. case (3) : {_name = format["Police Sergeant %1", name _x];};
  71. case (4) : {_name = format["Police Lieutenant %1", name _x];};
  72. case (5) : {_name = format["Police Captain %1", name _x];};
  73. default {
  74. _gang = _x getVariable["gangName",""];
  75. _name = name _x;
  76. _width = 0;
  77. _height = 0;
  78. if (_gang != "") then {
  79. _pos2 = +_pos;
  80. _pos2 set[2,(getPosATL _x select 2) + 2];
  81. drawIcon3D ["",[1,1,1,0.7],_pos2,_width,_height,0,format["[%1]", _gang],0,0.03];
  82. };
  83. };
  84. };
  85. if (_x getVariable["coplevel", 0] > 0) then
  86. {
  87. _icon = [((_x getVariable["coplevel", 0]) - 1),"texture"] call BIS_fnc_rankParams;
  88. };
  89.  
  90. _swatlevel = _x getVariable["swatlevel",0];
  91.  
  92. if (_swatlevel > 0) then {
  93. _name = format["S.W.A.T. %1", name _x];
  94. _icon = [6,"texture"] call BIS_fnc_rankParams;
  95.  
  96. if (_swatlevel == 3 ) then {
  97. _name = format["S.W.A.T. Commander %1", name _x];
  98. };
  99. };
  100.  
  101. drawIcon3D [_icon,[1,1,1,1],_pos,_width,_height,0,_name,0,0.04];
  102. };
  103. };
  104. } foreach _near;
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement