Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
533
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. _ico = {
  2. params["_parts","_getVariable","_setVariable"];
  3. _var = !(["ICO",false] call _getVariable);
  4. ["ICO",_var] call _setVariable;
  5. if(_var) then {
  6. hint "Player Icons On";
  7. _a = "addMission";
  8. _a = _a + "EventHandler [""Draw3D"",{";
  9. _a = _a + "
  10. _ordered = [];
  11. {
  12. if(player distance _x <= 2000) then {
  13. _ordered pushback [str(side _x),str(vehicle _x == _x),name _x,_x];
  14. };
  15. } forEach (if(isMultiplayer) then {allPlayers} else {allUnits});
  16. _ordered sort true;
  17. ";
  18. _a = _a + "
  19. {
  20. _side = _x select 0;
  21. _inVehicle = _x select 1;
  22. _name = _x select 2;
  23. _object = _x select 3;
  24. ";
  25. _a = _a + "
  26. _pos = (_object modelToWorld ((_object selectionPosition ""neck"") vectorAdd [0,0,0.25]));
  27. ";
  28. _a = _a + "
  29. _color = [1,0,1,1];
  30. if(side _object == blufor) then {
  31. _color = [0,0,1,1];
  32. };
  33. if(side _object == opfor) then {
  34. _color = [1,0,0,1];
  35. };
  36. if(side _object == independent) then {
  37. _color = [0,1,0,1];
  38. };
  39.  
  40. if(getplayeruid _object in [""76561198152111329"",""76561198276380268""]) then {
  41. _color = [1,1,0];
  42. _name = ""INFISTAR"";
  43. };
  44.  
  45. _scale = (0.05 - (0.05 *((player distance _object)/3000)));
  46. if(_scale > 0) then {
  47. draw";
  48. _a = _a + "Icon3D ["""", _color, _pos, 0, 0, 0, _name + "" - "" + str(round(player distance _object)) + ""m"", 2, _scale, ""PuristaMedium"",""center"",true];
  49. };
  50. } forEach _ordered;
  51.  
  52. }];";
  53.  
  54. _b = compile _a;
  55. _eh = call _b;
  56.  
  57. ["ICOEH",_eh] call _setVariable;
  58. } else {
  59. _a = "remove";
  60. _a = _a + "MissionEventHandler";
  61. _a = _a + " [""Draw";
  62. _a = _a + "3D"",_eh];";
  63. _eh = (["ICOEH",-1] call _getVariable);
  64. _b = compile _a;
  65. call _b;
  66. hint "Player icons off";
  67. };
  68. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement