Advertisement
Guest User

Untitled

a guest
Dec 18th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.83 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3. File: fn_playerTags.sqf
  4. Author: Bryan "Tonic" Boardwine
  5.  
  6. Description:
  7. Adds the tags above other players heads when close and have visible range.
  8. */
  9. #define iconID 78000
  10. #define scale 0.8
  11.  
  12. if(visibleMap OR {!alive player} OR {dialog}) exitWith {
  13. 500 cutText["","PLAIN"];
  14. };
  15.  
  16. private _ui = GVAR_UINS ["Life_HUD_nameTags",displayNull];
  17. if(isNull _ui) then {
  18. 500 cutRsc["Life_HUD_nameTags","PLAIN"];
  19. _ui = GVAR_UINS ["Life_HUD_nameTags",displayNull];
  20. };
  21.  
  22. private _units = player nearEntities ["Man", 50];
  23. SUB(_units,[player]);
  24.  
  25. {
  26. private _text = "";
  27. _idc = _ui displayCtrl (iconID + _forEachIndex);
  28. if(!(lineIntersects [eyePos player, eyePos _x, player, _x]) && {!isNil {_x GVAR "realname"}} && alive _x) then {
  29. _pos = [visiblePosition _x select 0, visiblePosition _x select 1, ((_x modelToWorld (_x selectionPosition "head")) select 2)+.5];
  30. _sPos = worldToScreen _pos;
  31. _distance = _pos distance player;
  32. if(count _sPos > 1 && {_distance < 15}) then {
  33. _text = switch (true) do {
  34. case (_x in (units grpPlayer) && playerSide isEqualTo civilian): {format["<t color='#00FF00'>%1</t>",format ["ID %1: %2",_x GVAR ["playerID","0"],_x GVAR ["realname",name _x]]];};
  35. case (_x in life_memoryList && side _x isEqualTo civilian): {format ["ID %1: %2",_x GVAR ["playerID","0"],_x GVAR ["realname",name _x]];};
  36. case (!isNil {(_x GVAR "rank")} && playerSide isEqualTo west): {
  37. format[
  38. "<img image='%1' size='1'></img> %2<br/><t size='0.8' color='#0266C8'>%3</t>",
  39.  
  40. switch ((_x GVAR "rank")) do {
  41. case 2: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\Gardien.paa"};
  42. case 3: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\SousBrigadier.paa"};
  43. case 4: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\Brigadier.paa"};
  44. case 5: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\BrigadierChef.paa"};
  45. case 6: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\BrigadierMajor.paa"};
  46. case 7: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\EleveLieutenant.paa"};
  47. case 8: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\Lieutenant.paa"};
  48. case 9: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\Capitaine.paa"};
  49. case 10: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\Commandant.paa"};
  50. case 11: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\Commissairedepolice.paa"};
  51. default {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\Gardien Stagiaire.paa"};
  52. },
  53.  
  54. format ["ID %1: %2",_x GVAR ["playerID","0"],_x GVAR ["realname",name _x]],
  55.  
  56. switch ((_x GVAR "rank")) do {
  57. case 2: {"Gardien"};
  58. case 3: {"Sous Brigadier"};
  59. case 4: {"Brigadier"};
  60. case 5: {"Brigadier Chef"};
  61. case 6: {"Brigadier Major"};
  62. case 7: {"Eleve Lieutenant"};
  63. case 8: {"Lieutenant"};
  64. case 9: {"Capitaine"};
  65. case 10: {"Commandant"};
  66. case 11: {"Commissaire de police"};
  67. default {"Gardien Stagiaire"};
  68. }
  69. ]
  70. };
  71.  
  72. case (!isNil {(_x GVAR "medicRank")} && playerSide isEqualTo independent): {
  73. _t = "Recrue";
  74. if (_x GVAR ["medicType",name _x] isEqualTo "MED") then {
  75. _t = switch ((_x GVAR "medicRank")) do {
  76. case 2: {"Infirmier Apprenant"};
  77. case 3: {"Infirmier Aspirant"};
  78. case 4: {"Infirmier"};
  79. case 5: {"Infirmier-Chef"};
  80. case 6: {"Médecin 2nde Classe"};
  81. case 7: {"Médecin 1re Classe"};
  82. case 8: {"Médecin"};
  83. case 9: {"Médecin-Chef"};
  84. case 10: {"Médecin Capitaine"};
  85. case 11: {"Médecin Commandant"};
  86. case 12: {"Médecin Ltn-Colonel"};
  87. case 13: {"Médecin Colonel"};
  88. default {"Recrue"};
  89. };
  90. } else {
  91. _t = switch ((_x GVAR "medicRank")) do {
  92. case 2: {"Sapeur 2nde Classe"};
  93. case 3: {"Sapeur 1re Classe"};
  94. case 4: {"Caporal"};
  95. case 5: {"Brigadier"};
  96. case 6: {"Brigadier-Chef"};
  97. case 7: {"Adjudant"};
  98. case 8: {"Adjudant-Chef"};
  99. case 9: {"Lieutenant"};
  100. case 10: {"Capitaine"};
  101. case 11: {"Commandant"};
  102. case 12: {"Ltn-Colonel"};
  103. case 13: {"Colonel"};
  104. default {"Recrue"};
  105. };
  106. };
  107.  
  108. format[
  109. "<t color='#02A001'><img image='\a3\ui_f\data\map\MapControl\hospital_ca.paa' size='1'></img></t> %1<br/><t size='0.8' color='#02A001'>%2</t>",
  110. format ["ID %1: %2",_x GVAR ["playerID","0"],_x GVAR ["realname",name _x]], _t
  111. ]
  112. };
  113.  
  114.  
  115.  
  116.  
  117. case (FETCH_CONST(life_adminlevel) >= 1): {
  118. format ["ID %1: %2",_x GVAR ["playerID","ERROR"],_x GVAR ["realname",name _x]]
  119. };
  120.  
  121. default {
  122. format ["ID %1",_x GVAR ["playerID","ERROR"]]
  123. };
  124. };
  125.  
  126. _idc ctrlSetStructuredText parseText _text;
  127. _idc ctrlSetPosition [_sPos select 0, _sPos select 1, 0.4, 0.65];
  128. _idc ctrlSetScale scale;
  129. _idc ctrlSetFade 0;
  130. _idc ctrlCommit 0;
  131. _idc ctrlShow true;
  132. } else {
  133. _idc ctrlShow false;
  134. };
  135. } else {
  136. _idc ctrlShow false;
  137. };
  138. } foreach _units;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement