Advertisement
Guest User

Untitled

a guest
May 18th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.45 KB | None | 0 0
  1. /*
  2. a3 epoch trader
  3. init.sqf
  4. by Halv & Suppe
  5. */
  6.  
  7. //if any static cords are set here, there will be a trader at that exact position and direction
  8. _staticCoords = switch(toLower worldName)do{
  9. case "altis":{
  10. [
  11. /* [[pos,i,tion],direction,createmarker,props]*/
  12. [[18459.1,14259.2,0.00141716],340.199], //trader by mine
  13. [[13319,14523.9,0.00134587],143.067], //trader by stavros
  14. [[6193.02,16828.7,0.00118256],1.52142] //trader by kore
  15. ]
  16. };
  17. case "stratis":{[]};
  18. case "bornholm":{[]};
  19. case "chernarus":{
  20. [
  21. //Stary
  22. [[6357, 7814, 0],1.52142],
  23. [[6315.38, 7838.79, 0],1.52142],
  24. [[6347.03, 7819.33, 0],1.52142],
  25. [[6340.82, 7823.59, 0],1.52142],
  26. [[6331.42, 7829.42, 0],1.52142],
  27. [[6327.05, 7834.04, 0],1.52142],
  28. //Klen
  29. [[11485.9, 11338.9, 0],1.52142],
  30. [[11494.5, 11325.4, 0],1.52142],
  31. [[11489.2, 11318.5, 0],1.52142],
  32. [[11480.5, 11315.5, 0],1.52142],
  33. [[11476.5, 11318.4, 0],1.52142],
  34. [[11468, 11326, 0],1.52142],
  35. [[11471.7, 11322.4, 0],1.52142],
  36. //Bash
  37. [[4060.91, 11674.6, 0],1.52142],
  38. [[4055.67, 11679.6, 0],1.52142],
  39. [[4056.67, 11663.3, 0],1.52142],
  40. [[4052.87, 11660.9, 0],1.52142]
  41. ]
  42. };
  43. default{[]};
  44. };
  45.  
  46. _agent = "I_G_resistanceLeader_F";
  47.  
  48. //distance to search for trader positions
  49. _spawnarea = 17500;
  50.  
  51. _spawnnearroad = true;
  52.  
  53. _dist2roadMax = 0;
  54.  
  55. //amount of traders to build
  56. _tradercount = round(random 4)+17;
  57. //min distance from other traders in meters, dont go to higher than _spawnarea/(_tradercount+1) or script will just revert back to this amount to avoid problems
  58. _mindist = .5;
  59. //marker text for traders
  60. _markertext = "Trader";
  61.  
  62. _blacklistedAreas = switch (toLower worldName)do{
  63. case "altis":{[[[18459.1,14259.2,0.00141716],1000],[[12570.8,14320.2,4.67927],1000],[[6193.02,16828.7,0.00118256],1000]]};
  64. case "stratis":{[[[0,0,0],0]]};
  65. case "bornholm":{[[[0,0,0],0]]};
  66. case "chernarus":{[[[0,0,0],0]]};
  67. default{[[[0,0,0],0]]};
  68. };
  69.  
  70. //============================== DONT TOUCH ANYTHING BELOW THIS POINT ==============================\\
  71.  
  72. // Server stuff...
  73. if(isServer) then{
  74. diag_log "[HSBlackmarket] Server adding PVEvent";
  75. "HSPV_traderrequest" addPublicVariableEventHandler {(_this select 1) call HS_playertraderequest};
  76. diag_log "[HSBlackmarket] Server Loading functions";
  77. HS_playertraderequest = compileFinal preprocessFileLineNumbers "trader\HS_playertraderequest.sqf";
  78. HALV_PurgeObject = compileFinal preprocessFileLineNumbers "trader\HALV_PurgeObject.sqf";
  79. private ["_coords","_roadlist","_firstroad","_statdir"];
  80. /////////////////////////////////////////////////////////////
  81. /*
  82. this is taken from:
  83. objectMapper.sqf Author: Joris-Jan van 't Land
  84. Edited by HALV
  85. */
  86. private ["_multiplyMatrixFunc"];
  87. _multiplyMatrixFunc =
  88. {
  89. private ["_array1", "_array2", "_result"];
  90. _array1 = _this select 0;
  91. _array2 = _this select 1;
  92. _result =
  93. [
  94. (((_array1 select 0) select 0) * (_array2 select 0)) + (((_array1 select 0) select 1) * (_array2 select 1)),
  95. (((_array1 select 1) select 0) * (_array2 select 0)) + (((_array1 select 1) select 1) * (_array2 select 1))
  96. ];
  97. _result
  98. };
  99. /////////////////////////////////////////////////////////////
  100. waitUntil {(!isNil "BIS_fnc_findSafePos")};
  101. waitUntil {(!isNil "BIS_fnc_selectRandom")};
  102. diag_log "[HSBlackmarket] Server Building traders ...";
  103. if(_blacklistedAreas isEqualTo [[[0,0,0],0]])then{
  104. diag_log format["[HSBlackmarket]: no blacklisted areas found for world: %1",worldName];
  105. }else{
  106. diag_log format["[HSBlackmarket]: Selecting blacklisted areas for world: %1",worldName];
  107. };
  108.  
  109. if(_mindist > _spawnarea/(_tradercount+1))then{
  110. _mindist = _spawnarea/(_tradercount+1);
  111. diag_log format["[HSBlackmarket]: Reverted _mindist '%1' to avoid problems",_mindist];
  112. };
  113.  
  114. _units = [];
  115. _allcords = [];
  116. for "_i" from 1 to _tradercount do {
  117. while{true}do{
  118. scopeName "posiscope";
  119. _coords = [getMarkerPos "Center",0,_spawnarea,20,0,500,0] call BIS_fnc_findSafePos;
  120. _IsBlacklisted = false;
  121. {if(_coords distance (_x select 0) < (_x select 1))exitWith{_IsBlacklisted = true};}count _blacklistedAreas;
  122. {if(_coords distance _x < _mindist)exitWith{_IsBlacklisted = true};}count _allcords;
  123. _roadlist = _coords nearRoads _dist2roadMax;
  124. if(!_IsBlacklisted && !isOnRoad _coords && !surfaceIsWater _coords)then{
  125. _firstroad = [_roadlist,_coords] call BIS_fnc_nearestPosition;
  126. if(_spawnnearroad)then{
  127. if((count _roadlist > 0) && (_coords distance _firstroad > 50))then{breakOut "posiscope"};
  128. }else{
  129. if(count _roadlist > 0)then{
  130. if(_coords distance _firstroad > 50)then{breakOut "posiscope"};
  131. }else{breakOut "posiscope"};
  132. };
  133. };
  134. };
  135. _allcords pushBack _coords;
  136. diag_log format["[HSBlackmarket]: Found position for a HSBlackmarket ... (%1) %2",mapGridPosition _coords,_coords];
  137.  
  138. _randir = (random 360);
  139. // diag_log format["[HSBlackmarket]: _roadlist: %1 _roadlist: %2",_randir,_roadlist];
  140. if(count _roadlist > 0)then{
  141. _randir = [_coords,(position _firstroad)] call BIS_fnc_dirTo;
  142. // diag_log format["[HSBlackmarket]: _randir: %1 _firstroad: %2",_randir,_firstroad];
  143. };
  144. //create trader and objects
  145. _objects =
  146. [
  147. [180,180,
  148. ["Land_Campfire_F",[-0.669922,-7.08984,0],0],
  149. ["Land_CampingChair_V2_F",[0.0654297,0.904297,0],2],
  150. ["Land_CampingTable_F",[-0.117188,-1.29102,0],3.62851],
  151. ["Land_CampingTable_small_F",[-5.70996,6.62695,0],133.6414],
  152. ["Land_CampingChair_V1_F",[-5.4375,6.27148,0],140.0554],
  153. ["Land_Ground_sheet_blue_F",[-3.99902,9.41211,0],-128.113],
  154. ["Land_Sleeping_bag_brown_folded_F",[-3.40625,9.90234,0],52.2286],
  155. ["Land_TentDome_F",[-0.620117,8.94727,0],-89.0146],
  156. ["Land_WoodenLog_F",[-2.37109,-6.21289,0],0],
  157. ["Land_WoodenLog_F",[0.00488281,-5.4082,0],0],
  158. ["Land_WoodenLog_F",[1.02344,-7.76953,0],0],
  159. ["CargoNet_01_barrels_F",[-5.90723,2.83398,0],0],
  160. ["CargoNet_01_box_F",[2.25586,7.05273,0],25.5532],
  161. ["FlexibleTank_01_forest_F",[-5.65625,1.40625,0],0],
  162. ["Land_PlasticCase_01_large_F",[4.05664,3.0957,0],291.761],
  163. ["Flag_ARMEX_F",[-5.03809,-3.10938,0],180],
  164. ["Land_PaperBox_open_full_F",[3.4707,5.66992,0],-66.7469],
  165. ["Land_PaperBox_open_empty_F",[4.58105,4.24219,0],23.4405],
  166. ["Land_ScrapHeap_1_F",[-1.34961,3.19141,0],-91.183],
  167. [(["Land_HelipadCivil_F","Land_HelipadCircle_F","Land_HelipadEmpty_F","Land_HelipadSquare_F","Land_JumpTarget_F"]call BIS_fnc_selectRandom),[-0.304688,-22.9434,0],0],
  168. ["SignAd_Sponsor_F",[-7.05371,-3.66797,0],-31.456],
  169. ["Land_Canteen_F",[-2.36914,9.56641,0],0],
  170. ["Land_FireExtinguisher_F",[-5.31934,0.582031,0],0],
  171. ["Land_Laptop_F",[-4.60547,8.95117,0],-129.859],
  172. [(["CamoNet_INDP_big_F","CamoNet_OPFOR_big_F","CamoNet_BLUFOR_big_F"]call BIS_fnc_selectRandom),[-0.75,4.9082,0],0]
  173. ],
  174. [-90,90,
  175. ["Flag_ARMEX_F",[9.69922,5,0],209.0909],
  176. ["CamoNet_BLUFOR_open_Curator_F",[2.09961,1.09961,0],209.0909],
  177. ["Land_Timbers_F",[1.69922,-4.2998,0],-122.6364],
  178. ["Land_IronPipes_F",[-3,0.0996094,0],-75.454],
  179. ["Land_FieldToilet_F",[-4.30078,-5.40039,0],28.273],
  180. ["Land_GasTank_02_F",[2.09961,-2.7998,0],209.0909],
  181. ["Land_WorkStand_F",[1.5,1.59961,0],176.0909],
  182. ["Land_Pallet_F",[7.7998,4.7998,0],209.0909],
  183. ["Land_Pallets_F",[-3.40039,4.09961,0],-59.545],
  184. ["Land_Pallets_stack_F",[9.89941,0.399414,0],-146.364],
  185. ["Land_Pipes_small_F",[-1.40039,4.89941,0],-90.454],
  186. ["Land_WheelCart_F",[10.0996,3.2002,0],-208.182],
  187. ["Land_Workbench_01_F",[-0.100586,178.60059,0],25],
  188. ["Land_Bricks_V4_F",[7.39941,-1.7002,0],172.2727],
  189. ["Land_CampingChair_V2_F",[5.09961,179.7002,0],-151.364],
  190. ["Land_CampingTable_small_F",[4.89941,178.60059,0],-153.636],
  191. ["Land_WoodenLog_F",[6,8.7998,0],209.0909],
  192. ["Land_Campfire_F",[4.59961,8.39941,0],209.0909],
  193. ["Land_WoodenLog_F",[4.7998,6.2002,0],209.0909],
  194. ["Land_WoodenLog_F",[8.2998,4.89941,0],209.0909],
  195. ["Land_WoodenLog_F",[7.39941,4.39941,0],209.0909],
  196. ["Land_TentA_F",[0.799805,8.59961,0],-99.0911],
  197. [(["Land_HelipadCivil_F","Land_HelipadCircle_F","Land_HelipadEmpty_F","Land_HelipadSquare_F","Land_JumpTarget_F"]call BIS_fnc_selectRandom),[18.8994,-2.90039,0],209.0909],
  198. ["SignAd_Sponsor_F",[0.199219,4.5,0],-75.4541]
  199. ],
  200. [0,-19.430197,
  201. ["Land_CampingTable_F",[-0.0771484,0.853516,0],160.272,1,0],
  202. ["Land_CampingChair_V2_F",[0.731445,-1.44629,1.90735e-005],160.679],
  203. ["CargoNet_01_box_F",[-1.42773,-1.71387,-3.8147e-006],2.04104],
  204. ["Land_CargoBox_V1_F",[-3.02148,0.523438,0.0305347],6.5862],
  205. ["Land_WoodenLog_F",[3.06445,0.310547,1.33514e-005],359.99],
  206. ["CargoNet_01_barrels_F",[-0.617188,-3.64746,0],359.999],
  207. ["Land_Bricks_V4_F",[3.28223,1.85352,0],77.4211],
  208. ["Land_Sleeping_bag_F",[3.62402,-2.26758,-5.72205e-005],166.708],
  209. ["Land_Pillow_camouflage_F",[3.5332,-2.44238,-0.0296116],0.0385798],
  210. ["Land_WoodPile_F",[3.03516,3.63184,-3.8147e-006],352.152],
  211. ["Land_Cargo40_blue_F",[-4.07617,-3.80273,0],245.36],
  212. ["Land_TentA_F",[4.08887,-4.2002,-1.90735e-006],164.006],
  213. ["O_CargoNet_01_ammo_F",[0.181641,-5.96875,0],72.5656],
  214. ["Land_Cargo40_brick_red_F",[6.0332,-0.418945,1.90735e-006],256.356],
  215. ["SignAd_Sponsor_F",[-6.72363,1.97559,-2.67029e-005],155.599],
  216. ["SignAd_Sponsor_F",[4.4834,5.66699,0.000146866],168.142],
  217. ["Land_Campfire_F",[-2.51953,6.96484,-9.53674e-006],0],
  218. ["Flag_ARMEX_F",[5.57227,-5.44141,-1.14441e-005],74.6117],
  219. ["Land_HBarrierTower_F",[3.19043,-8.56348,7.62939e-006],341.69],
  220. ["Land_HBarrier_5_F",[-11.4238,6.97852,0.00966454],81.4106],
  221. ["Land_HBarrier_5_F",[4.87793,12.3633,0.00466537],51.4648],
  222. ["Land_Cargo40_military_green_F",[-4.41699,12.2959,0.00237656],339.806],
  223. [(["Land_HelipadCivil_F","Land_HelipadCircle_F","Land_HelipadEmpty_F","Land_HelipadSquare_F","Land_JumpTarget_F"]call BIS_fnc_selectRandom),[-10.749,30.5313,6.67572e-005],339.294]
  224. ],
  225. [0,0,
  226. ["Land_CncShelter_F",[-0.046875,0.580078,1.90735e-006],357.404],
  227. ["Land_CampingChair_V1_F",[0.0585938,-0.673828,-3.8147e-006],178.509],
  228. ["Land_Ammobox_rounds_F",[-0.632813,-0.664063,3.05176e-005],0],
  229. ["Land_CashDesk_F",[0.000976563,1.01563,-9.53674e-006],176.522],
  230. ["Land_HBarrierWall_corridor_F",[0.0253906,-1.33398,-3.8147e-006],268.766],
  231. ["Land_Money_F",[0.59082,-1.40234,1.90735e-006],0],
  232. ["Box_IND_WpsLaunch_F",[2.66504,-0.130859,0.000112534],263.01],
  233. ["Land_HBarrierBig_F",[0.0957031,-3.3418,-1.90735e-006],356.696],
  234. ["Land_PartyTent_01_F",[-1.54102,4.25195,-0.283783],356.027],
  235. ["Land_TentA_F",[-4.65137,1.9707,-1.14441e-005],175.654],
  236. ["Land_HBarrierWall_corner_F",[5.36816,-1.13672,5.53131e-005],88.9725],
  237. ["Land_ScrapHeap_1_F",[-2.25781,5.82422,0],336.275],
  238. ["Land_HBarrierWall_corner_F",[-5.72461,-2.73242,-4.19617e-005],175.661],
  239. ["Land_HBarrierWall6_F",[6.2002,5.00781,-3.8147e-006],88.8191],
  240. ["I_CargoNet_01_ammo_F",[3.29395,6.26758,-1.90735e-006],354.135],
  241. ["Land_HBarrierWall6_F",[-7.81152,2.37109,-5.14984e-005],268.762],
  242. ["I_supplyCrate_F",[-5.28125,5.77148,-1.52588e-005],86.827],
  243. ["Land_WoodenBox_F",[2.86914,9.89453,1.90735e-006],268.489],
  244. ["Flag_ARMEX_F",[3.62207,9.92188,-3.8147e-005],0],
  245. ["Land_GasTank_01_yellow_F",[-5.97559,9.41016,-1.33514e-005],0],
  246. ["Land_GasTank_01_yellow_F",[-6.07129,9.91406,-4.3869e-005],0],
  247. ["Land_HBarrierWall4_F",[-7.09766,9.25195,-4.57764e-005],267.767],
  248. ["Land_CargoBox_V1_F",[3.01172,12.1934,-5.72205e-006],0],
  249. ["Land_HBarrierWall6_F",[6.0332,12.0391,-8.2016e-005],92.5993],
  250. ["Land_Campfire_F",[-1.17676,12.8457,-3.8147e-006],0],
  251. ["Land_CncBarrier_stripes_F",[3.9502,18.3145,5.72205e-006],46.6013],
  252. ["SignAd_Sponsor_F",[1.74609,19.457,0],268.517],
  253. ["Land_HBarrierTower_F",[-2.02734,19.7676,1.90735e-006],177.085],
  254. ["SignAd_Sponsor_F",[-5.6748,19.0156,1.33514e-005],83.7269],
  255. ["Land_Crash_barrier_F",[-8.78418,21.2773,-1.90735e-006],292.427],
  256. [(["Land_HelipadCivil_F","Land_HelipadCircle_F","Land_HelipadEmpty_F","Land_HelipadSquare_F","Land_JumpTarget_F"]call BIS_fnc_selectRandom),[-2.83496,39.7852,-0.000118256],359.41]
  257. ],
  258. [0,0,
  259. ["Flag_ARMEX_F",[-0.788086,-1.14063,0],0],
  260. ["Land_WoodenTable_large_F",[-0.917969,1.29883,-0.0575085],69.0909],
  261. ["Land_Ancient_Wall_8m_F",[2.67578,-0.420898,-0.630144],336.364],
  262. ["Land_Ancient_Wall_4m_F",[-2.31738,0.493164,-0.719454],251.818],
  263. ["Land_Bench_F",[2.27148,1.33203,-0.0392952],359.091],
  264. ["SignAd_Sponsor_F",[-2.91699,-0.139648,-0.789555],72.7272],
  265. ["Land_BarrelWater_F",[-2.84766,3.59277,-0.0297241],0],
  266. ["Land_GarbageContainer_open_F",[1.98145,4.67383,-0.0621395],268.182],
  267. ["Land_Tyres_F",[5.16504,1.0127,-0.0753136],318.182],
  268. ["Land_Ancient_Wall_8m_F",[3.37598,3.1377,-0.0258389],89.5454],
  269. ["Land_GarbageWashingMachine_F",[5.55273,5.00879,-0.0555096],0],
  270. ["Land_Bricks_V1_F",[1.03613,7.59863,-0.0867004],3.63635],
  271. ["Land_Ancient_Wall_4m_F",[-0.470703,8.37695,-0.531187],309.091],
  272. ["Land_Bench_F",[-2.08203,7.82129,-0.0440636],39.0909],
  273. ["Land_Ancient_Wall_4m_F",[2.88281,8.50098,-0.338644],8.18182],
  274. [(["Land_HelipadCivil_F","Land_HelipadCircle_F","Land_HelipadEmpty_F","Land_HelipadSquare_F","Land_JumpTarget_F"]call BIS_fnc_selectRandom),[-10.7529,4.375,1.90735e-006],0]
  275. ]
  276. ]call BIS_fnc_selectRandom;
  277. _extra = _objects deleteAt 0;
  278. _randir = _randir + _extra;
  279. //creating trader
  280. _pos0 = [(_coords select 0),(_coords select 1),0];
  281. _unit = createAgent [_agent, _pos0, [], 0, "CAN_COLLIDE"];
  282. _unitdir = _objects deleteAt 0;
  283. _unit setDir (_randir+_unitdir);
  284. _unit setUnitAbility 0.60000002;
  285. _unit allowDammage false; _unit disableAI "FSM"; _unit disableAI "MOVE"; _unit disableAI "AUTOTARGET"; _unit disableAI "TARGET"; _unit setBehaviour "CARELESS"; _unit forceSpeed 0;_unit enableSimulation false;
  286. _unit switchMove "AmovPercMstpSrasWrflDnon_AmovPercMstpSnonWnonDnon";
  287. _unit setCaptive true;
  288. _obj = createVehicle ["Land_ClutterCutter_large_F", _pos0, [], 0, "CAN_COLLIDE"];
  289. _obj setPos _pos0;
  290. {
  291. _Dir = (_randir + (_x select 2));
  292. _newRelPos = [[[cos _randir, sin _randir],[-(sin _randir), cos _randir]], (_x select 1)] call _multiplyMatrixFunc;
  293. _pos = [(_coords select 0) + (_newRelPos select 0), (_coords select 1) + (_newRelPos select 1), 0];
  294. _obj = createVehicle [(_x select 0), _pos, [], 0, "CAN_COLLIDE"];
  295. _obj setDir _Dir;
  296. _obj setPos _pos;
  297. _obj allowDammage false;
  298. _obj enableSimulation false;
  299. _obj setVariable ["R3F_LOG_disabled", true, true];
  300. switch (_x select 0) do {
  301. case "Land_Ammobox_rounds_F":{clearBackpackCargoGlobal _obj;clearItemCargoGlobal _obj;clearMagazineCargoGlobal _obj;clearWeaponCargoGlobal _obj;};
  302. case "Box_IND_WpsLaunch_F":{clearBackpackCargoGlobal _obj;clearItemCargoGlobal _obj;clearMagazineCargoGlobal _obj;clearWeaponCargoGlobal _obj;};
  303. case "I_CargoNet_01_ammo_F":{clearBackpackCargoGlobal _obj;clearItemCargoGlobal _obj;clearMagazineCargoGlobal _obj;clearWeaponCargoGlobal _obj;};
  304. case "I_supplyCrate_F":{clearBackpackCargoGlobal _obj;clearItemCargoGlobal _obj;clearMagazineCargoGlobal _obj;clearWeaponCargoGlobal _obj;};
  305. case "O_CargoNet_01_ammo_F":{clearBackpackCargoGlobal _obj;clearItemCargoGlobal _obj;clearMagazineCargoGlobal _obj;clearWeaponCargoGlobal _obj;};
  306. case "Land_Campfire_F":{_obj = createVehicle ["Land_ClutterCutter_medium_F", _pos, [], 0, "CAN_COLLIDE"];_obj setPos _pos;};
  307. case "Land_Ground_sheet_blue_F":{_obj = createVehicle ["Land_ClutterCutter_large_F", _pos, [], 0, "CAN_COLLIDE"];_obj setPos _pos;};
  308. case "Flag_ARMEX_F":{_obj setFlagTexture "trader\dkflagpole.jpg";};
  309. case "Land_HelipadEmpty_F":{_obj = createVehicle ["Land_ClutterCutter_large_F", _pos, [], 0, "CAN_COLLIDE"];_obj setPos _pos;};
  310. case "SignAd_Sponsor_F":{_obj setObjectTextureGlobal [0, "trader\trader.jpg"];};//apply diffrent texture to the sign at some point
  311. };
  312. }forEach _objects;
  313. diag_log "[HSBlackmarket]: HSBlackmarket Creating a Marker";
  314. _marker = createMarker [format["HSBlackmarket_%1",_i], _coords];
  315. _marker setMarkerShape "ICON";
  316. _marker setMarkerType "hd_dot"; // "hd_pickup"
  317. _marker setMarkerText _markertext;
  318. _marker setMarkerColor "ColorWEST";
  319. _units pushBack _unit;
  320. };
  321. {
  322. _pos = _x select 0;
  323. _dir = _x select 1;
  324. _createmarker = if(count _x > 2)then{_x select 2}else{true};
  325. diag_log format["[HSBlackmarket]: HSBlackmarket Creating a Static trader @ (%2) %1",_pos,mapGridPosition _pos];
  326. _unit = createAgent [_agent, _pos, [], 0, "CAN_COLLIDE"];
  327. _unit setDir _dir;
  328. if(surfaceIsWater _pos)then{
  329. _unit setPosASL _pos;
  330. }else{
  331. _unit setPosATL _pos;
  332. };
  333. _unit setUnitAbility 0.60000002;
  334. _unit allowDammage false; _unit disableAI "FSM"; _unit disableAI "MOVE"; _unit disableAI "AUTOTARGET"; _unit disableAI "TARGET"; _unit setBehaviour "CARELESS"; _unit forceSpeed 0;_unit enableSimulation false;
  335. _unit switchMove "AmovPercMstpSrasWrflDnon_AmovPercMstpSnonWnonDnon";
  336. _unit setCaptive true;
  337. _units pushBack _unit;
  338. if(_createmarker)then{
  339. diag_log "[HSBlackmarket]: HSBlackmarket Creating a Marker";
  340. _marker = createMarker [format["HSBlackmarket_%1",(count _units)], _pos];
  341. _marker setMarkerShape "ICON";
  342. _marker setMarkerType "hd_dot";
  343. _marker setMarkerText _markertext;
  344. _marker setMarkerColor "ColorWEST";
  345. };
  346. if(count _x > 3)then{
  347. _objs = _x select 3;
  348. {
  349. _objtype = _x select 0;
  350. _objpos = _x select 1;
  351. _objdir = _x select 2;
  352. _obj = createVehicle [_objtype, _objpos, [], 0, "CAN_COLLIDE"];
  353. _obj setDir _objdir;
  354. if(surfaceIsWater _objpos)then{
  355. _obj setPosASL _objpos;
  356. }else{
  357. _obj setPosATL _objpos;
  358. };
  359. _obj allowDammage false;
  360. _obj enableSimulation false;
  361. _obj setVariable ["R3F_LOG_disabled", true, true];
  362. }forEach _objs;
  363. };
  364. }forEach _staticCoords;
  365.  
  366. HSPV_HSBlackmarket = _units;
  367. publicVariable "HSPV_HSBlackmarket";
  368. diag_log "[HSBlackmarket] Server Done ...";
  369. };
  370.  
  371. // Client stuff...
  372. if(hasInterface)then{
  373. diag_log "[HSBlackmarket]: Client waiting for Trader ...";
  374. waitUntil {sleep 1;(!isNil "HSPV_HSBlackmarket")};
  375. {_x addAction ["<img size='1.5'image='\a3\Ui_f\data\gui\Rsc\RscDisplayArcadeMap\icon_layout_ca.paa'/> <t color='#0096ff'>HS Trader Menu</t>","trader\dummy.sqf",_x, -9, true, true, "", "_this distance _target < 5"];}forEach HSPV_HSBlackmarket;
  376. HSPV_HSBlackmarket = nil;
  377. call compile preprocessFileLineNumbers "trader\tradermenu.sqf";
  378. diag_log "[HSBlackmarket]: Client Done ...";
  379. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement