Advertisement
Guest User

action_manager.sqf

a guest
May 20th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.69 KB | None | 0 0
  1. private _idact_build = -1;
  2. private _idact_arsenal = -1;
  3. private _idact_buildfob = -1;
  4. private _idact_redeploy = -1;
  5. private _idact_tutorial = -1;
  6. private _idact_squad = -1;
  7. private _idact_commander = -1;
  8. private _idact_production = -1;
  9. private _idact_logistic = -1;
  10. private _idact_repackage = -1;
  11. private _idact_halo = -1;
  12. private _idact_secondary = -1;
  13. private _idact_zeus = -1;
  14. private _idact_resources = -1;
  15. private _idact_sectorstorage = -1;
  16. private _idact_supplyfacility = -1;
  17. private _idact_ammofacility = -1;
  18. private _idact_fuelfacility = -1;
  19. private _distfob = (GRLIB_fob_range * 0.8);
  20. private _distarsenal = 5;
  21. private _distbuildfob = 10;
  22. private _distspawn = 10;
  23. private _distredeploy = 20;
  24.  
  25. GRLIB_removefobboxes = false;
  26. KP_liberation_resources_global = false;
  27. FOB_build_in_progress = false;
  28.  
  29. waitUntil {!isNil "build_confirmed"};
  30. waitUntil {!isNil "one_synchro_done"};
  31. waitUntil {!isNil "one_eco_done"};
  32. waitUntil {one_synchro_done};
  33. waitUntil {one_eco_done};
  34.  
  35. while {true} do {
  36.  
  37. private _nearfob = [] call F_getNearestFob;
  38. private _fobdistance = 9999;
  39. private _nearest_sector = [GRLIB_fob_range] call F_getNearestSector;
  40. private _prod_sector = [];
  41. {
  42. if ((_x select 1) == _nearest_sector) exitWith {_prod_sector = _x};
  43. } forEach KP_liberation_production;
  44.  
  45. if (count _nearfob == 3) then {
  46. _fobdistance = player distance _nearfob;
  47. };
  48.  
  49. if (KP_liberation_mobilearsenal) then {
  50. KP_liberation_neararsenal = ((getpos player) nearobjects [Arsenal_typename, _distarsenal]) select {getObjectType _x >= 8};
  51. } else {
  52. KP_liberation_neararsenal = [];
  53. };
  54.  
  55. _nearfobbox = ((getpos player) nearEntities [[FOB_box_typename, FOB_truck_typename], _distbuildfob]);
  56.  
  57. if (KP_liberation_mobilerespawn) then {
  58. KP_liberation_nearspawn = ((getpos player) nearEntities [[Respawn_truck_typename, huron_typename], _distspawn]);
  59. } else {
  60. KP_liberation_nearspawn = [];
  61. };
  62.  
  63. if (GRLIB_removefobboxes) then {
  64. GRLIB_removefobboxes = false;
  65. if (count _nearfobbox > 0) then {
  66. deletevehicle (_nearfobbox select 0);
  67. };
  68. };
  69.  
  70. if ( (player distance startbase) < 200 && alive player && vehicle player == player ) then {
  71. if (_idact_tutorial == -1) then {
  72. _idact_tutorial = player addAction ["<t color='#80FF80'>" + localize "STR_TUTO_ACTION" + "</t>","howtoplay = 1","",-740,false,true,"",""];
  73. };
  74. } else {
  75. if (_idact_tutorial != -1) then {
  76. player removeAction _idact_tutorial;
  77. _idact_tutorial = -1;
  78. };
  79. };
  80.  
  81. if ((_fobdistance < _distredeploy || (player distance startbase) < 200) && alive player && vehicle player == player && GRLIB_halo_param > 0) then {
  82. if (_idact_halo == -1) then {
  83. _idact_halo = player addAction ["<t color='#80FF80'>" + localize "STR_HALO_ACTION" + "</t> <img size='2' image='res\ui_redeploy.paa'/>","scripts\client\spawn\do_halo.sqf","",-749,false,true,"","build_confirmed == 0"];
  84. };
  85. } else {
  86. if (_idact_halo != -1) then {
  87. player removeAction _idact_halo;
  88. _idact_halo = -1;
  89. };
  90. };
  91.  
  92. if ((_fobdistance < _distredeploy || count KP_liberation_nearspawn != 0 || (player distance startbase) < 200) && alive player && vehicle player == player) then {
  93. if (_idact_redeploy == -1) then {
  94. _idact_redeploy = player addAction ["<t color='#80FF80'>" + localize "STR_DEPLOY_ACTION" + "</t> <img size='2' image='res\ui_redeploy.paa'/>","scripts\client\actions\redeploy.sqf","",-750,false,true,"","build_confirmed == 0"];
  95. };
  96. } else {
  97. if (_idact_redeploy != -1) then {
  98. player removeAction _idact_redeploy;
  99. _idact_redeploy = -1;
  100. };
  101. };
  102.  
  103. if ((leader group player == player) && (count units group player > 1) && alive player && vehicle player == player) then {
  104. if (_idact_squad == -1) then {
  105. _idact_squad = player addAction ["<t color='#80FF80'>" + localize "STR_SQUAD_MANAGEMENT_ACTION" + "</t> <img size='2' image='\a3\Ui_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa'/>","scripts\client\ui\squad_management.sqf","",-760,false,true,"","build_confirmed == 0"];
  106. };
  107. } else {
  108. if (_idact_squad != -1) then {
  109. player removeAction _idact_squad;
  110. _idact_squad = -1;
  111. };
  112. };
  113.  
  114. if ((_fobdistance < _distredeploy || count KP_liberation_neararsenal != 0 || count KP_liberation_nearspawn != 0 || (player distance startbase) < 200) && alive player && vehicle player == player) then {
  115. if (_idact_arsenal == -1) then {
  116. _idact_arsenal = player addAction ["<t color='#FFFF00'>" + localize "STR_ARSENAL_ACTION" + "</t> <img size='2' image='res\ui_arsenal.paa'/>","scripts\client\actions\open_arsenal.sqf","",-980,true,true,"","build_confirmed == 0"];
  117. };
  118. } else {
  119. if (_idact_arsenal != -1) then {
  120. player removeAction _idact_arsenal;
  121. _idact_arsenal = -1;
  122. };
  123. };
  124.  
  125. if (_fobdistance < _distfob && alive player && vehicle player == player && (([ player, 3] call F_fetchPermission) || (player == ([] call F_getCommander) || [] call F_isAdmin))) then {
  126. if (_idact_build == -1) then {
  127. _idact_build = player addAction ["<t color='#FFFF00'>" + localize "STR_BUILD_ACTION" + "</t> <img size='2' image='res\ui_build.paa'/>","scripts\client\build\open_build_menu.sqf","",-985,false,true,"","build_confirmed == 0"];
  128. };
  129. } else {
  130. if (_idact_build != -1) then {
  131. player removeAction _idact_build;
  132. _idact_build = -1;
  133. };
  134. };
  135.  
  136. if ((count _nearfobbox != 0) && (alive player) && (vehicle player == player) && !(surfaceIsWater getpos player) && ((player distance startbase) > 1000) && (([player, 3] call F_fetchPermission) || (player == ([] call F_getCommander) || [] call F_isAdmin)) && !FOB_build_in_progress) then {
  137. if (_idact_buildfob == -1) then {
  138. _idact_buildfob = player addAction ["<t color='#FFFF00'>" + localize "STR_FOB_ACTION" + "</t> <img size='2' image='res\ui_deployfob.paa'/>","scripts\client\build\do_build_fob.sqf","",-990,false,true,"","build_confirmed == 0"];
  139. };
  140. } else {
  141. if (_idact_buildfob != -1) then {
  142. player removeAction _idact_buildfob;
  143. _idact_buildfob = -1;
  144. };
  145. };
  146.  
  147. if (_fobdistance < _distredeploy && alive player && vehicle player == player && (player == ([] call F_getCommander) || [] call F_isAdmin)) then {
  148. if (_idact_repackage == -1) then {
  149. _idact_repackage = player addAction ["<t color='#FFFF00'>" + localize "STR_FOB_REPACKAGE" + "</t> <img size='2' image='res\ui_deployfob.paa'/>","scripts\client\actions\do_repackage_fob.sqf","",-991,false,true,"","build_confirmed == 0"];
  150. };
  151. } else {
  152. if (_idact_repackage != -1) then {
  153. player removeAction _idact_repackage;
  154. _idact_repackage = -1;
  155. };
  156. };
  157.  
  158. if ((count GRLIB_all_fobs > 0) && (GRLIB_endgame == 0) && (_fobdistance < _distredeploy || (player distance startbase) < 200) && alive player && vehicle player == player && (([player, 5] call F_fetchPermission) || (player == ([] call F_getCommander) || [] call F_isAdmin))) then {
  159. if (_idact_secondary == -1) then {
  160. _idact_secondary = player addAction ["<t color='#FFFF00'>" + localize "STR_SECONDARY_OBJECTIVES" + "</t>","scripts\client\ui\secondary_ui.sqf","",-992,false,true,"","build_confirmed == 0"];
  161. };
  162. } else {
  163. if (_idact_secondary != -1) then {
  164. player removeAction _idact_secondary;
  165. _idact_secondary = -1;
  166. };
  167. };
  168.  
  169. if ((count _prod_sector) == 12) then {
  170. if (alive player && vehicle player == player && ([player, 3] call F_fetchPermission) && ((count (_prod_sector select 3)) == 0)) then {
  171. if (_idact_sectorstorage == -1) then {
  172. _idact_sectorstorage = player addAction ["<t color='#FFFF00'>" + localize "STR_SECSTORAGEBUILD_ACTION" + "</t>","scripts\client\build\do_sector_build.sqf",[KP_liberation_small_storage_building, _prod_sector],-993,false,true,"","build_confirmed == 0"];
  173. };
  174. } else {
  175. if (_idact_sectorstorage != -1) then {
  176. player removeAction _idact_sectorstorage;
  177. _idact_sectorstorage = -1;
  178. };
  179. };
  180. if (alive player && vehicle player == player && ([player, 3] call F_fetchPermission) && ((count (_prod_sector select 3)) == 3) && !(_prod_sector select 4)) then {
  181. if (_idact_supplyfacility == -1) then {
  182. _idact_supplyfacility = player addAction ["<t color='#FFFF00'>" + localize "STR_SECSUPPLYBUILD_ACTION" + "</t>","scripts\client\build\do_sector_build.sqf",["supply", _prod_sector],-994,false,true,"","build_confirmed == 0"];
  183. };
  184. } else {
  185. if (_idact_supplyfacility != -1) then {
  186. player removeAction _idact_supplyfacility;
  187. _idact_supplyfacility = -1;
  188. };
  189. };
  190. if (alive player && vehicle player == player && ([player, 3] call F_fetchPermission) && ((count (_prod_sector select 3)) == 3) && !(_prod_sector select 5)) then {
  191. if (_idact_ammofacility == -1) then {
  192. _idact_ammofacility = player addAction ["<t color='#FFFF00'>" + localize "STR_SECAMMOBUILD_ACTION" + "</t>","scripts\client\build\do_sector_build.sqf",["ammo", _prod_sector],-995,false,true,"","build_confirmed == 0"];
  193. };
  194. } else {
  195. if (_idact_ammofacility != -1) then {
  196. player removeAction _idact_ammofacility;
  197. _idact_ammofacility = -1;
  198. };
  199. };
  200. if (alive player && vehicle player == player && ([player, 3] call F_fetchPermission) && ((count (_prod_sector select 3)) == 3) && !(_prod_sector select 6)) then {
  201. if (_idact_fuelfacility == -1) then {
  202. _idact_fuelfacility = player addAction ["<t color='#FFFF00'>" + localize "STR_SECFUELBUILD_ACTION" + "</t>","scripts\client\build\do_sector_build.sqf",["fuel", _prod_sector],-996,false,true,"","build_confirmed == 0"];
  203. };
  204. } else {
  205. if (_idact_fuelfacility != -1) then {
  206. player removeAction _idact_fuelfacility;
  207. _idact_fuelfacility = -1;
  208. };
  209. };
  210. } else {
  211. if (_idact_sectorstorage != -1) then {
  212. player removeAction _idact_sectorstorage;
  213. _idact_sectorstorage = -1;
  214. };
  215. if (_idact_supplyfacility != -1) then {
  216. player removeAction _idact_supplyfacility;
  217. _idact_supplyfacility = -1;
  218. };
  219. if (_idact_ammofacility != -1) then {
  220. player removeAction _idact_ammofacility;
  221. _idact_ammofacility = -1;
  222. };
  223. if (_idact_fuelfacility != -1) then {
  224. player removeAction _idact_fuelfacility;
  225. _idact_fuelfacility = -1;
  226. };
  227. };
  228.  
  229. if (_fobdistance < _distfob && alive player && vehicle player == player) then {
  230. if (_idact_resources == -1) then {
  231. _idact_resources = player addAction ["<t color='#FFFF00'>" + localize "STR_RESOURCE_GLOBAL_ACTION" + "</t>",{KP_liberation_resources_global = !KP_liberation_resources_global},"",-997,false,true,"","build_confirmed == 0"];
  232. };
  233. } else {
  234. if (_idact_resources != -1) then {
  235. player removeAction _idact_resources;
  236. _idact_resources = -1;
  237. };
  238. };
  239.  
  240. if (((_fobdistance < _distfob) || ((count _prod_sector) == 12)) && ((getPlayerUID player) in KP_liberation_logistic_whitelist) && alive player && vehicle player == player && ((count KP_liberation_production) > 0)) then {
  241. if (_idact_production == -1) then {
  242. _idact_production = player addAction ["<t color='#FF8000'>" + localize "STR_PRODUCTION_ACTION" + "</t>","scripts\client\commander\open_production.sqf","",-998,false,true,"","build_confirmed == 0"];
  243. };
  244. } else {
  245. if (_idact_production != -1) then {
  246. player removeAction _idact_production;
  247. _idact_production = -1;
  248. };
  249. };
  250.  
  251. if (KP_liberation_ailogistics) then {
  252. if ((_fobdistance < _distfob) && ((getPlayerUID player) in KP_liberation_logistic_whitelist) && alive player && vehicle player == player && (((count GRLIB_all_fobs) + (count KP_liberation_production)) > 1)) then {
  253. if (_idact_logistic == -1) then {
  254. _idact_logistic = player addAction ["<t color='#FF8000'>" + localize "STR_LOGISTIC_ACTION" + "</t>","scripts\client\commander\open_logistic.sqf","",-999,false,true,"","build_confirmed == 0"];
  255. };
  256. } else {
  257. if (_idact_logistic != -1) then {
  258. player removeAction _idact_logistic;
  259. _idact_logistic = -1;
  260. };
  261. };
  262. };
  263.  
  264. if ((player == ([] call F_getCommander) || [] call F_isAdmin) && alive player && vehicle player == player && GRLIB_permissions_param) then {
  265. if (_idact_commander == -1) then {
  266. _idact_commander = player addAction ["<t color='#FF8000'>" + localize "STR_COMMANDER_ACTION" + "</t> <img size='2' image='\a3\Ui_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa'/>","scripts\client\commander\open_permissions.sqf","",-1001,false,true,"","build_confirmed == 0"];
  267. };
  268. } else {
  269. if (_idact_commander != -1) then {
  270. player removeAction _idact_commander;
  271. _idact_commander = -1;
  272. };
  273. };
  274.  
  275. if (!isNil("commandant")) then {
  276. if ((player == commandant) && (isNull(getAssignedCuratorLogic commandant))) then {
  277. if ( _idact_zeus == -1 ) then {
  278. _idact_zeus = player addAction ["<t color='#FF0000'>" + localize "STR_REASSIGN_ZEUS" + "</t>",{[] remoteExec ["zeus_remote_call",2];},"",-1002,false,true,"","build_confirmed == 0"];
  279. };
  280. } else {
  281. player removeAction _idact_zeus;
  282. _idact_zeus = -1;
  283. };
  284. };
  285.  
  286. uiSleep 1;
  287. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement