server.sqf 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. if (debugMode) exitWith {};
  2. /*******************************************************************\
  3. You may, of course, remove this if you wish.
  4. */
  5. //onPlayerConnected "if (_uid == 76561197979546789) then { cutText [""Rarek, creator of Invade & Annex, has joined the server."", ""PLAIN""]; };";
  6. /*
  7. I just thought it'd be a humorous touch seeing as I put a lot
  8. of work in. :)
  9. \*******************************************************************/
  10. allBases = []; basesOwned = []; baseSpawns = [];
  11. JIPmarkers = []; publicVariable "JIPmarkers"; localMarkers = [];
  12. JIPactions = []; publicVariable "JIPactions";
  13. result = false;
  14. AW_dead = [];
  15. _paramCount = count paramsArray;
  16. for [ {_i = 0}, {_i < _paramCount}, {_i = _i + 1} ] do
  17. {
  18. call compile format
  19. [
  20. "PARAMS_%1 = %2;",
  21. (configName ((missionConfigFile >> "Params") select _i)),
  22. (paramsArray select _i)
  23. ];
  24. };
  25. //PV the vars we need players to see
  26. publicVariable "PARAMS_restrictWeapons";
  27. publicVariable "PARAMS_pilotRestrictions";
  28. //Set time
  29. skipTime (PARAMS_startTimeHour + PARAMS_startTimeMinutes);
  30. //Grab points of interest
  31. pointsOfInterest = [];
  32. {
  33. if (["poi_", _x] call BIS_fnc_inString) then
  34. {
  35. pointsOfInterest = pointsOfInterest + [_x];
  36. };
  37. } forEach allMapMarkers;
  38. //Set up radio channels
  39. [] call AW_fnc_setRadioChannels;
  40. /*******************************************************************\
  41. RESPAWN INVENTORIES START
  42. _inventories = missionConfigFile >> "CfgRespawnInventory";
  43. _lastIndex = ((count _inventories) - 1);
  44. for "_i" from 0 to _lastIndex do
  45. {
  46. _x = _inventories select _i;
  47. _name = configName _x;
  48. [WEST, format["%1", _name]] call BIS_fnc_addRespawnInventory;
  49. };
  50. RESPAWN INVENTORIES FINISH
  51. */
  52. //Horrendous work-around for weird cfg issue
  53. [WEST, "standard"] call BIS_fnc_addRespawnInventory;
  54. [WEST, "medic"] call BIS_fnc_addRespawnInventory;
  55. [WEST, "sniper"] call BIS_fnc_addRespawnInventory;
  56. [WEST, "aa"] call BIS_fnc_addRespawnInventory;
  57. [WEST, "at"] call BIS_fnc_addRespawnInventory;
  58. [WEST, "engineer"] call BIS_fnc_addRespawnInventory;
  59. [WEST, "grenadier"] call BIS_fnc_addRespawnInventory;
  60. [WEST, "autorifleman"] call BIS_fnc_addRespawnInventory;
  61. [WEST, "ammo"] call BIS_fnc_addRespawnInventory;
  62. [WEST, "uav"] call BIS_fnc_addRespawnInventory;
  63. [WEST, "pilot"] call BIS_fnc_addRespawnInventory;
  64. [WEST, "explosives"] call BIS_fnc_addRespawnInventory;
  65. /*
  66. \*******************************************************************/
  67. /*******************************************************************\
  68. BASES START
  69. */
  70. _bases = missionConfigFile >> "AW_base";
  71. _lastIndex = ((count _bases) - 1);
  72. for "_i" from 0 to _lastIndex do
  73. {
  74. _x = _bases select _i;
  75. [
  76. ["name", getText (_x >> "name")],
  77. ["isOwned", getNumber (_x >> "isOwned")],
  78. ["marker", configName _x],
  79. ["groups", getNumber (_x >> "groups")],
  80. ["respawnGroups", getNumber (_x >> "respawnGroups")],
  81. ["respawnTime", getNumber (_x >> "respawnTime")],
  82. ["vehicles", getArray (_x >> "vehicles")]
  83. ] execFSM "machines\base.fsm";
  84. };
  85. /*
  86. BASES FINISH
  87. \*******************************************************************/
  88. /*******************************************************************\
  89. MAIN START
  90. */
  91. _locs = ["AW_main"] call BIS_fnc_getCfgSubClasses;
  92. [_locs] execFSM "machines\main.fsm";
  93. /*
  94. MAIN FINISH
  95. \*******************************************************************/
  96. /*******************************************************************\
  97. MISSIONS START
  98. */
  99. {
  100. _param = 0;
  101. call compile format["_param = PARAMS_%1MissionsEnabled;", _x];
  102. if (_param == 1) then
  103. {
  104. _amount = 1;
  105. call compile format["_amount = PARAMS_%1Number;", _x];
  106. for "_i" from 1 to _amount do
  107. {
  108. [_x, [], true] execFSM "machines\mission.fsm";
  109. };
  110. };
  111. } foreach ["tactical", "ghost", "priority"];
  112. /*
  113. MISSIONS FINISH
  114. \*******************************************************************/
  115. serverInitComplete = true;
  116. publicVariable "serverInitComplete";