Advertisement
Guest User

Untitled

a guest
May 31st, 2013
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.37 KB | None | 0 0
  1. waituntil {!isnil "bis_fnc_init"};
  2.  
  3. BIS_MPF_remoteExecutionServer = {
  4. if ((_this select 1) select 2 == "JIPrequest") then {
  5. [nil,(_this select 1) select 0,"loc",rJIPEXEC,[any,any,"per","execVM","ca\Modules\Functions\init.sqf"]] call RE;
  6. };
  7. };
  8.  
  9. BIS_Effects_Burn = {};
  10. server_playerLogin = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerLogin.sqf";
  11. server_playerSetup = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerSetup.sqf";
  12. server_onPlayerDisconnect = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_onPlayerDisconnect.sqf";
  13. server_updateObject = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updateObject.sqf";
  14. server_playerDied = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerDied.sqf";
  15. server_publishObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishObject.sqf"; //Creates the object in DB
  16. server_deleteObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_deleteObj.sqf"; //Removes the object from the DB
  17. server_publishVeh = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle.sqf"; // Custom to add vehicles
  18. server_publishVeh2 = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle2.sqf"; // Custom to add vehicles
  19. server_tradeObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_tradeObject.sqf";
  20. server_traders = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_traders.sqf";
  21. server_playerSync = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerSync.sqf";
  22. zombie_findOwner = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\zombie_findOwner.sqf";
  23. server_updateNearbyObjects = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updateNearbyObjects.sqf";
  24. server_spawnCrashSite = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnCrashSite.sqf";
  25. server_handleZedSpawn = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_handleZedSpawn.sqf";
  26.  
  27. fnc_plyrHit = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\fnc_plyrHit.sqf";
  28. server_deaths = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerDeaths.sqf";
  29.  
  30.  
  31. vehicle_handleInteract = {
  32. private["_object"];
  33. _object = _this select 0;
  34. needUpdate_objects = needUpdate_objects - [_object];
  35. [_object, "all"] call server_updateObject;
  36. };
  37.  
  38. vehicle_handleServerKilled = {
  39. private["_unit","_killer"];
  40. _unit = _this select 0;
  41. _killer = _this select 1;
  42.  
  43. [_unit, "killed"] call server_updateObject;
  44.  
  45. _unit removeAllMPEventHandlers "MPKilled";
  46. _unit removeAllEventHandlers "Killed";
  47. _unit removeAllEventHandlers "HandleDamage";
  48. _unit removeAllEventHandlers "GetIn";
  49. _unit removeAllEventHandlers "GetOut";
  50. };
  51.  
  52. object_handleServerKilled = {
  53. private["_unit","_objectID","_objectUID"];
  54. _unit = _this select 0;
  55.  
  56. _objectID = _unit getVariable ["ObjectID","0"];
  57. _objectUID = _unit getVariable ["ObjectUID","0"];
  58.  
  59. [_objectID,_objectUID] call server_deleteObj;
  60.  
  61. _unit removeAllMPEventHandlers "MPKilled";
  62. _unit removeAllEventHandlers "Killed";
  63. _unit removeAllEventHandlers "HandleDamage";
  64. _unit removeAllEventHandlers "GetIn";
  65. _unit removeAllEventHandlers "GetOut";
  66. };
  67.  
  68. check_publishobject = {
  69. private["_allowed","_object","_playername"];
  70.  
  71. _object = _this select 0;
  72. _playername = _this select 1;
  73.  
  74. _allowed = false;
  75.  
  76. diag_log format ["DEBUG: Checking if Object: %1 is allowed published by %2", _object, _playername];
  77.  
  78. if ((typeOf _object) in _allowedObjects || (typeOf _object) in allbuildables_class) then {
  79. diag_log format ["DEBUG: Object: %1 published by %2 is Safe",_object, _playername];
  80. _allowed = true;
  81. };
  82. _allowed
  83. };
  84.  
  85. //event Handlers
  86. eh_localCleanup = {
  87. private ["_object"];
  88. _object = _this select 0;
  89. _object addEventHandler ["local", {
  90. if(_this select 1) then {
  91. private["_type","_unit"];
  92. _unit = _this select 0;
  93. _type = typeOf _unit;
  94. _myGroupUnit = group _unit;
  95. _unit removeAllMPEventHandlers "mpkilled";
  96. _unit removeAllMPEventHandlers "mphit";
  97. _unit removeAllMPEventHandlers "mprespawn";
  98. _unit removeAllEventHandlers "FiredNear";
  99. _unit removeAllEventHandlers "HandleDamage";
  100. _unit removeAllEventHandlers "Killed";
  101. _unit removeAllEventHandlers "Fired";
  102. _unit removeAllEventHandlers "GetOut";
  103. _unit removeAllEventHandlers "GetIn";
  104. _unit removeAllEventHandlers "Local";
  105. clearVehicleInit _unit;
  106. deleteVehicle _unit;
  107. deleteGroup _myGroupUnit;
  108. _unit = nil;
  109. diag_log ("CLEANUP: DELETED A " + str(_type) );
  110. };
  111. }];
  112. };
  113.  
  114. server_hiveWrite = {
  115. private["_data"];
  116. //diag_log ("ATTEMPT WRITE: " + _this);
  117. _data = "HiveExt" callExtension _this;
  118. //diag_log ("WRITE: " +str(_data));
  119. };
  120.  
  121. server_hiveReadWrite = {
  122. private["_key","_resultArray","_data"];
  123. _key = _this;
  124. //diag_log ("ATTEMPT READ/WRITE: " + _key);
  125. _data = "HiveExt" callExtension _key;
  126. //diag_log ("READ/WRITE: " +str(_data));
  127. _resultArray = call compile format ["%1",_data];
  128. _resultArray
  129. };
  130.  
  131. server_characterSync = {
  132. private ["_characterID","_playerPos","_playerGear","_playerBackp","_medical","_currentState","_currentModel","_key"];
  133. _characterID = _this select 0;
  134. _playerPos = _this select 1;
  135. _playerGear = _this select 2;
  136. _playerBackp = _this select 3;
  137. _medical = _this select 4;
  138. _currentState = _this select 5;
  139. _currentModel = _this select 6;
  140.  
  141. _key = format["CHILD:201:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:",_characterID,_playerPos,_playerGear,_playerBackp,_medical,false,false,0,0,0,0,_currentState,0,0,_currentModel,0];
  142. //diag_log ("HIVE: WRITE: "+ str(_key) + " / " + _characterID);
  143. _key call server_hiveWrite;
  144. };
  145.  
  146. //onPlayerConnected "[_uid,_name] spawn server_onPlayerConnect;";
  147. onPlayerDisconnected "[_uid,_name] call server_onPlayerDisconnect;";
  148.  
  149. // Setup globals allow overwrite from init.sqf
  150. if(isnil "dayz_MapArea") then {
  151. dayz_MapArea = 10000;
  152. };
  153. if(isnil "DynamicVehicleArea") then {
  154. DynamicVehicleArea = dayz_MapArea / 2;
  155. };
  156.  
  157. // Get all buildings and roads only once TODO: set variables to nil after done if nessicary
  158. MarkerPosition = getMarkerPos "center";
  159. RoadList = MarkerPosition nearRoads DynamicVehicleArea;
  160. BuildingList = MarkerPosition nearObjects ["House",DynamicVehicleArea];
  161.  
  162. spawn_vehicles = {
  163. private ["_weights","_isOverLimit","_isAbort","_counter","_index","_vehicle","_velimit","_qty","_isAir","_isShip","_position","_dir","_istoomany","_veh","_objPosition","_marker","_iClass","_itemTypes","_cntWeights","_itemType","_num","_allCfgLoots"];
  164.  
  165. if (isDedicated) then {
  166. waituntil {!isnil "fnc_buildWeightedArray"};
  167.  
  168. _isOverLimit = true;
  169. _isAbort = false;
  170. _counter = 0;
  171. while {_isOverLimit} do {
  172.  
  173. waitUntil{!isNil "BIS_fnc_selectRandom"};
  174. _index = AllowedVehiclesList call BIS_fnc_selectRandom;
  175.  
  176. _vehicle = _index select 0;
  177. _velimit = _index select 1;
  178.  
  179. _qty = {_x == _vehicle} count serverVehicleCounter;
  180.  
  181. // If under limit allow to proceed
  182. if(_qty <= _velimit) then {
  183. _isOverLimit = false;
  184. };
  185.  
  186. // counter to stop after 5 attempts
  187. _counter = _counter + 1;
  188.  
  189. if(_counter >= 5) then {
  190. _isOverLimit = false;
  191. _isAbort = true;
  192. };
  193. };
  194.  
  195. if (_isAbort) then {
  196. diag_log("DEBUG: unable to find sutable vehicle to spawn");
  197. } else {
  198.  
  199. // add vehicle to counter for next pass
  200. serverVehicleCounter set [count serverVehicleCounter,_vehicle];
  201.  
  202. // Find Vehicle Type to better control spawns
  203. _isAir = _vehicle isKindOf "Air";
  204. _isShip = _vehicle isKindOf "Ship";
  205.  
  206. if(_isShip || _isAir) then {
  207. if(_isShip) then {
  208. // Spawn anywhere on coast on water
  209. waitUntil{!isNil "BIS_fnc_selectRandom"};
  210. _position = [MarkerPosition,0,DynamicVehicleArea,10,1,2000,1] call BIS_fnc_findSafePos;
  211. //diag_log("DEBUG: spawning boat near coast " + str(_position));
  212. } else {
  213. // Spawn air anywhere that is flat
  214. waitUntil{!isNil "BIS_fnc_selectRandom"};
  215. _position = [MarkerPosition,0,DynamicVehicleArea,10,0,2000,0] call BIS_fnc_findSafePos;
  216. //diag_log("DEBUG: spawning air anywhere flat " + str(_position));
  217. };
  218.  
  219.  
  220. } else {
  221. // Spawn around buildings and 50% near roads
  222. if((random 1) > 0.5) then {
  223.  
  224. waitUntil{!isNil "BIS_fnc_selectRandom"};
  225. _position = RoadList call BIS_fnc_selectRandom;
  226.  
  227. _position = _position modelToWorld [0,0,0];
  228.  
  229. waitUntil{!isNil "BIS_fnc_findSafePos"};
  230. _position = [_position,0,10,10,0,2000,0] call BIS_fnc_findSafePos;
  231.  
  232. //diag_log("DEBUG: spawning near road " + str(_position));
  233.  
  234. } else {
  235.  
  236. waitUntil{!isNil "BIS_fnc_selectRandom"};
  237. _position = BuildingList call BIS_fnc_selectRandom;
  238.  
  239. _position = _position modelToWorld [0,0,0];
  240.  
  241. waitUntil{!isNil "BIS_fnc_findSafePos"};
  242. _position = [_position,0,40,5,0,2000,0] call BIS_fnc_findSafePos;
  243.  
  244. //diag_log("DEBUG: spawning around buildings " + str(_position));
  245.  
  246. };
  247. };
  248. // only proceed if two params otherwise BIS_fnc_findSafePos failed and may spawn in air
  249. if ((count _position) == 2) then {
  250.  
  251. _dir = round(random 180);
  252.  
  253. _istoomany = _position nearObjects ["AllVehicles",50];
  254. if((count _istoomany) > 0) exitWith { diag_log("DEBUG: Too many vehicles at " + str(_position)); };
  255.  
  256. //place vehicle
  257. _veh = createVehicle [_vehicle, _position, [], 0, "CAN_COLLIDE"];
  258. _veh setdir _dir;
  259. _veh setpos _position;
  260.  
  261. if(DZEdebug) then {
  262. _marker = createMarker [str(_position) , _position];
  263. _marker setMarkerShape "ICON";
  264. _marker setMarkerType "DOT";
  265. _marker setMarkerText _vehicle;
  266. };
  267.  
  268. // Get position with ground
  269. _objPosition = getPosATL _veh;
  270.  
  271. clearWeaponCargoGlobal _veh;
  272. clearMagazineCargoGlobal _veh;
  273.  
  274. // Add 0-3 loots to vehicle using random cfgloots
  275. _num = floor(random 4);
  276. _allCfgLoots = ["trash","civilian","food","generic","medical","military","policeman","hunter","worker","clothes","militaryclothes","specialclothes","trash"];
  277.  
  278.  
  279. diag_log("DEBUG: spawing loot inside vehicle " + str(_allCfgLoots));
  280.  
  281. for "_x" from 1 to _num do {
  282. _iClass = _allCfgLoots call BIS_fnc_selectRandom;
  283.  
  284. _itemTypes = [] + ((getArray (configFile >> "cfgLoot" >> _iClass)) select 0);
  285. _index = dayz_CLBase find _iClass;
  286. _weights = dayz_CLChances select _index;
  287. _cntWeights = count _weights;
  288.  
  289. _index = floor(random _cntWeights);
  290. _index = _weights select _index;
  291. _itemType = _itemTypes select _index;
  292. _veh addMagazineCargoGlobal [_itemType,1];
  293. diag_log("DEBUG: spawed loot inside vehicle " + str(_itemType));
  294. };
  295.  
  296. [_veh,[_dir,_objPosition],_vehicle,true,"0"] call server_publishVeh;
  297. };
  298. };
  299. };
  300. };
  301.  
  302. spawn_roadblocks = {
  303. private ["_position","_veh","_num","_config","_itemType","_itemChance","_weights","_index","_iArray","_istoomany","_marker","_spawnloot","_nearby","_spawnveh","_WreckList"];
  304. _WreckList = ["SKODAWreck","HMMWVWreck","UralWreck","datsun01Wreck","hiluxWreck","datsun02Wreck","UAZWreck","Land_Misc_Garb_Heap_EP1","Fort_Barricade_EP1","Rubbish2"];
  305.  
  306. waitUntil{!isNil "BIS_fnc_selectRandom"};
  307. if (isDedicated) then {
  308.  
  309. _position = RoadList call BIS_fnc_selectRandom;
  310.  
  311. _position = _position modelToWorld [0,0,0];
  312.  
  313. waitUntil{!isNil "BIS_fnc_findSafePos"};
  314. _position = [_position,0,10,5,0,2000,0] call BIS_fnc_findSafePos;
  315.  
  316. if ((count _position) == 2) then {
  317. // Get position with ground
  318.  
  319. _istoomany = _position nearObjects ["All",5];
  320.  
  321. if((count _istoomany) > 0) exitWith { diag_log("DEBUG: Too many at " + str(_position)); };
  322.  
  323. if(DZEdebug) then {
  324. _marker = createMarker [str(_position) , _position];
  325. _marker setMarkerShape "ICON";
  326. _marker setMarkerType "DOT";
  327. };
  328.  
  329. waitUntil{!isNil "BIS_fnc_selectRandom"};
  330. _spawnveh = _WreckList call BIS_fnc_selectRandom;
  331. _spawnloot = "DynamicDebris";
  332.  
  333. if((_spawnveh == "HMMWVWreck") or (_spawnveh == "UralWreck") or (_spawnveh == "UAZWreck")) then {
  334. _spawnloot = "DynamicDebrisMilitary";
  335. };
  336.  
  337. diag_log("DEBUG: Spawning a crashed " + _spawnveh + " with " + _spawnloot + " at " + str(_position));
  338. _veh = createVehicle [_spawnveh,_position, [], 0, "CAN_COLLIDE"];
  339. _veh enableSimulation false;
  340.  
  341. // Randomize placement a bit
  342. _veh setDir round(random 360);
  343. _veh setpos _position;
  344.  
  345. dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_veh];
  346. _veh setVariable ["ObjectID",1,true];
  347.  
  348. _num = round(random 3);
  349. _config = configFile >> "CfgBuildingLoot" >> _spawnloot;
  350. _itemType = [] + getArray (_config >> "itemType");
  351. _itemChance = [] + getArray (_config >> "itemChance");
  352.  
  353. waituntil {!isnil "fnc_buildWeightedArray"};
  354.  
  355. _weights = [];
  356. _weights = [_itemType,_itemChance] call fnc_buildWeightedArray;
  357. for "_x" from 1 to _num do {
  358. //create loot
  359. _index = _weights call BIS_fnc_selectRandom;
  360. sleep 1;
  361. if (count _itemType > _index) then {
  362. _iArray = _itemType select _index;
  363. _iArray set [2,_position];
  364. _iArray set [3,5];
  365. _iArray call spawn_loot;
  366. _nearby = _position nearObjects ["WeaponHolder",20];
  367. {
  368. _x setVariable ["permaLoot",true];
  369. } forEach _nearBy;
  370. };
  371. };
  372. };
  373.  
  374. };
  375.  
  376. };
  377.  
  378. if(isnil "DynamicVehicleDamageLow") then {
  379. DynamicVehicleDamageLow = 0;
  380. };
  381. if(isnil "DynamicVehicleDamageHigh") then {
  382. DynamicVehicleDamageHigh = 100;
  383. };
  384.  
  385. if(isnil "DynamicVehicleFuelLow") then {
  386. DynamicVehicleFuelLow = 0;
  387. };
  388. if(isnil "DynamicVehicleFuelHigh") then {
  389. DynamicVehicleFuelHigh = 100;
  390. };
  391.  
  392. // Damage generator function
  393. generate_new_damage = {
  394. private ["_damage"];
  395. _damage = ((random(DynamicVehicleDamageHigh-DynamicVehicleDamageLow))+DynamicVehicleDamageLow) / 100;
  396. _damage;
  397. };
  398.  
  399. // Damage generator fuction
  400. generate_exp_damage = {
  401. private ["_damage"];
  402. _damage = ((random(DynamicVehicleDamageHigh-DynamicVehicleDamageLow))+DynamicVehicleDamageLow) / 100;
  403.  
  404. // limit this to 85% since vehicle would blow up otherwise.
  405. //if(_damage >= 0.85) then {
  406. // _damage = 0.85;
  407. //};
  408. _damage;
  409. };
  410.  
  411. server_getDiff = {
  412. private["_variable","_object","_vNew","_vOld","_result"];
  413. _variable = _this select 0;
  414. _object = _this select 1;
  415. _vNew = _object getVariable[_variable,0];
  416. _vOld = _object getVariable[(_variable + "_CHK"),_vNew];
  417. _result = 0;
  418. if (_vNew < _vOld) then {
  419. //JIP issues
  420. _vNew = _vNew + _vOld;
  421. _object getVariable[(_variable + "_CHK"),_vNew];
  422. } else {
  423. _result = _vNew - _vOld;
  424. _object setVariable[(_variable + "_CHK"),_vNew];
  425. };
  426. _result
  427. };
  428.  
  429. server_getDiff2 = {
  430. private["_variable","_object","_vNew","_vOld","_result"];
  431. _variable = _this select 0;
  432. _object = _this select 1;
  433. _vNew = _object getVariable[_variable,0];
  434. _vOld = _object getVariable[(_variable + "_CHK"),_vNew];
  435. _result = _vNew - _vOld;
  436. _object setVariable[(_variable + "_CHK"),_vNew];
  437. _result
  438. };
  439.  
  440. dayz_objectUID = {
  441. private["_position","_dir","_key","_object"];
  442. _object = _this;
  443. _position = getPosATL _object;
  444. _dir = direction _object;
  445. _key = [_dir,_position] call dayz_objectUID2;
  446. _key
  447. };
  448.  
  449. dayz_objectUID2 = {
  450. private["_position","_dir","_key"];
  451. _dir = _this select 0;
  452. _key = "";
  453. _position = _this select 1;
  454. {
  455. _x = _x * 10;
  456. if ( _x < 0 ) then { _x = _x * -10 };
  457. _key = _key + str(round(_x));
  458. } forEach _position;
  459. _key = _key + str(round(_dir));
  460. _key
  461. };
  462.  
  463. dayz_objectUID3 = {
  464. private["_position","_dir","_key"];
  465. _dir = _this select 0;
  466. _key = "";
  467. _position = _this select 1;
  468. {
  469. _x = _x * 10;
  470. if ( _x < 0 ) then { _x = _x * -10 };
  471. _key = _key + str(round(_x));
  472. } forEach _position;
  473. _key = _key + str(round(_dir + time));
  474. _key
  475. };
  476.  
  477. dayz_recordLogin = {
  478. private["_key"];
  479. _key = format["CHILD:103:%1:%2:%3:",_this select 0,_this select 1,_this select 2];
  480. _key call server_hiveWrite;
  481. };
  482. // ### COPY START
  483. // BASE BUILDING 1.2 Build Array
  484. build_baseBuilding_arrays = {
  485.  
  486. // ################################### BUILD LIST ARRAY SERVER SIDE ######################################## START
  487. /*
  488. Build list by Daimyo for SERVER side
  489. Add and remove recipes, Objects(classnames), requirments to build, and town restrictions + extras
  490. This method is used because we are referencing magazines from player inventory as buildables.
  491. Main array (_buildlist) consist of 34 arrays within. These arrays contains parameters for player_build.sqf
  492. From left to right, each array contains 3 elements, 1st: Recipe Array, 2nd: "Classname", 3rd: Requirements array.
  493. Check comments below for more info on parameters
  494. */
  495. private["_isDestructable","_classname","_isSimulated","_disableSims","_objectSims","_objectSim","_requirements","_isStructure","_structure","_wallType","_removable","_buildlist","_build_townsrestrict"];
  496. // Count is 34
  497. // Info on Parameters (Copy and Paste to add more recipes and their requirments!):
  498. //[TankTrap, SandBags, Wires, Logs, Scrap Metal, Grenades], "Classname", [_attachCoords, _startPos, _modDir, _toolBox, _eTool, _medWait, _longWait, _inBuilding, _roadAllowed, _inTown, _removable, _isStructure, _isSimulated, _isDestructable];
  499. _buildlist = [
  500. [[0, 1, 0, 0, 1, 1], "Grave", [[0,2.5,.1],[0,2,0], 0, true, true, true, false, false, true, true, false, false, true, false]],//Booby Traps --1
  501. [[2, 0, 0, 3, 1, 0], "Concrete_Wall_EP1", [[0,5,1.75],[0,2,0], 0, true, false, true, false, false, true, false, false, false, true, false]],//Gate Concrete Wall --2
  502. [[1, 0, 1, 0, 1, 0], "Infostand_2_EP1", [[0,2.5,.6],[0,2,0], 0, true, false, true, false, false, false, false, false, false, false, false]],//Gate Panel w/ KeyPad --3
  503. [[3, 3, 2, 2, 0, 0], "WarfareBDepot", [[0,18,2], [0,15,0], 90, true, true, false, true, false, false, false, false, true, true, false]],//WarfareBDepot --4
  504. [[4, 1, 2, 2, 0, 0], "Base_WarfareBBarrier10xTall", [[0,10,1], [0,10,0], 0, true, true, false, true, false, false, false, false, false, true, false]],//Base_WarfareBBarrier10xTall --5
  505. [[2, 1, 2, 1, 0, 0], "WarfareBCamp", [[0,12,1], [0,10,0], 0, true, true, false, true, false, false, false, false, true, true, false]],//WarfareBCamp --6
  506. [[2, 1, 1, 1, 0, 0], "Base_WarfareBBarrier10x", [[0,10,.6], [0,10,0], 0, true, true, false, true, false, false, false, false, false, true, false]],//Base_WarfareBBarrier10x --7
  507. [[2, 2, 0, 2, 0, 0], "Land_fortified_nest_big", [[0,12,1], [2,8,0], 180,true, true, false, true, false, false, false, false, true, true, false]],//Land_fortified_nest_big --8
  508. [[2, 1, 2, 2, 0, 0], "Land_Fort_Watchtower", [[0,10,2.2],[0,8,0], 90, true, true, false, true, false, false, false, false, true, true, false]],//Land_Fort_Watchtower --9
  509. [[4, 1, 1, 3, 0, 0], "Land_fort_rampart_EP1", [[0,7,.2], [0,8,0], 0, true, true, false, true, false, false, false, true, false, true, false]],//Land_fort_rampart_EP1 --10
  510. [[2, 1, 1, 0, 0, 0], "Land_HBarrier_large", [[0,7,1], [0,4,0], 0, true, true, true, false, false, false, false, false, false, true, false]],//Land_HBarrier_large --11
  511. [[2, 1, 0, 1, 0, 0], "Land_fortified_nest_small", [[0,7,1], [0,3,0], 90, true, true, true, false, false, false, false, false, true, true, false]],//Land_fortified_nest_small --12
  512. [[0, 1, 1, 0, 0, 0], "Land_BagFenceRound", [[0,4,.5], [0,2,0], 180,true, true, false, false, false, false, false, true, false, true, false]],//Land_BagFenceRound --13
  513. [[0, 1, 0, 0, 0, 0], "Land_fort_bagfence_long", [[0,4,.3], [0,2,0], 0, true, true, false, false, false, false, false, true, false, true, false]],//Land_fort_bagfence_long --14
  514. [[6, 0, 0, 0, 2, 0], "Land_Misc_Cargo2E", [[0,7,2.6], [0,5,0], 90, true, false, false, true, false, false, false, false, false, true, false]],//Land_Misc_Cargo2E --15
  515. [[5, 0, 0, 0, 1, 0], "Misc_Cargo1Bo_military", [[0,7,1.3], [0,5,0], 90, true, false, false, true, false, false, false, false, false, true, false]],//Misc_Cargo1Bo_military --16
  516. [[3, 0, 0, 0, 1, 0], "Ins_WarfareBContructionSite", [[0,7,1.3], [0,5,0], 90, true, false, false, true, false, false, false, false, false, true, false]],//Ins_WarfareBContructionSite --17
  517. [[1, 1, 0, 2, 1, 0], "Land_pumpa", [[0,3,.4], [0,3,0], 0, true, true, true, false, false, false, false, true, false, true, false]],//Land_pumpa --18
  518. [[1, 0, 0, 0, 0, 0], "Land_CncBlock", [[0,3,.4], [0,2,0], 0, true, false, false, false, false, true, true, true, false, true, false]],//Land_CncBlock --19
  519. [[4, 0, 0, 0, 0, 0], "Hhedgehog_concrete", [[0,5,.6], [0,4,0], 0, true, true, false, true, false, true, false, false, false, true, false]],//Hhedgehog_concrete --20
  520. [[1, 0, 0, 0, 1, 0], "Misc_cargo_cont_small_EP1", [[0,5,1.3], [0,4,0], 90, true, false, false, false, false, false, false, true, false, true, false]],//Misc_cargo_cont_small_EP1 --21
  521. [[1, 0, 0, 2, 0, 0], "Land_prebehlavka", [[0,6,.7], [0,3,0], 90, true, false, false, false, false, false, false, true, false, true, true]],//Land_prebehlavka(Ramp) --22
  522. [[2, 0, 0, 0, 0, 0], "Fence_corrugated_plate", [[0,4,.6], [0,3,0], 0, true, false, false, false, false, false, false, true, false, true, true]],//Fence_corrugated_plate --23
  523. [[2, 0, 1, 0, 0, 0], "ZavoraAnim", [[0,5,4.0], [0,5,0], 0, true, false, false, false, false, true, false, true, false, true, true]],//ZavoraAnim --24
  524. [[0, 0, 7, 0, 1, 0], "Land_tent_east", [[0,8,1.7], [0,6,0], 0, true, false, false, true, false, false, false, false, true, true, true]],//Land_tent_east --25
  525. [[0, 0, 6, 0, 1, 0], "Land_CamoNetB_EAST", [[0,10,2], [0,10,0], 0, true, false, false, true, false, false, false, true, true, true, true]],//Land_CamoNetB_EAST --26
  526. [[0, 0, 5, 0, 1, 0], "Land_CamoNetB_NATO", [[0,10,2], [0,10,0], 0, true, false, false, true, false, false, false, true, true, true, true]],//Land_CamoNetB_NATO --27
  527. [[0, 0, 4, 0, 1, 0], "Land_CamoNetVar_EAST", [[0,10,1.2],[0,7,0], 0, true, false, true, false, false, false, false, true, false, true, true]],//Land_CamoNetVar_EAST --28
  528. [[0, 0, 3, 0, 1, 0], "Land_CamoNetVar_NATO", [[0,10,1.2],[0,7,0], 0, true, false, true, false, false, false, false, true, false, true, true]],//Land_CamoNetVar_NATO --29
  529. [[0, 0, 2, 0, 1, 0], "Land_CamoNet_EAST", [[0,8,1.2], [0,7,0], 0, true, false, true, false, false, false, false, true, false, true, true]],//Land_CamoNet_EAST --30
  530. [[0, 0, 1, 0, 1, 0], "Land_CamoNet_NATO", [[0,8,1.2], [0,7,0], 0, true, false, true, false, false, false, false, true, false, true, true]],//Land_CamoNet_NATO --31
  531. [[0, 0, 2, 2, 0, 0], "Fence_Ind_long", [[0,5,.6], [-4,1.5,0], 0, true, false, true, false, false, false, false, true, false, true, true]], //Fence_Ind_long --32
  532. [[0, 0, 2, 0, 0, 0], "Fort_RazorWire", [[0,5,.8], [0,4,0], 0, true, false, false, false, false, false, false, true, false, true, true]],//Fort_RazorWire --33
  533. [[0, 0, 1, 0, 0, 0], "Fence_Ind", [[0,4,.7], [0,2,0], 0, true, false, false, false, false, false, true, true, false, true, true]] //Fence_Ind --34 *** Remember that the last element in array does not get comma ***
  534. ];
  535. // Build allremovables array for remove action
  536. for "_i" from 0 to ((count _buildlist) - 1) do
  537. {
  538. _removable = (_buildlist select _i) select _i - _i + 1;
  539. if (_removable != "Grave") then { // Booby traps have disarm bomb
  540. allremovables set [count allremovables, _removable];
  541. };
  542. };
  543. // Build classnames array for use later
  544. for "_i" from 0 to ((count _buildlist) - 1) do
  545. {
  546. _classname = (_buildlist select _i) select _i - _i + 1;
  547. allbuildables_class set [count allbuildables_class, _classname];
  548. };
  549.  
  550.  
  551. /*
  552. *** Remember that the last element in ANY array does not get comma ***
  553. Notice lines 47 and 62
  554. */
  555. // Towns to restrict from building in. (Type exact name as shown on map, NOT Case-Sensitive but spaces important)
  556. // ["Classname", range restriction];
  557. // NOT REQUIRED SERVER SIDE, JUST ADDED IN IF YOU NEED TO USE IT
  558. _build_townsrestrict = [
  559. ["Lyepestok", 1000],
  560. ["Sabina", 900],
  561. ["Branibor", 600],
  562. ["Bilfrad na moru", 400],
  563. ["Mitrovice", 350],
  564. ["Seven", 300],
  565. ["Blato", 300]
  566. ];
  567. // Here we are filling the global arrays with this local list
  568. allbuildables = _buildlist;
  569. allbuild_notowns = _build_townsrestrict;
  570.  
  571. // ################################### BUILD LIST ARRAY SERVER SIDE ######################################## END
  572.  
  573. };
  574. //##### COPY END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement