aeroson

Untitled

Aug 29th, 2013
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.02 KB | None | 0 0
  1. {
  2. _fnc_scriptNameParentTemp =
  3. if !(isnil '_fnc_scriptName') then {
  4. _fnc_scriptName
  5. } else {
  6. 'BIS_fnc_moduleRespawnPosition'
  7. };
  8. private['_fnc_scriptNameParent'];
  9. _fnc_scriptNameParent = _fnc_scriptNameParentTemp;
  10. _fnc_scriptNameParentTemp = nil;
  11.  
  12. private['_fnc_scriptName'];
  13. _fnc_scriptName = 'BIS_fnc_moduleRespawnPosition';
  14. scriptname _fnc_scriptName;#
  15. line 1 "A3\modules_f\Multiplayer\functions\fn_moduleRespawnPosition.sqf"
  16. _logic = [_this, 0, objnull, [objnull]] call bis_fnc_param;
  17. _activated = [_this, 2, true, [true]] call bis_fnc_param;
  18.  
  19. if (_activated) then {
  20.  
  21.  
  22. _name = _logic getvariable["Name", ""];
  23. _typeID = (_logic getvariable["Type", "0"]) call bis_fnc_parsenumber;
  24. _sideID = (_logic getvariable["Side", "-1"]) call bis_fnc_parsenumber;
  25.  
  26.  
  27. if (_sideID < 0) then {
  28. if (ismultiplayer) then {
  29. _maxScore = -1; {
  30. _score = scoreside _x;
  31. if (_score > _maxScore) then {
  32. _maxScore = _score;
  33. _sideID = _x call bis_fnc_sideID;
  34. } else {
  35. if (_score == _maxScore) then {
  36. _sideID = -1;
  37. };
  38. };
  39. }
  40. foreach[opfor, blufor, independent, civilian];
  41. } else {
  42. _sideID = playerside call bis_fnc_sideID;
  43. };
  44. };
  45.  
  46. if (_sideID >= 0) then {
  47. _side = _sideID call bis_fnc_sideType;
  48. _pos = position _logic;
  49. _markerPrefix = "respawn_";
  50. _markerType = ["respawn_inf", "respawn_unknown", "respawn_motor", "respawn_armor", "respawn_air", "respawn_plane", "respawn_naval"] select _typeID;
  51. _respawnPositions = [];
  52.  
  53. if (_typeID > 0) then {
  54. _markerPrefix = "respawn_vehicle_";
  55. } else {
  56. {
  57. if (_x iskindof "AllVehicles") then {
  58. _respawn = [_side, _x] call bis_fnc_addRespawnPosition;
  59. _respawnPositions set[count _respawnPositions, _respawn];
  60. };
  61. }
  62. foreach(synchronizedobjects _logic);
  63. };
  64.  
  65. if (count _respawnPositions == 0) then {
  66.  
  67.  
  68. _markerSide = ["east", "west", "guerrila", "civilian"] select _sideID;
  69. _markerPrefix = _markerPrefix + _markerSide;
  70.  
  71. _respawn = createmarker[_markerPrefix + str _logic, _pos];
  72. _respawn setmarkerdir((round direction _logic) * 360);
  73. _respawn setmarkersize[1, 1];
  74. _respawn setmarkercolor([_side, true] call bis_fnc_sidecolor);
  75. _respawn setmarkertype _markerType;
  76. _respawn setmarkertext _name;
  77. _respawnPositions set[count _respawnPositions, _respawn];
  78. };
  79. _logic setvariable["respawn", _respawnPositions];
  80.  
  81. _type = gettext(configfile >> "cfgmarkers" >> _markerType >> "name");
  82. if (_name == "") then {
  83. _name = format[localize "str_a3_bis_fnc_respawnmenuposition_grid", mapgridposition _pos];
  84. };
  85. [
  86. ["RespawnAdded", [_type, _name, _markerType call bis_fnc_textureMarker]], "BIS_fnc_showNotification", _side
  87. ] call bis_fnc_mp;
  88. } else {
  89. ["Respawn %1 not added, all sides have the same score.", _logic] call bis_fnc_logFormat;
  90. };
  91. } else {
  92.  
  93.  
  94. _respawn = _logic getvariable["respawn", []];
  95. [_respawn, 0, [],
  96. [
  97. [], ""
  98. ]
  99. ] call bis_fnc_paramin;
  100. if (typename _respawn == typename[]) then {
  101. if (count _respawn == 2) then {
  102. _respawn call bis_fnc_removeRespawnPosition;
  103. };
  104. } else {
  105. deletemarker _respawn;
  106. };
  107. };
  108. }
Advertisement
Add Comment
Please, Sign In to add comment