Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 2.25 KB  |  hits: 27  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // Crew Markers (based on F2 - ShackTactical Fireteam Member Markers)
  2. // Credits: Please see the F2 online manual (http://www.ferstaberinde.com/f2/en/)
  3. // ====================================================================================
  4.  
  5. // JIP CHECK
  6. // Prevents the script executing until the player has synchronised correctly:
  7.  
  8. #include "f_waitForJIP.sqf"
  9.  
  10. // ====================================================================================
  11.  
  12. // DECLARE PRIVATE VARIABLES
  13.  
  14. private ["_unit","_mkrType","_mkrColor","_mkrName","_mkr"];
  15.  
  16. // ====================================================================================
  17.  
  18. // SET KEY VARIABLES
  19. // Using variables passed to the script instance, we will create some local variables:
  20.  
  21. _unit = _this select 0;
  22. _mkrType = _this select 1;
  23. _mkrColor = _this select 2;
  24. _mkrName = Format ["mkrCrew_%1",_unit];
  25.  
  26. // ====================================================================================
  27.  
  28. // CREATE MARKER
  29. // Depending on the value of _mkrType a different type of marker is created.
  30.  
  31.                 switch (_mkrType) do
  32.                 {
  33. // Normal
  34.                         case 0:
  35.                         {
  36.                                 _mkr = createMarkerLocal [_mkrName,[(getPos _unit select 0),(getPos _unit select 1)]];
  37.                                 _mkr setMarkerShapeLocal "ICON";
  38.                                 _mkrName setMarkerTypeLocal "MIL_TRIANGLE";
  39.                                 _mkrName setMarkerColorLocal _mkrColor;
  40.                                 _mkrName setMarkerSizeLocal [2, 2];
  41.                                 // _mkrName setMarkerTextLocal (name _unit);
  42.                                 _mkrName setMarkerDirLocal (direction _unit);
  43.                         };
  44.                 };
  45.  
  46. // ====================================================================================
  47.  
  48. // UPDATE MARKER POSITION
  49. // As long as certain conditions are met (the group leader is alive and holding the
  50. // radio, or radio object placeholder) the marker position is updated periodically.
  51. // This only happens locally - so as not to burden the server.
  52.  
  53.                 for [{_i=0}, {_i<=10000}, {_i=_i+1}] do
  54.                 {
  55.                         if (alive _unit) then
  56.                         {
  57.                                 _mkrName setMarkerPosLocal [(getPos _unit select 0),(getPos _unit select 1)];
  58.                                 _mkrName setMarkerDirLocal (direction _unit);
  59.                         }
  60.                         else
  61.                         {
  62.                                 _mkrName setMarkerPosLocal [0,0];
  63.                         };
  64.                         sleep custom_param_vHF;
  65.                 };
  66.  
  67. // ====================================================================================
  68.  
  69. if (true) exitWith {};