Guest User

server_cleanup.fsm fix

a guest
Jun 7th, 2013
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.89 KB | None | 0 0
  1. /*%FSM<COMPILE "C:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Server Cleanup">*/
  2. /*%FSM<HEAD>*/
  3. /*
  4. item0[] = {"init",0,250,-75.000000,-400.000000,25.000000,-350.000000,0.000000,"init"};
  5. item1[] = {"true",8,218,-75.000000,-175.000000,25.000000,-125.000000,0.000000,"true"};
  6. item2[] = {"waiting",2,250,-75.000000,-100.000000,25.000000,-50.000000,0.000000,"waiting"};
  7. item3[] = {"too_many_dead",4,218,-200.000000,-25.000000,-100.000000,25.000000,2.000000,"too many" \n "dead"};
  8. item4[] = {"cleanup_dead",2,4346,-200.000000,50.000000,-100.000000,100.000000,0.000000,"cleanup" \n "dead"};
  9. item5[] = {"too_many_objects",4,218,-100.000000,-25.000000,0.000000,25.000000,3.000000,"too many" \n "objects"};
  10. item6[] = {"cleanup_objects",2,250,-100.000000,50.000000,0.000000,100.000000,0.000000,"cleanup" \n "objects"};
  11. item7[] = {"time_sync",4,218,-300.000000,-25.000000,-200.000000,25.000000,3.000000,"time" \n "sync"};
  12. item8[] = {"sync_the_time",2,250,-300.000000,50.000000,-200.000000,100.000000,0.000000,"sync" \n "the time"};
  13. item9[] = {"true",8,218,-75.000000,125.000000,25.000000,175.000000,0.000000,"true"};
  14. item10[] = {"general_cleanup",2,250,-75.000000,200.000000,25.000000,250.000000,0.000000,"general" \n "cleanup"};
  15. item11[] = {"",7,210,-304.000000,220.999985,-296.000000,229.000015,0.000000,""};
  16. item12[] = {"",7,210,-304.000000,-154.000000,-296.000000,-146.000000,0.000000,""};
  17. item13[] = {"",7,210,221.000000,-79.000000,229.000000,-71.000000,0.000000,""};
  18. item14[] = {"",7,210,221.000000,146.000000,229.000000,154.000000,0.000000,""};
  19. item15[] = {"initialized",4,218,-75.000000,-325.000000,25.000000,-275.000000,0.000000,"initialized"};
  20. item16[] = {"prepare",2,250,-75.000000,-250.000000,25.000000,-200.000000,0.000000,"prepare"};
  21. item17[] = {"update_objects",2,250,100.000000,50.000000,200.000000,100.000000,0.000000,"update objects"};
  22. item18[] = {"need_update",4,218,100.000000,-25.000000,200.000000,25.000000,1.000000,"need update"};
  23. item19[] = {"",7,210,221.000000,-79.000000,229.000000,-71.000000,0.000000,""};
  24. item20[] = {"Make_MO_list",2,250,200.000000,50.000000,300.000000,100.000000,0.000000,"Make MO list"};
  25. item21[] = {"MO_list",4,218,200.000000,-25.000000,300.000000,25.000000,1.000000,"MO list"};
  26. item22[] = {"check_for_hacker",2,250,0.000000,50.000000,100.000000,100.000000,0.000000,"check for hacker"};
  27. item23[] = {"anti_hack",4,218,0.000000,-25.000000,100.000000,25.000000,1.000000,"anti hack"};
  28. link0[] = {0,15};
  29. link1[] = {1,2};
  30. link2[] = {2,3};
  31. link3[] = {2,5};
  32. link4[] = {2,7};
  33. link5[] = {2,13};
  34. link6[] = {2,18};
  35. link7[] = {2,21};
  36. link8[] = {2,23};
  37. link9[] = {3,4};
  38. link10[] = {4,9};
  39. link11[] = {5,6};
  40. link12[] = {6,9};
  41. link13[] = {7,8};
  42. link14[] = {8,9};
  43. link15[] = {9,10};
  44. link16[] = {10,11};
  45. link17[] = {11,12};
  46. link18[] = {12,1};
  47. link19[] = {13,14};
  48. link20[] = {13,19};
  49. link21[] = {14,9};
  50. link22[] = {15,16};
  51. link23[] = {16,1};
  52. link24[] = {17,9};
  53. link25[] = {18,17};
  54. link26[] = {20,9};
  55. link27[] = {21,20};
  56. link28[] = {22,9};
  57. link29[] = {23,22};
  58. globals[] = {25.000000,1,0,0,0,640,480,1,33,6316128,1,-375.031067,353.029694,516.327637,-254.323822,906,959,1};
  59. window[] = {0,-1,-1,-1,-1,1104,111,1877,0,1,924};
  60. *//*%FSM</HEAD>*/
  61. class FSM
  62. {
  63. fsmName = "DayZ Server Cleanup";
  64. class States
  65. {
  66. /*%FSM<STATE "init">*/
  67. class init
  68. {
  69. name = "init";
  70. init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
  71. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  72. class Links
  73. {
  74. /*%FSM<LINK "initialized">*/
  75. class initialized
  76. {
  77. priority = 0.000000;
  78. to="prepare";
  79. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  80. condition=/*%FSM<CONDITION""">*/"!isnil ""bis_fnc_init"""/*%FSM</CONDITION""">*/;
  81. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  82. };
  83. /*%FSM</LINK>*/
  84. };
  85. };
  86. /*%FSM</STATE>*/
  87. /*%FSM<STATE "waiting">*/
  88. class waiting
  89. {
  90. name = "waiting";
  91. init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
  92. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  93. class Links
  94. {
  95. /*%FSM<LINK "too_many_objects">*/
  96. class too_many_objects
  97. {
  98. priority = 3.000000;
  99. to="cleanup_objects";
  100. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  101. condition=/*%FSM<CONDITION""">*/"((time - _lastItemCheck) > 65)"/*%FSM</CONDITION""">*/;
  102. action=/*%FSM<ACTION""">*/"_lastItemCheck = time;"/*%FSM</ACTION""">*/;
  103. };
  104. /*%FSM</LINK>*/
  105. /*%FSM<LINK "time_sync">*/
  106. class time_sync
  107. {
  108. priority = 3.000000;
  109. to="sync_the_time";
  110. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  111. condition=/*%FSM<CONDITION""">*/"((time - _lastTimeSync) > 60)"/*%FSM</CONDITION""">*/;
  112. action=/*%FSM<ACTION""">*/"_lastTimeSync = time;"/*%FSM</ACTION""">*/;
  113. };
  114. /*%FSM</LINK>*/
  115. /*%FSM<LINK "too_many_dead">*/
  116. class too_many_dead
  117. {
  118. priority = 2.000000;
  119. to="cleanup_dead";
  120. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  121. condition=/*%FSM<CONDITION""">*/"((time - _lastDeadCheck) > 120)"/*%FSM</CONDITION""">*/;
  122. action=/*%FSM<ACTION""">*/"_lastDeadCheck = time;"/*%FSM</ACTION""">*/;
  123. };
  124. /*%FSM</LINK>*/
  125. /*%FSM<LINK "MO_list">*/
  126. class MO_list
  127. {
  128. priority = 1.000000;
  129. to="Make_MO_list";
  130. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  131. condition=/*%FSM<CONDITION""">*/"((time - _timeMOlist) > 2700)"/*%FSM</CONDITION""">*/;
  132. action=/*%FSM<ACTION""">*/"_timeMOlist = time;"/*%FSM</ACTION""">*/;
  133. };
  134. /*%FSM</LINK>*/
  135. /*%FSM<LINK "anti_hack">*/
  136. class anti_hack
  137. {
  138. priority = 1.000000;
  139. to="check_for_hacker";
  140. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  141. condition=/*%FSM<CONDITION""">*/"(time-_timeHackCheck) > 1"/*%FSM</CONDITION""">*/;
  142. action=/*%FSM<ACTION""">*/"_timeHackCheck = time;"/*%FSM</ACTION""">*/;
  143. };
  144. /*%FSM</LINK>*/
  145. /*%FSM<LINK "need_update">*/
  146. class need_update
  147. {
  148. priority = 1.000000;
  149. to="update_objects";
  150. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  151. condition=/*%FSM<CONDITION""">*/"( (time-_lastObjectUpdateCheck) > 10)"/*%FSM</CONDITION""">*/;
  152. action=/*%FSM<ACTION""">*/"_lastObjectUpdateCheck = time;"/*%FSM</ACTION""">*/;
  153. };
  154. /*%FSM</LINK>*/
  155. /*%FSM<LINK "true">*/
  156. class true
  157. {
  158. priority = 0.000000;
  159. to="general_cleanup";
  160. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  161. condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
  162. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  163. };
  164. /*%FSM</LINK>*/
  165. };
  166. };
  167. /*%FSM</STATE>*/
  168. /*%FSM<STATE "cleanup_dead">*/
  169. class cleanup_dead
  170. {
  171. name = "cleanup_dead";
  172. init = /*%FSM<STATEINIT""">*/"diag_log (""CLEANUP: PERFORMING BODY CLEANUP ON BODIES, Time="" + str(time));" \n
  173. "private[""_delQtyZ"",""_countTotalDelDead"",""_numZombie"",""_myGroupX"",""_modeldex"",""_nameKillerP"",""_typedeP"",""_weapons"",""_magazines"",""_backpack"",""_nameBody"",""_position"",""_position2"",""_position3"",""_backpackWeapons"",""_backpackMagazines"",""_backpackType"",""_isZombie"",""_itemsCount"",""_holder"",""_cruse"",""_cruse2"",""_cruse3"",""_isOkeW"",""_isOke"",""_i"",""_backpackHolder"",""_flys""];" \n
  174. "" \n
  175. "_delQtyZ = 0;" \n
  176. "" \n
  177. "_countTotalDelDead = 0;" \n
  178. "_numZombie = {_x isKindOf ""zZombie_Base""} count allDead;" \n
  179. "{" \n
  180. " _modeldex = typeOf _x;" \n
  181. "" \n
  182. "_nearby2 = (getposATL _x) nearEntities [[""ori_vil_woman_survivor_1"",""ori_vil_woman_survivor_2"",""ori_vil_woman_survivor_3"",""ori_vil_woman_survivor_4"",""ori_vil_woman_survivor_5"",""ori_vil_woman_survivor_6"",""ori_vil_woman_bandit_1"",""ori_vil_woman_bandit_2"",""ori_vil_woman_bandit_3"",""ori_vil_woman_bandit_4"",""ori_vil_woman_bandit_5"",""ori_vil_woman_bandit_6"",""ori_vil_woman_hero_1"",""ori_vil_woman_hero_2"",""ori_vil_woman_hero_3"",""ori_vil_woman_hero_4"",""ori_vil_woman_hero_5"",""ori_vil_woman_hero_6"",""SurvivorW2_DZ"",""Bandit1_DZ"",""Survivor2_DZ"",""Survivor2_1DZ"",""Survivor2_2DZ"",""Survivor2_3DZ"",""Survivor3_DZ"",""Survivor4_DZ"",""Survivor4_1DZ"",""Survivor4_2DZ"",""Survivor4_3DZ"",""Survivor8_DZ"",""Survivor8_1DZ"",""Survivor8_2DZ"",""Survivor8_3DZ"",""Bandit_S_DZ"",""Bandit1_1DZ"",""Bandit1_2DZ"",""Bandit1_3DZ"",""Bandit1_3_1DZ"",""Bandit1_3_2DZ"",""Bandit2_1DZ"",""Bandit2_2DZ"",""Bandit2_3DZ"",""Bandit2_4DZ"",""Bandit2_5DZ"",""Bandit3_1"",""Hero1_1DZ"",""Hero1_2DZ"",""Hero1_3DZ"",""Hero1_4DZ"",""Hero1_5DZ"",""Hero1_6DZ"",""Hero1_7DZ"",""Hero2_1DZ"",""Hero2_2DZ"",""Hero2_3DZ"",""Hero2_4DZ"",""Hero2_5DZ"",""Hero3_1DZ"",""Hero3_2DZ"",""Hero3_3DZ"",""Hero3_4DZ"",""Hero3_5DZ"",""Hero3_6DZ"",""Hero2_10DZ"",""Sniper1_DZ""],200];" \n
  183. " _nearby = count _nearby2; " \n
  184. "" \n
  185. " if (_nearby == 0) then {" \n
  186. "" \n
  187. " if (_x isKindOf ""zZombie_Base"") then {" \n
  188. " " \n
  189. " _myGroupX = group _x;" \n
  190. " _x removeAllMPEventHandlers ""mpkilled"";" \n
  191. " _x removeAllMPEventHandlers ""mphit"";" \n
  192. " _x removeAllMPEventHandlers ""mprespawn"";" \n
  193. " " \n
  194. " _x removeAllEventHandlers ""FiredNear"";" \n
  195. " _x removeAllEventHandlers ""HandleDamage"";" \n
  196. " _x removeAllEventHandlers ""Killed"";" \n
  197. " _x removeAllEventHandlers ""Fired"";" \n
  198. " _x removeAllEventHandlers ""GetOut"";" \n
  199. " _x removeAllEventHandlers ""Local"";" \n
  200. " " \n
  201. " clearVehicleInit _x; //let's clear all PICs" \n
  202. " deleteVehicle _x;" \n
  203. " deleteGroup _myGroupX;" \n
  204. " _x = nil; //this seems clean even more :) thx Tansien" \n
  205. " //deleteVehicle _x;" \n
  206. " _delQtyZ = _delQtyZ + 1;" \n
  207. " };" \n
  208. " " \n
  209. " if (_modeldex ==""Survivor1_DZ"") then { " \n
  210. " _myGroupX = group _x;" \n
  211. " _x removeAllMPEventHandlers ""mpkilled"";" \n
  212. " _x removeAllMPEventHandlers ""mphit"";" \n
  213. " _x removeAllMPEventHandlers ""mprespawn"";" \n
  214. " " \n
  215. " _x removeAllEventHandlers ""FiredNear"";" \n
  216. " _x removeAllEventHandlers ""HandleDamage"";" \n
  217. " _x removeAllEventHandlers ""Killed"";" \n
  218. " _x removeAllEventHandlers ""Fired"";" \n
  219. " _x removeAllEventHandlers ""GetOut"";" \n
  220. " _x removeAllEventHandlers ""Local"";" \n
  221. " " \n
  222. " clearVehicleInit _x; //let's clear all PICs" \n
  223. " deleteVehicle _x;" \n
  224. " deleteGroup _myGroupX;" \n
  225. " _x = nil; //this seems clean even more :) thx Tansien " \n
  226. " };" \n
  227. " " \n
  228. " " \n
  229. "} forEach allDead;" \n
  230. "diag_log format [""Zombie deleted = %1, allDead Total=%2"", _delQtyZ, (count allDead)];" \n
  231. "" \n
  232. "};" \n
  233. "" \n
  234. "_modeldex = """";" \n
  235. "_nameKillerP = ""unknown"";" \n
  236. "_typedeP = 0;" \n
  237. "{" \n
  238. "_modeldex = typeOf _x;" \n
  239. "//diag_log(""_modeldex = ""+str(_modeldex));" \n
  240. "" \n
  241. "if (_modeldex in [""ori_vil_woman_survivor_1"",""ori_vil_woman_survivor_2"",""ori_vil_woman_survivor_3"",""ori_vil_woman_survivor_4"",""ori_vil_woman_survivor_5"",""ori_vil_woman_survivor_6"",""ori_vil_woman_bandit_1"",""ori_vil_woman_bandit_2"",""ori_vil_woman_bandit_3"",""ori_vil_woman_bandit_4"",""ori_vil_woman_bandit_5"",""ori_vil_woman_bandit_6"",""ori_vil_woman_hero_1"",""ori_vil_woman_hero_2"",""ori_vil_woman_hero_3"",""ori_vil_woman_hero_4"",""ori_vil_woman_hero_5"",""ori_vil_woman_hero_6"",""SurvivorW2_DZ"",""Bandit1_DZ"",""Survivor2_DZ"",""Survivor2_1DZ"",""Survivor2_2DZ"",""Survivor2_3DZ"",""Survivor3_DZ"",""Survivor4_DZ"",""Survivor4_1DZ"",""Survivor4_2DZ"",""Survivor4_3DZ"",""Survivor8_DZ"",""Survivor8_1DZ"",""Survivor8_2DZ"",""Survivor8_3DZ"",""Bandit_S_DZ"",""Bandit1_1DZ"",""Bandit1_2DZ"",""Bandit1_3DZ"",""Bandit1_3_1DZ"",""Bandit1_3_2DZ"",""Bandit2_1DZ"",""Bandit2_2DZ"",""Bandit2_3DZ"",""Bandit2_4DZ"",""Bandit2_5DZ"",""Bandit3_1"",""Hero1_1DZ"",""Hero1_2DZ"",""Hero1_3DZ"",""Hero1_4DZ"",""Hero1_5DZ"",""Hero1_6DZ"",""Hero1_7DZ"",""Hero2_1DZ"",""Hero2_2DZ"",""Hero2_3DZ"",""Hero2_4DZ"",""Hero2_5DZ"",""Hero3_1DZ"",""Hero3_2DZ"",""Hero3_3DZ"",""Hero3_4DZ"",""Hero3_5DZ"",""Hero3_6DZ"",""Hero2_10DZ"",""Sniper1_DZ"",""SectorB_def"",""SectorZ_def""]) then " \n
  242. " {" \n
  243. " private [""_weapons"", ""_magazines"", ""_backpack"", ""_backpackWeapons"", ""_backpackMagazines"", ""_backpackType"", ""_position"", ""_holder"", ""_i"", ""_itemsCount"", ""_isZombie""];" \n
  244. "" \n
  245. " _weapons = weapons _x;" \n
  246. " _magazines = magazines _x;" \n
  247. " _backpack = unitBackpack _x;" \n
  248. " _nameBody = _x getVariable[""bodyName"",""unknown""];" \n
  249. " _position = (_x modelToWorld [0.0, 0.0, 0.0]); " \n
  250. " //_position2 = getPosATL _x;" \n
  251. " //_position3 = getPos _x;" \n
  252. " _nameKillerP = _x getVariable [""nameKillerP"",""unknown""];" \n
  253. " _typedeP = _x getVariable [""typedeP"",""unknown""];" \n
  254. "" \n
  255. " if (!isNull _backpack) then" \n
  256. " {" \n
  257. " _backpackWeapons = getWeaponCargo _backpack;" \n
  258. " _backpackMagazines = getMagazineCargo _backpack;" \n
  259. " _backpackType = typeOf _backpack;" \n
  260. " }" \n
  261. " else" \n
  262. " {" \n
  263. " _backpackWeapons = [[], []];" \n
  264. " _backpackMagazines = [[], []];" \n
  265. " _backpackType = """";" \n
  266. " };" \n
  267. "" \n
  268. " _isZombie = _x isKindOf ""zZombie_Base"";" \n
  269. "" \n
  270. " deleteVehicle _x;" \n
  271. " " \n
  272. " _itemsCount = (count _weapons) + (count _magazines) + (count (_backpackWeapons select 0)) + (count (_backpackMagazines select 0));" \n
  273. "" \n
  274. " if ((_itemsCount > 0) and (!_isZombie)) then" \n
  275. " {" \n
  276. " _holder = createVehicle [""WeaponHolder"", _position, [], 0, ""CAN_COLLIDE""];" \n
  277. " _holder setPos _position;" \n
  278. "// createVehicle _position;" \n
  279. " _holder setVariable [""RepLoot"", (time+2700), true];" \n
  280. " _cruse = createVehicle [""GraveCrossHelmet_DZ"", _position, [], 0, ""CAN_COLLIDE""];" \n
  281. " _cruse setPos _position;" \n
  282. " //_cruse2 = createVehicle [""GraveCrossHelmet_DZ"", _position2, [], 0, ""CAN_COLLIDE""]; " \n
  283. " // _cruse3 = createVehicle [""GraveCrossHelmet_DZ"", _position3, [], 0, ""CAN_COLLIDE""];" \n
  284. " " \n
  285. "//createVehicle _position;" \n
  286. " " \n
  287. "" \n
  288. " _cruse setVariable [""RepBody"", _nameBody, true];" \n
  289. " _cruse setVariable [""nameKillerP"",_nameKillerP, true];" \n
  290. " _cruse setVariable [""typedeP"", _typedeP, true];" \n
  291. " " \n
  292. " { " \n
  293. " _isOkeW = true;" \n
  294. " if (_x == ""M107_DZ"") then { _isOkeW=false; };" \n
  295. " if (_x == ""M107"") then { _isOkeW=false; };" \n
  296. " if (_x == ""BAF_AS50_scoped"") then { _isOkeW=false; };" \n
  297. " if (_isOkeW) then {" \n
  298. " _holder addWeaponCargoGlobal [_x, 1];" \n
  299. " };" \n
  300. " } forEach _weapons;" \n
  301. " { " \n
  302. " _isOke = true;" \n
  303. " if (_x == ""5Rnd_127x99_as50"") then { _isOke = false; };" \n
  304. " if (_x == ""10Rnd_127x99_m107"") then { _isOke = false; };" \n
  305. " if (_isOke) then {" \n
  306. " _holder addMagazineCargoGlobal [_x, 1]; " \n
  307. " };" \n
  308. " } forEach _magazines;" \n
  309. "" \n
  310. "" \n
  311. " for ""_i"" from 0 to ((count (_backpackWeapons select 0)) - 1) do" \n
  312. " {" \n
  313. " _holder addWeaponCargoGlobal" \n
  314. " [((_backpackWeapons select 0) select _i), ((_backpackWeapons select 1) select _i)];" \n
  315. " };" \n
  316. "" \n
  317. " for ""_i"" from 0 to ((count (_backpackMagazines select 0)) - 1) do" \n
  318. " {" \n
  319. " _holder addMagazineCargoGlobal" \n
  320. " [((_backpackMagazines select 0) select _i), ((_backpackMagazines select 1) select _i)];" \n
  321. " };" \n
  322. " };" \n
  323. "" \n
  324. " if ((_backpackType != """") and (!_isZombie)) then" \n
  325. " {" \n
  326. " //_backpackHolder = ""WeaponHolder"" createVehicle _position;" \n
  327. " _backpackHolder = createVehicle [_backpackType, _position, [], 0, ""CAN_COLLIDE""];" \n
  328. " _backpackHolder setVariable [""RepLoot"", (time+2700), true];" \n
  329. " _backpackHolder setPos _position;" \n
  330. " //_holder addBackpackCargoGlobal [_backpackType, 1];" \n
  331. " //_backpackHolder addBackpackCargoGlobal [_backpackType, 1];" \n
  332. " };" \n
  333. " //_flys = count ( allMissionObjects ""#dynamicsound"");" \n
  334. " _countTotalDelDead = _countTotalDelDead+1;" \n
  335. " diag_log format [""Replaced Body (%4)-(%1 items, at %2), _backpackType=%3"", _itemsCount, _position, _backpackType,_nameBody];" \n
  336. " };" \n
  337. "} forEach allDead;" \n
  338. "diag_log format [""Total Replaced %1 Bodys"", _countTotalDelDead];" \n
  339. "" \n
  340. "" \n
  341. ""/*%FSM</STATEINIT""">*/;
  342. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  343. class Links
  344. {
  345. /*%FSM<LINK "true">*/
  346. class true
  347. {
  348. priority = 0.000000;
  349. to="general_cleanup";
  350. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  351. condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
  352. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  353. };
  354. /*%FSM</LINK>*/
  355. };
  356. };
  357. /*%FSM</STATE>*/
  358. /*%FSM<STATE "cleanup_objects">*/
  359. class cleanup_objects
  360. {
  361. name = "cleanup_objects";
  362. init = /*%FSM<STATEINIT""">*/"_missionObjsW = allMissionObjects ""WeaponHolder"" + allMissionObjects ""#dynamicsound"" + allMissionObjects ""WeaponHolder_ItemRestTent"" + allMissionObjects ""WeaponHolder_ItemTent"" + allMissionObjects ""WeaponHolder_ItemHatchet"" + allMissionObjects ""WeaponHolder_PartGeneric"" + allMissionObjects ""WeaponHolder_ItemJerrycanB"" + allMissionObjects ""WeaponHolder_ItemJerrycan"" + allMissionObjects ""WeaponHolder_PartEngine"" + allMissionObjects ""WeaponHolder_PartFueltank"" + allMissionObjects ""WeaponHolder_PartGlass"" + allMissionObjects ""WeaponHolder_PartWheel"" + allMissionObjects ""WeaponHolder_PartVRotor"" + allMissionObjects ""DZ_Patrol_Pack_EP1"" + allMissionObjects ""DZ_CivilBackpack_EP1"" + allMissionObjects ""DZ_Assault_Pack_EP1"" + allMissionObjects ""CZ_VestPouch_EP1"" + allMissionObjects ""DZ_ALICE_Pack_EP1"" + allMissionObjects ""DZ_Backpack_EP1"" + allMissionObjects ""WeaponHolder_PartScrap"" + allMissionObjects ""WeaponHolder_ItemPickaxe"" + allMissionObjects ""WeaponHolder_ItemCeMix"" + allMissionObjects ""O_MegaPack_1"" + allMissionObjects ""O_TravelerPack_1"";" \n
  363. "_qty = count _missionObjsW;" \n
  364. "diag_log (""CLEANUP: PERFORMING ITEM CLEANUP: TOTAL "" + str(_qty) + "" LOOT BAGS TIME="" + str(time));" \n
  365. "_delQty = 0;" \n
  366. "_keepme = false;" \n
  367. "_keepmetoo = 0;" \n
  368. "_itemNumer =0;" \n
  369. "_itemNumerP =0;" \n
  370. "_itemNumerHP =0;" \n
  371. "_nearby = 0;" \n
  372. " " \n
  373. "{" \n
  374. " _keep = _x getVariable [""permaLoot"",false];" \n
  375. " _keept = _x getVariable [""RepLoot"",0];" \n
  376. " if (_keept!=0) then {" \n
  377. " //diag_log (""RepLoot="" + str(_keept));" \n
  378. " _keepmetoo = (_keept - time);" \n
  379. " if (_keepmetoo>0) then {" \n
  380. " _keepme = true;" \n
  381. " //diag_log (""_keepme = true"");" \n
  382. " } else {" \n
  383. " _keepme = false;" \n
  384. " //diag_log (""_keepme = false"");" \n
  385. " };" \n
  386. " };" \n
  387. " //_nearby = {isPlayer _x} count (_x nearEntities [[""BanditW1_DZ"",""SurvivorW2_DZ"",""Bandit1_DZ"",""Survivor2_DZ"",""Survivor2_1DZ"",""Survivor2_2DZ"",""Survivor2_3DZ"",""Survivor3_DZ"",""Survivor4_DZ"",""Survivor4_1DZ"",""Survivor4_2DZ"",""Survivor4_3DZ"",""Survivor8_DZ"",""Survivor8_1DZ"",""Survivor8_2DZ"",""Survivor8_3DZ"",""Bandit_S_DZ"",""Bandit1_1DZ"",""Bandit1_2DZ"",""Bandit1_3DZ"",""Bandit1_3_1DZ"",""Bandit1_3_2DZ"",""Bandit2_1DZ"",""Bandit2_2DZ"",""Bandit2_3DZ"",""Bandit2_4DZ"",""Bandit2_5DZ"",""Bandit3_1"",""Hero1_1DZ"",""Hero1_2DZ"",""Hero1_3DZ"",""Hero1_4DZ"",""Hero1_5DZ"",""Hero1_6DZ"",""Hero1_7DZ"",""Hero2_1DZ"",""Hero2_2DZ"",""Hero2_3DZ"",""Hero2_4DZ"",""Hero2_5DZ"",""Hero3_1DZ"",""Hero3_2DZ"",""Hero3_3DZ"",""Hero3_4DZ"",""Hero3_5DZ"",""Hero3_6DZ"",""Hero2_10DZ"",""Sniper1_DZ""], 300]);" \n
  388. " _nearby2 = (getposATL _x) nearEntities [[""ori_vil_woman_survivor_1"",""ori_vil_woman_survivor_2"",""ori_vil_woman_survivor_3"",""ori_vil_woman_survivor_4"",""ori_vil_woman_survivor_5"",""ori_vil_woman_survivor_6"",""ori_vil_woman_bandit_1"",""ori_vil_woman_bandit_2"",""ori_vil_woman_bandit_3"",""ori_vil_woman_bandit_4"",""ori_vil_woman_bandit_5"",""ori_vil_woman_bandit_6"",""ori_vil_woman_hero_1"",""ori_vil_woman_hero_2"",""ori_vil_woman_hero_3"",""ori_vil_woman_hero_4"",""ori_vil_woman_hero_5"",""ori_vil_woman_hero_6"",""SurvivorW2_DZ"",""Bandit1_DZ"",""Survivor2_DZ"",""Survivor2_1DZ"",""Survivor2_2DZ"",""Survivor2_3DZ"",""Survivor3_DZ"",""Survivor4_DZ"",""Survivor4_1DZ"",""Survivor4_2DZ"",""Survivor4_3DZ"",""Survivor8_DZ"",""Survivor8_1DZ"",""Survivor8_2DZ"",""Survivor8_3DZ"",""Bandit_S_DZ"",""Bandit1_1DZ"",""Bandit1_2DZ"",""Bandit1_3DZ"",""Bandit1_3_1DZ"",""Bandit1_3_2DZ"",""Bandit2_1DZ"",""Bandit2_2DZ"",""Bandit2_3DZ"",""Bandit2_4DZ"",""Bandit2_5DZ"",""Bandit3_1"",""Hero1_1DZ"",""Hero1_2DZ"",""Hero1_3DZ"",""Hero1_4DZ"",""Hero1_5DZ"",""Hero1_6DZ"",""Hero1_7DZ"",""Hero2_1DZ"",""Hero2_2DZ"",""Hero2_3DZ"",""Hero2_4DZ"",""Hero2_5DZ"",""Hero3_1DZ"",""Hero3_2DZ"",""Hero3_3DZ"",""Hero3_4DZ"",""Hero3_5DZ"",""Hero3_6DZ"",""Hero2_10DZ"",""Sniper1_DZ""],200];" \n
  389. " _nearby = count _nearby2; " \n
  390. " //diag_log format [""%3. _nearby =%1, typeOf=%2"", _nearby,(typeOf _x),_itemNumer];" \n
  391. " if ( (!_keep) && (_nearby == 0) && (!_keepme) ) then {" \n
  392. " " \n
  393. " clearVehicleInit _x; //let's clear all PICs" \n
  394. " deleteVehicle _x;" \n
  395. " _x = nil; //this seems clean even more :) thx Tansien" \n
  396. " //deleteVehicle _x;" \n
  397. " _delQty = _delQty + 1;" \n
  398. " };" \n
  399. " if (_nearby != 0) then {" \n
  400. " _itemNumer =_itemNumer + 1;" \n
  401. " };" \n
  402. " if (_keepme) then {" \n
  403. " _itemNumerP =_itemNumerP + 1;" \n
  404. " };" \n
  405. " if (_keep) then {" \n
  406. " _itemNumerHP =_itemNumerHP + 1;" \n
  407. " };" \n
  408. "} forEach _missionObjsW;" \n
  409. "diag_log format [""CLEANUP: _itemNumer = %1, _itemNumerP=%2, _itemNumerHP=%3"",_itemNumer,_itemNumerP,_itemNumerHP];" \n
  410. "if (_delQty > 0) then {" \n
  411. " diag_log (""CLEANUP: DELETED "" + str(_delQty) + "" LOOT BAGS, TOTAL "" + str(_qty) + "", TIME end="" + str(time));" \n
  412. "};" \n
  413. " " \n
  414. "_delQtyAnimal = 0;" \n
  415. "_animaltype = [];" \n
  416. "_delQtyAnimalR = 0;" \n
  417. "{" \n
  418. " _xtypeanimal = typeof _x;" \n
  419. " //diag_log format [""x= %1, typeOf=%2"",_x,(typeOf _x)];" \n
  420. " if(_xtypeanimal==""Rabbit"") then {" \n
  421. " _myGroupX = group _x;" \n
  422. " _x removeAllMPEventHandlers ""mpkilled"";" \n
  423. " _x removeAllMPEventHandlers ""mphit"";" \n
  424. " _x removeAllMPEventHandlers ""mprespawn"";" \n
  425. " " \n
  426. " _x removeAllEventHandlers ""FiredNear"";" \n
  427. " _x removeAllEventHandlers ""HandleDamage"";" \n
  428. " _x removeAllEventHandlers ""Killed"";" \n
  429. " _x removeAllEventHandlers ""Fired"";" \n
  430. " _x removeAllEventHandlers ""GetOut"";" \n
  431. " _x removeAllEventHandlers ""Local"";" \n
  432. " " \n
  433. " clearVehicleInit _x; //let's clear all PICs" \n
  434. " deleteVehicle _x;" \n
  435. " deleteGroup _myGroupX;" \n
  436. " _x = nil; //this seems clean even more :) thx Tansien" \n
  437. " //deleteVehicle _x;" \n
  438. " _delQtyAnimalR = _delQtyAnimalR+1;" \n
  439. " } else {" \n
  440. " _nearby = {isPlayer _x} count (_x nearEntities [[""BanditW1_DZ"",""SurvivorW2_DZ"",""Bandit1_DZ"",""Survivor2_DZ"",""Survivor2_1DZ"",""Survivor2_2DZ"",""Survivor2_3DZ"",""Survivor3_DZ"",""Survivor4_DZ"",""Survivor4_1DZ"",""Survivor4_2DZ"",""Survivor4_3DZ"",""Survivor8_DZ"",""Survivor8_1DZ"",""Survivor8_2DZ"",""Survivor8_3DZ"",""Bandit_S_DZ"",""Bandit1_1DZ"",""Bandit1_2DZ"",""Bandit1_3DZ"",""Bandit1_3_1DZ"",""Bandit1_3_2DZ"",""Bandit2_1DZ"",""Bandit2_2DZ"",""Bandit2_3DZ"",""Bandit2_4DZ"",""Bandit2_5DZ"",""Bandit3_1"",""Hero1_1DZ"",""Hero1_2DZ"",""Hero1_3DZ"",""Hero1_4DZ"",""Hero1_5DZ"",""Hero1_6DZ"",""Hero1_7DZ"",""Hero2_1DZ"",""Hero2_2DZ"",""Hero2_3DZ"",""Hero2_4DZ"",""Hero2_5DZ"",""Hero3_1DZ"",""Hero3_2DZ"",""Hero3_3DZ"",""Hero3_4DZ"",""Hero3_5DZ"",""Hero3_6DZ"",""Hero2_10DZ"",""Sniper1_DZ""], 100]);" \n
  441. " " \n
  442. " if (!(_xtypeanimal in _animaltype)) then { _animaltype set [(count _animaltype),(typeOf _x)]; };" \n
  443. " if (_nearby==0) then {" \n
  444. " _myGroupX = group _x;" \n
  445. " _x removeAllMPEventHandlers ""mpkilled"";" \n
  446. " _x removeAllMPEventHandlers ""mphit"";" \n
  447. " _x removeAllMPEventHandlers ""mprespawn"";" \n
  448. " " \n
  449. " _x removeAllEventHandlers ""FiredNear"";" \n
  450. " _x removeAllEventHandlers ""HandleDamage"";" \n
  451. " _x removeAllEventHandlers ""Killed"";" \n
  452. " _x removeAllEventHandlers ""Fired"";" \n
  453. " _x removeAllEventHandlers ""GetOut"";" \n
  454. " _x removeAllEventHandlers ""Local"";" \n
  455. " " \n
  456. " clearVehicleInit _x; //let's clear all PICs" \n
  457. " deleteVehicle _x;" \n
  458. " deleteGroup _myGroupX;" \n
  459. " _x = nil; //this seems clean even more :) thx Tansien" \n
  460. " //deleteVehicle _x;" \n
  461. " _delQtyAnimal = _delQtyAnimal + 1;" \n
  462. " };" \n
  463. " };" \n
  464. "} forEach allMissionObjects ""Animal"";" \n
  465. " " \n
  466. "diag_log format [""Animals deleted = %1(Rabbits %3), Animals alive=%2"", _delQtyAnimal, (count allMissionObjects ""Animal""),_delQtyAnimalR];" \n
  467. "diag_log format [""At=%1"",_animaltype];"/*%FSM</STATEINIT""">*/;
  468. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  469. class Links
  470. {
  471. /*%FSM<LINK "true">*/
  472. class true
  473. {
  474. priority = 0.000000;
  475. to="general_cleanup";
  476. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  477. condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
  478. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  479. };
  480. /*%FSM</LINK>*/
  481. };
  482. };
  483. /*%FSM</STATE>*/
  484. /*%FSM<STATE "sync_the_time">*/
  485. class sync_the_time
  486. {
  487. name = "sync_the_time";
  488. init = /*%FSM<STATEINIT""">*/"//Send request" \n
  489. "_key = ""CHILD:307:"";" \n
  490. "_result = [_key] call server_hiveReadWrite;" \n
  491. "_outcome = _result select 0;" \n
  492. "if(_outcome == ""PASS"") then {" \n
  493. " /*" \n
  494. " _date = _result select 1; " \n
  495. " _dateNum = dateToNumber(_date); " \n
  496. " _diff = ( _dateNum - dateToNumber (date) )*365*24*60;" \n
  497. " if ( abs(_diff)>5 ) then {" \n
  498. " setDate _date;" \n
  499. " dayzSetDate = _date;" \n
  500. " publicVariable ""dayzSetDate"";" \n
  501. " diag_log (""TIME SYNC: Local Time set to "" + str(_date));" \n
  502. " };" \n
  503. " */" \n
  504. " _date = _result select 1; " \n
  505. " _year = _date select 0;" \n
  506. " " \n
  507. " //_month = _date select 1;" \n
  508. " // _day = _date select 2;" \n
  509. " // _hour = 12;" \n
  510. " //_minute = 0;" \n
  511. " " \n
  512. " // gamedatas = [_year,_month,_day,_hour,_minute];" \n
  513. " " \n
  514. " _diff = ( dateToNumber (_date) - dateToNumber (gamedatas) )*365*24*60;" \n
  515. "" \n
  516. " diag_log format [""%1, %2, %3"",_date,gamedatas,_diff];" \n
  517. "" \n
  518. " _dateNumP = (dateToNumber (gamedatas)) + ((6*_diff)/(365*24*60));" \n
  519. " _date = NumberToDate[_year,_dateNumP];" \n
  520. " setDate _date;" \n
  521. " dayzSetDate = _date;" \n
  522. " publicVariable ""dayzSetDate"";" \n
  523. " diag_log (""TIME SYNC: fsm Local Time set to "" + str(_date));"/*%FSM</STATEINIT""">*/;
  524. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  525. class Links
  526. {
  527. /*%FSM<LINK "true">*/
  528. class true
  529. {
  530. priority = 0.000000;
  531. to="general_cleanup";
  532. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  533. condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
  534. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  535. };
  536. /*%FSM</LINK>*/
  537. };
  538. };
  539. /*%FSM</STATE>*/
  540. /*%FSM<STATE "general_cleanup">*/
  541. class general_cleanup
  542. {
  543. name = "general_cleanup";
  544. init = /*%FSM<STATEINIT""">*/"//Clean groups" \n
  545. "{" \n
  546. " //diag_log (""CLEANUP: CHECKING GROUP WITH "" + str(count units _x) + "" UNITS"");" \n
  547. " if (count units _x==0) then {" \n
  548. " deleteGroup _x;" \n
  549. " //diag_log (""CLEANUP: DELETING A GROUP"");" \n
  550. " };" \n
  551. "} forEach allGroups;" \n
  552. "" \n
  553. "/*" \n
  554. "//Check for Ammobox" \n
  555. " {" \n
  556. " if(!(_x isKindOf ""WeaponHolder"")) then {" \n
  557. " diag_log (""CLEANUP: DELETING AN AMMOBOX "" + (typeOf _x));" \n
  558. " deleteVehicle _x;" \n
  559. " };" \n
  560. " } forEach allMissionObjects ""ReammoBox"";" \n
  561. "*/" \n
  562. "" \n
  563. "ori_servObjMonitor = _safety;"/*%FSM</STATEINIT""">*/;
  564. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  565. class Links
  566. {
  567. /*%FSM<LINK "true">*/
  568. class true
  569. {
  570. priority = 0.000000;
  571. to="waiting";
  572. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  573. condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
  574. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  575. };
  576. /*%FSM</LINK>*/
  577. };
  578. };
  579. /*%FSM</STATE>*/
  580. /*%FSM<STATE "prepare">*/
  581. class prepare
  582. {
  583. name = "prepare";
  584. init = /*%FSM<STATEINIT""">*/"diag_log (""CLEANUP: INITIALIZING CLEANUP SCRIPT"");" \n
  585. "" \n
  586. "_safety = ori_servObjMonitor;" \n
  587. "" \n
  588. "_lastTimeSync = time;" \n
  589. "_lastDeadCheck = time;" \n
  590. "_lastItemCheck = time;" \n
  591. "_lastObjectUpdateCheck = time;" \n
  592. "_timeHackCheck = time;" \n
  593. "_timeMOlist = time;" \n
  594. "_deadBodies = [];" \n
  595. "_maxBodies = 15;" \n
  596. ""/*%FSM</STATEINIT""">*/;
  597. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  598. class Links
  599. {
  600. /*%FSM<LINK "true">*/
  601. class true
  602. {
  603. priority = 0.000000;
  604. to="waiting";
  605. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  606. condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
  607. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  608. };
  609. /*%FSM</LINK>*/
  610. };
  611. };
  612. /*%FSM</STATE>*/
  613. /*%FSM<STATE "update_objects">*/
  614. class update_objects
  615. {
  616. name = "update_objects";
  617. init = /*%FSM<STATEINIT""">*/"if ((count needUpdate_objects) > 0) then {" \n
  618. "" \n
  619. " diag_log format[""DEBUG: needUpdate_objects=%1"",needUpdate_objects];" \n
  620. "" \n
  621. " {" \n
  622. " diag_log format[""DEBUG:_x=%1, type=%2"",_x,(typeOf _x)];" \n
  623. " //_x setVariable [""needUpdate"",false,true];" \n
  624. " needUpdate_objects = needUpdate_objects - [_x];" \n
  625. " [_x,""all""] call server_updatObiect; //should be call!!!" \n
  626. " } forEach needUpdate_objects;" \n
  627. "};"/*%FSM</STATEINIT""">*/;
  628. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  629. class Links
  630. {
  631. /*%FSM<LINK "true">*/
  632. class true
  633. {
  634. priority = 0.000000;
  635. to="general_cleanup";
  636. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  637. condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
  638. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  639. };
  640. /*%FSM</LINK>*/
  641. };
  642. };
  643. /*%FSM</STATE>*/
  644. /*%FSM<STATE "Make_MO_list">*/
  645. class Make_MO_list
  646. {
  647. name = "Make_MO_list";
  648. init = /*%FSM<STATEINIT""">*/"diag_log (""MOList Start: ""+str(count allMissionObjects """")+"", Start Time="" + str(time));" \n
  649. "_MOList = allMissionObjects """";" \n
  650. "_MOListP = [];" \n
  651. "_countMOL = 0;" \n
  652. "_countMOLP = 0;" \n
  653. "_countxt = 0;" \n
  654. "_countxp = 0;" \n
  655. "_temparx = [];" \n
  656. "_counttemp = 0;" \n
  657. "_xr = 0;" \n
  658. "_xt = 0;" \n
  659. "_keepto = false;" \n
  660. "_keepto1 = 0;" \n
  661. "{" \n
  662. " _MOListP set [(count _MOListP),(typeOf _x)];" \n
  663. "} forEach _MOList;" \n
  664. "{" \n
  665. " _countMOL = _countMOL+1;" \n
  666. " //_countxt = {_xr==_x} count _MOList;" \n
  667. " " \n
  668. " _xt = typeOf _x;" \n
  669. "" \n
  670. " if (_xt !=""Baseball_DZ"") then {" \n
  671. " //diag_log format[""MOList:WeaponHolder Object: %1, TypeOf: %2, W:%3, Name:%4"",_x,(typeOf _x),(_x modelToWorld [0.0, 0.0, 0.0]),(name _x)];" \n
  672. "//diag_log format[""MOList:WeaponHolder Object: %1, TypeOf: %2, W:%3"",_x,(typeOf _x),(_x modelToWorld [0.0, 0.0, 0.0])];" \n
  673. " " \n
  674. " _keepto1 = _x getVariable [""RepLoot"",0]; " \n
  675. " if (_keepto1!=0) then {" \n
  676. " //diag_log (""_keepto1="" + str(_keepto1)); " \n
  677. " // //diag_log format[""MOList:WeaponHolder Object: %1, TypeOf: %2, W:%3"",_x,(typeOf _x),(_x modelToWorld [0.0, 0.0, 0.0])];" \n
  678. " };" \n
  679. " };" \n
  680. "" \n
  681. " if (!(_xt in _temparx)) then {" \n
  682. " //diag_log (""_countxp = "" + _countxp + "" typeOf: "" + str(typeOf _x));" \n
  683. " _countMOLP = _countMOLP +1;" \n
  684. " _counttemp = count _temparx;" \n
  685. " //diag_log (""_counttemp = "" + str(_counttemp));" \n
  686. " if (_counttemp == 0) then " \n
  687. " {" \n
  688. " _temparx set [0,(typeOf _x)];" \n
  689. " } else {" \n
  690. " _temparx set [_counttemp,(typeOf _x)];" \n
  691. " };" \n
  692. " _xr = typeOf _x;" \n
  693. " _countxt = {_x == _xr} count _MOListP;" \n
  694. " diag_log format[""MOList: %1. N: %2, Object: %3, TypeOf: %4, W:%5"",_countMOLP,_countxt,_x,(typeOf _x),(_x modelToWorld [0.0, 0.0, 0.0])];" \n
  695. " };" \n
  696. " //diag_log format [""_MOListP = %1"",(_MOListP select ((count _MOListP)-1))];" \n
  697. "} forEach _MOList;"/*%FSM</STATEINIT""">*/;
  698. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  699. class Links
  700. {
  701. /*%FSM<LINK "true">*/
  702. class true
  703. {
  704. priority = 0.000000;
  705. to="general_cleanup";
  706. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  707. condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
  708. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  709. };
  710. /*%FSM</LINK>*/
  711. };
  712. };
  713. /*%FSM</STATE>*/
  714. /*%FSM<STATE "check_for_hacker">*/
  715. class check_for_hacker
  716. {
  717. name = "check_for_hacker";
  718. init = /*%FSM<STATEINIT""">*/"//Check for hackers" \n
  719. " {" \n
  720. " if(vehicle _x != _x) then {" \n
  721. " _nameX = _x getVariable [""delmeplease"", ""hacker""];" \n
  722. " if (_nameX == ""hacker"") then {" \n
  723. " if (!(vehicle _x in _safety) && ((typeOf vehicle _x) != ""ParachuteWest"")) then {" \n
  724. " diag_log (""CLEANUP: KILLING A HACKER "" + (name _x) + "" "" + str(_x) + "" IN "" + (typeOf vehicle _x));" \n
  725. " (vehicle _x) setDamage 1;" \n
  726. " _x setDamage 1;" \n
  727. " };" \n
  728. " };" \n
  729. " };" \n
  730. " } forEach allUnits;"/*%FSM</STATEINIT""">*/;
  731. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  732. class Links
  733. {
  734. /*%FSM<LINK "true">*/
  735. class true
  736. {
  737. priority = 0.000000;
  738. to="general_cleanup";
  739. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  740. condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
  741. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  742. };
  743. /*%FSM</LINK>*/
  744. };
  745. };
  746. /*%FSM</STATE>*/
  747. };
  748. initState="init";
  749. finalStates[] =
  750. {
  751. };
  752. };
  753. /*%FSM</COMPILE>*/
Advertisement
Add Comment
Please, Sign In to add comment