Advertisement
Guest User

Untitled

a guest
Jun 5th, 2015
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.86 KB | None | 0 0
  1. /*
  2. FUNCTION COMPILES
  3. */
  4. //Player only
  5. if (!isDedicated) then {
  6.  
  7. "filmic" setToneMappingParams [0.07, 0.31, 0.23, 0.37, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
  8.  
  9. BIS_Effects_Burn = compile preprocessFile "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf";
  10. player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf"; //Run on a players computer, checks if the player is near a zombie
  11. player_zombieAttack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieAttack.sqf"; //Run on a players computer, causes a nearby zombie to attack them
  12. fnc_usec_damageActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageActions.sqf"; //Checks which actions for nearby casualty
  13. fnc_inAngleSector = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inAngleSector.sqf"; //Checks which actions for nearby casualty
  14. fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf"; //Checks which actions for self
  15. fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
  16. player_temp_calculation = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_temperatur.sqf"; //Temperatur System //TeeChange
  17. player_weaponFiredNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponFiredNear.sqf";
  18. player_animalCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_animalCheck.sqf";
  19. player_spawnCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnCheck.sqf";
  20. player_dumpBackpack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_dumpBackpack.sqf";
  21. building_spawnLoot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnLoot.sqf";
  22. building_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnZombies.sqf";
  23. dayz_spaceInterrupt = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\dayz_spaceInterrupt.sqf";
  24. player_fired = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_fired.sqf"; //Runs when player fires. Alerts nearby Zeds depending on calibre && audial rating
  25. player_harvest = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_harvest.sqf";
  26. player_packTent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packTent.sqf";
  27. player_packVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packVault.sqf";
  28. player_unlockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockVault.sqf";
  29.  
  30. player_removeObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\remove.sqf";
  31. player_removeNearby = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_removeNearby.sqf";
  32.  
  33. player_removeTankTrap = {
  34. //Object Array, Range, Error Message (@Skaronator)
  35. [["Hedgehog_DZ"], 1,"STR_EPOCH_ACTIONS_14"] call player_removeNearby;
  36. };
  37. player_removeNet = {
  38. [["DesertLargeCamoNet","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ"], 5,"str_epoch_player_8"] call player_removeNearby;
  39. };
  40.  
  41. player_login = {
  42. private ["_unit","_detail"];
  43. _unit = _this select 0;
  44. _detail = _this select 1;
  45. if(_unit == getPlayerUID player) then {
  46. player setVariable["publish",_detail];
  47. };
  48. };
  49.  
  50. player_unlockDoor = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockDoor.sqf";
  51. player_changeCombo = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_changeCombo.sqf";
  52.  
  53. player_lockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_lockVault.sqf";
  54. player_updateGui = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_updateGui.sqf";
  55. player_crossbowBolt = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_crossbowBolt.sqf";
  56. player_music = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_music.sqf"; //Used to generate ambient music
  57. player_death = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_death.sqf";
  58. player_switchModel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_switchModel.sqf";
  59. player_checkStealth = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_checkStealth.sqf";
  60. world_sunRise = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_sunRise.sqf";
  61. world_surfaceNoise = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_surfaceNoise.sqf";
  62. player_humanityMorph = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityMorph.sqf";
  63. player_throwObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_throwObject.sqf";
  64. player_alertZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_alertZombies.sqf";
  65. player_fireMonitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\fire_monitor.sqf";
  66. fn_gearMenuChecks = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_gearMenuChecks.sqf";
  67.  
  68. //Objects
  69. object_roadFlare = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_roadFlare.sqf";
  70. object_setpitchbank = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_setpitchbank.sqf";
  71. object_monitorGear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_monitorGear.sqf";
  72.  
  73. local_roadDebris = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_roadDebris.sqf";
  74.  
  75. //Zombies
  76. zombie_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_findTargetAgent.sqf";
  77. zombie_loiter = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_loiter.sqf"; //Server compile, used for loiter behaviour
  78. //Walking Dead
  79. zombie_generate = compile preprocessFileLineNumbers "GTX\walkers\zombie_generate.sqf";
  80. wild_spawnZombies = compile preprocessFileLineNumbers "GTX\walkers\wild_spawnZombies.sqf";
  81.  
  82. pz_attack = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\pzombie\pz_attack.sqf";
  83.  
  84. dog_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dog_findTargetAgent.sqf";
  85.  
  86. //actions
  87. player_countmagazines = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_countmagazines.sqf";
  88. player_addToolbelt = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_addToolbelt.sqf";
  89. player_copyKey = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_copyKey.sqf";
  90. player_reloadMag = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_reloadMags.sqf";
  91. player_loadCrate = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_loadCrate.sqf";
  92. player_craftItem = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem.sqf";
  93. player_tentPitch = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\tent_pitch.sqf";
  94. player_vaultPitch = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\vault_pitch.sqf";
  95. player_drink = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_drink.sqf";
  96. player_eat = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_eat.sqf";
  97. player_useMeds = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_useMeds.sqf";
  98. player_fillWater = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\water_fill.sqf";
  99. player_makeFire = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_makefire.sqf";
  100. player_harvestPlant = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_harvestPlant.sqf";
  101. player_goFishing = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_goFishing.sqf";
  102. player_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_build.sqf";
  103. player_wearClothes = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_wearClothes.sqf";
  104. object_pickup = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\object_pickup.sqf";
  105. player_flipvehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_flipvehicle.sqf";
  106. player_sleep = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_sleep.sqf";
  107. player_antiWall = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_antiWall.sqf";
  108. player_deathBoard = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\list_playerDeathsAlt.sqf";
  109.  
  110. player_plotPreview = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_showPlotRadius.sqf";
  111. player_upgradeVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_upgradeVehicle.sqf";
  112.  
  113. //ui
  114. player_selectSlot = compile preprocessFileLineNumbers "custom\ui_selectSlot.sqf";
  115. player_gearSync = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_gearSync.sqf";
  116. player_gearSet = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_gearSet.sqf";
  117. ui_changeDisplay = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_changeDisplay.sqf";
  118. ui_gear_sound = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_gear_sound.sqf";
  119.  
  120. //System
  121. player_monitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_monitor.sqf";
  122. player_spawn_1 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_1.sqf";
  123. player_spawn_2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_2.sqf";
  124. onPreloadStarted "dayz_preloadFinished = false;";
  125. onPreloadFinished "dayz_preloadFinished = true;";
  126.  
  127. // helper functions
  128. player_hasTools = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_hasTools.sqf";
  129. player_checkItems = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_checkItems.sqf";
  130. player_removeItems = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_removeItems.sqf";
  131. //Trader ["Trader City Name",false,"enter"] - Trader City Name | Show Message | "enter" || "leave"
  132. player_traderCity = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_traderCity.sqf";
  133.  
  134. // combination of check && remove items
  135. player_checkAndRemoveItems = {
  136. private ["_items","_b"];
  137. _items = _this;
  138. _b = _items call player_checkItems;
  139. if (_b) then {
  140. _b = _items call player_removeItems;
  141. };
  142. _b
  143. };
  144.  
  145. dayz_HungerThirst = {
  146. dayz_hunger = dayz_hunger + (_this select 0);
  147. dayz_thirst = dayz_thirst + (_this select 1);
  148. };
  149.  
  150. epoch_totalCurrency = {
  151. // total currency
  152. _total_currency = 0;
  153. {
  154. _part = (configFile >> "CfgMagazines" >> _x);
  155. _worth = (_part >> "worth");
  156. if isNumber (_worth) then {
  157. _total_currency = _total_currency + getNumber(_worth);
  158. };
  159. } count (magazines player);
  160. _total_currency
  161. };
  162.  
  163. epoch_itemCost = {
  164. _trade_total = 0;
  165. {
  166. _part_in_configClass = configFile >> "CfgMagazines" >> (_x select 0);
  167. if (isClass (_part_in_configClass)) then {
  168. _part_inWorth = (_part_in_configClass >> "worth");
  169. if isNumber (_part_inWorth) then {
  170. _trade_total = _trade_total + (getNumber(_part_inWorth) * (_x select 1));
  171. };
  172. };
  173. } count _this;
  174.  
  175. //diag_log format["DEBUG TRADER ITEMCOST: %1", _this];
  176. _trade_total
  177. };
  178.  
  179. epoch_returnChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\epoch_returnChange.sqf";
  180. // usage [["partinclassname",4]] call epoch_returnChange;
  181.  
  182. dayz_losChance = {
  183. private["_agent","_maxDis","_dis","_val","_maxExp","_myExp"];
  184. _agent = _this select 0;
  185. _dis = _this select 1;
  186. _maxDis = _this select 2;
  187. // diag_log ("VAL: " + str(_this));
  188. _val = (_maxDis - _dis) max 0;
  189. _maxExp = ((exp 2) * _maxDis);
  190. _myExp = ((exp 2) * (_val)) / _maxExp;
  191. _myExp = _myExp * 0.7;
  192. _myExp
  193. };
  194.  
  195. ui_initDisplay = {
  196. private["_control","_ctrlBleed","_display","_ctrlFracture","_ctrlDogFood","_ctrlDogWater","_ctrlDogWaterBorder", "_ctrlDogFoodBorder"];
  197. disableSerialization;
  198. _display = uiNamespace getVariable 'DAYZ_GUI_display';
  199. _control = _display displayCtrl 1204;
  200. _control ctrlShow false;
  201. if (!r_player_injured) then {
  202. _ctrlBleed = _display displayCtrl 1303;
  203. _ctrlBleed ctrlShow false;
  204. };
  205. if (!r_fracture_legs && !r_fracture_arms) then {
  206. _ctrlFracture = _display displayCtrl 1203;
  207. _ctrlFracture ctrlShow false;
  208. };
  209. _ctrlDogFoodBorder = _display displayCtrl 1501;
  210. _ctrlDogFoodBorder ctrlShow false;
  211. _ctrlDogFood = _display displayCtrl 1701;
  212. _ctrlDogFood ctrlShow false;
  213.  
  214. _ctrlDogWaterBorder = _display displayCtrl 1502;
  215. _ctrlDogWaterBorder ctrlShow false;
  216. _ctrlDogWater = _display displayCtrl 1702;
  217. _ctrlDogWater ctrlShow false
  218. };
  219.  
  220. dayz_losCheck = {
  221. private["_target","_agent","_cantSee"];
  222. _target = _this select 0; // PUT THE PLAYER IN FIRST ARGUMENT!!!!
  223. _agent = _this select 1;
  224. _cantSee = true;
  225. if (!isNull _target) then {
  226.  
  227. _tPos = visiblePositionASL _target;
  228. _zPos = visiblePositionASL _agent;
  229.  
  230. _tPos set [2,(_tPos select 2)+1];
  231. _zPos set [2,(_zPos select 2)+1];
  232.  
  233. if ((count _tPos > 0) && (count _zPos > 0)) then {
  234. _cantSee = terrainIntersectASL [_tPos, _zPos];
  235. if (!_cantSee) then {
  236. _cantSee = lineIntersects [_tPos, _zPos, _agent, vehicle _target];
  237. };
  238. };
  239. };
  240. _cantSee
  241. };
  242.  
  243. dayz_equipCheck = {
  244. private ["_empty", "_needed","_diff","_success"];
  245. _config = _this;
  246. _empty = [player] call BIS_fnc_invSlotsEmpty;
  247. _needed = [_config] call BIS_fnc_invSlotType;
  248. _diff = [_empty,_needed] call BIS_fnc_vectorDiff;
  249.  
  250. _success = true;
  251. {
  252. if (_x > 0) then {_success = false};
  253. } count _diff;
  254. hint format["Config: %5\nEmpty: %1\nNeeded: %2\nDiff: %3\nSuccess: %4",_empty,_needed,_diff,_success,_config];
  255. _success
  256. };
  257.  
  258. vehicle_gear_count = {
  259. private["_counter"];
  260. _counter = 0;
  261. {
  262. _counter = _counter + _x;
  263. } count _this;
  264. _counter
  265. };
  266.  
  267. player_tagFriendlyMsg = {
  268. if(player == (_this select 0)) then {
  269. cutText[(localize "str_epoch_player_2"),"PLAIN DOWN"];
  270. };
  271. };
  272.  
  273. player_serverModelChange = {
  274. private["_object","_model"];
  275. _object = _this select 0;
  276. _model = _this select 1;
  277. if (_object == player) then {
  278. _model call player_switchModel;
  279. };
  280. };
  281.  
  282. player_guiControlFlash = {
  283. private["_control"];
  284. _control = _this;
  285. if (ctrlShown _control) then {
  286. _control ctrlShow false;
  287. } else {
  288. _control ctrlShow true;
  289. };
  290. };
  291.  
  292. gearDialog_create = {
  293. private ["_i","_dialog"];
  294. if (!isNull (findDisplay 106)) then {
  295. (findDisplay 106) closeDisplay 0;
  296. };
  297. openMap false;
  298. closeDialog 0;
  299. if (gear_done) then {sleep 0.001;};
  300. player action ["Gear", player];
  301. if (gear_done) then {sleep 0.001;};
  302. _dialog = findDisplay 106;
  303. _i = 0;
  304. while {isNull _dialog} do {//DO NOT CHANGE TO A FOR LOOP!
  305. _i = _i + 1;
  306. _dialog = findDisplay 106;
  307. if (gear_done) then {sleep 0.001;};
  308. if (_i in [100,200,299]) then {
  309. closeDialog 0;
  310. player action ["Gear", player];
  311. };
  312. if (_i > 300) exitWith {};
  313. };
  314. if (gear_done) then {sleep 0.001;};
  315. _dialog = findDisplay 106;
  316. if ((parseNumber(_this select 0)) != 0) then {
  317. ctrlActivate (_dialog displayCtrl 157);
  318. if (gear_done) then {
  319. waitUntil {ctrlShown (_dialog displayCtrl 159)};
  320. sleep 0.001;
  321. };
  322. };
  323. _dialog
  324. };
  325.  
  326. gear_ui_offMenu = {
  327. private["_control","_parent","_menu"];
  328. disableSerialization;
  329. _control = _this select 0;
  330. _parent = findDisplay 106;
  331. if (!(_this select 3)) then {
  332. for "_i" from 0 to 9 do {
  333. _menu = _parent displayCtrl (1600 + _i);
  334. _menu ctrlShow false;
  335. };
  336. _grpPos = ctrlPosition _control;
  337. _grpPos set [3,0];
  338. _control ctrlSetPosition _grpPos;
  339. _control ctrlShow false;
  340. _control ctrlCommit 0;
  341. };
  342. };
  343.  
  344. dze_surrender_off = {
  345. player setVariable ["DZE_Surrendered", false, true];
  346. DZE_Surrender = false;
  347. };
  348.  
  349. gear_ui_init = {
  350. private["_control","_parent","_menu","_dspl","_grpPos"];
  351. disableSerialization;
  352. _parent = findDisplay 106;
  353. _control = _parent displayCtrl 6902;
  354. for "_i" from 0 to 9 do {
  355. _menu = _parent displayCtrl (1600 + _i);
  356. _menu ctrlShow false;
  357. };
  358. _grpPos = ctrlPosition _control;
  359. _grpPos set [3,0];
  360. _control ctrlSetPosition _grpPos;
  361. _control ctrlShow false;
  362. _control ctrlCommit 0;
  363. };
  364.  
  365. dayz_eyeDir = {
  366. private["_vval","_vdir"];
  367. _vval = (eyeDirection _this);
  368. _vdir = (_vval select 0) atan2 (_vval select 1);
  369. if (_vdir < 0) then {_vdir = 360 + _vdir};
  370. _vdir
  371. };
  372.  
  373. DZE_getModelName = {
  374. _objInfo = toArray(str(_this));
  375. _lenInfo = count _objInfo - 1;
  376. _objName = [];
  377. _i = 0;
  378. // determine where the object name starts
  379. {
  380. if (58 == _objInfo select _i) exitWith {};
  381. _i = _i + 1;
  382. } count _objInfo;
  383. _i = _i + 2; // skip the ": " part
  384. for "_k" from _i to _lenInfo do {
  385. _objName set [(count _objName), (_objInfo select _k)];
  386. };
  387. _objName = toLower(toString(_objName));
  388. _objName
  389. };
  390.  
  391. dze_isnearest_player = {
  392. private ["_notClosest","_playerDistance","_nearPlayers","_obj","_playerNear"];
  393. if(!isNull _this) then {
  394. _nearPlayers = _this nearEntities ["CAManBase", 12];
  395. _playerNear = ({isPlayer _x} count _nearPlayers) > 1;
  396. _notClosest = false;
  397. if (_playerNear) then {
  398. // check if another player is closer
  399. _playerDistance = player distance _this;
  400. {
  401. if (_playerDistance > (_x distance _this)) exitWith { _notClosest = true; };
  402. } count _nearPlayers;
  403. };
  404. } else {
  405. _notClosest = false;
  406. };
  407. _notClosest
  408. };
  409.  
  410. // trader menu code
  411. if (DZE_ConfigTrader) then {
  412. call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_traderMenuConfig.sqf";
  413. }else{
  414. call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_traderMenuHive.sqf";
  415. };
  416. // recent murders menu code
  417. call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_murderMenu.sqf";
  418.  
  419. //This is still needed but the fsm should terminate if any errors pop up.
  420. [] spawn {
  421. private["_timeOut","_display","_control1","_control2"];
  422. disableSerialization;
  423. _timeOut = 0;
  424. dayz_loadScreenMsg = "";
  425. diag_log "DEBUG: loadscreen guard started.";
  426. _display = uiNameSpace getVariable "BIS_loadingScreen";
  427. if (!isNil "_display") then {
  428. _control1 = _display displayctrl 8400;
  429. _control2 = _display displayctrl 102;
  430. };
  431. if (!isNil "dayz_DisplayGenderSelect") then {
  432. waitUntil {!dayz_DisplayGenderSelect};
  433. };
  434.  
  435. // 120 sec timeout (12000 * 0.01)
  436. while { _timeOut < 12000 } do {
  437. if (dayz_clientPreload && dayz_authed) exitWith { diag_log "PLOGIN: Login loop completed!"; };
  438. if (!isNil "_display") then {
  439. if ( isNull _display ) then {
  440. waitUntil { !dialog; };
  441. startLoadingScreen ["","RscDisplayLoadCustom"];
  442. _display = uiNameSpace getVariable "BIS_loadingScreen";
  443. _control1 = _display displayctrl 8400;
  444. _control2 = _display displayctrl 102;
  445. };
  446.  
  447. if ( dayz_loadScreenMsg != "" ) then {
  448. _control1 ctrlSetText dayz_loadScreenMsg;
  449. dayz_loadScreenMsg = "";
  450. };
  451.  
  452. _control2 ctrlSetText format["%1",round(_timeOut*0.01)];
  453. };
  454.  
  455. _timeOut = _timeOut + 1;
  456.  
  457. if (_timeOut >= 12000) then {
  458. 1 cutText [localize "str_player_login_timeout", "PLAIN DOWN"];
  459. sleep 10;
  460. endLoadingScreen;
  461. endMission "END1";
  462. };
  463.  
  464. sleep 0.01;
  465. };
  466. };
  467.  
  468. dayz_meleeMagazineCheck = {
  469. private["_meleeNum","_magType"];
  470. _magType = ([] + getArray (configFile >> "CfgWeapons" >> _wpnType >> "magazines")) select 0;
  471. _meleeNum = ({_x == _magType} count magazines player);
  472. if (_meleeNum < 1) then {
  473. player addMagazine _magType;
  474. };
  475. };
  476.  
  477. dayz_originalPlayer = player;
  478.  
  479. progressLoadingScreen 0.8;
  480. };
  481.  
  482. //Both
  483. BIS_fnc_selectRandom = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_selectRandom.sqf";
  484. BIS_fnc_vectorAdd = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_vectorAdd.sqf";
  485. BIS_fnc_halo = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_halo.sqf";
  486. BIS_fnc_findNestedElement = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_findNestedElement.sqf";
  487. BIS_fnc_param = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_param.sqf";
  488.  
  489. fnc_buildWeightedArray = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildWeightedArray.sqf"; //Checks which actions for nearby casualty
  490. fnc_usec_damageVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerVehicle.sqf"; //Event handler run on damage
  491.  
  492. // object_vehicleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_vehicleKilled.sqf"; //Event handler run on damage
  493. object_setHitServer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHitServer.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
  494. object_setFixServer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setFixServer.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
  495. object_getHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_getHit.sqf"; //gets the hit value for a HitPoint (i.e. HitLegs) against the selection (i.e. "legs"), returns the value
  496. object_setHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHit.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
  497. object_processHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_processHit.sqf"; //process the hit in the REVO damage system (records && sets hit)
  498. object_delLocal = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_delLocal.sqf";
  499. // object_cargoCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_cargoCheck.sqf"; //Run by the player || server to monitor changes in cargo contents
  500. fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf"; //Event handler run on damage
  501. fnc_veh_ResetEH = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\veh_ResetEH.sqf"; //Initialize vehicle
  502. // Vehicle damage fix
  503. vehicle_handleDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
  504. vehicle_handleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";
  505. //fnc_vehicleEventHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\vehicle_init.sqf"; //Initialize vehicle
  506. fnc_inString = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inString.sqf";
  507. fnc_isInsideBuilding = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
  508. fnc_isInsideBuilding2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding2.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding2;
  509. fnc_isInsideBuilding3 = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding3.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding3;
  510. dayz_zombieSpeak = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_speak.sqf"; //Used to generate random speech for a unit
  511. vehicle_getHitpoints = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_getHitpoints.sqf";
  512. local_gutObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObject.sqf"; //Generated on the server (|| local to unit) when gutting an object
  513. local_lockUnlock = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_lockUnlock.sqf"; //When vehicle is local to unit perform locking vehicle
  514. local_gutObjectZ = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObjectZ.sqf"; //Generated on the server (|| local to unit) when gutting an object
  515. local_zombieDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerZ.sqf"; //Generated by the client who created a zombie to track damage
  516. local_eventKill = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_eventKill.sqf"; //Generated when something is killed
  517. //player_weaponCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponCheck.sqf"; //Run by the player || server to monitor whether they have picked up a new weapon
  518. curTimeStr = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_curTimeStr.sqf";
  519. player_medBandage = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
  520. player_medInject = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medInject.sqf";
  521. player_medEpi = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medEpi.sqf";
  522. player_medTransfuse = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medTransfuse.sqf";
  523. player_medMorphine = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
  524. player_breaklegs = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medBreakLegs.sqf";
  525. player_medPainkiller = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf";
  526. world_isDay = {if ((daytime < (24 - dayz_sunRise)) && (daytime > dayz_sunRise)) then {true} else {false}};
  527. player_humanityChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityChange.sqf";
  528. spawn_loot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot.sqf";
  529. spawn_loot_small = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot_small.sqf";
  530. // player_projectileNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_projectileNear.sqf";
  531. FNC_GetSetPos = { //DO NOT USE IF YOU NEED ANGLE COMPENSATION!!!!
  532. private "_pos";
  533. _thingy = _this select 0;
  534. _pos = getPosASL _thingy;
  535. if (surfaceIsWater _pos) then {
  536. _thingy setPosASL _pos;
  537. } else {
  538. _thingy setPosATL (ASLToATL _pos);
  539. };
  540. };
  541. FNC_GetPos = {
  542. private "_pos";
  543. if (isNil {_this select 0}) exitWith {[0,0,0]};
  544. _thingy = _this select 0;
  545. _pos = getPosASL _thingy;
  546. if !(surfaceIsWater _pos) then {
  547. _pos = ASLToATL _pos;
  548. };
  549. _pos
  550. };
  551. local_setFuel = {
  552. private["_qty","_vehicle"];
  553. _vehicle = _this select 0;
  554. _qty = _this select 1;
  555. _vehicle setFuel _qty;
  556. };
  557. zombie_initialize = {
  558. private ["_unit","_position"];
  559. _unit = _this select 0;
  560. if (isServer) then {
  561. _unit addEventHandler ["local", {_this call zombie_findOwner}];
  562. };
  563. _id = _unit addeventhandler["HandleDamage", { _this call local_zombieDamage }];
  564. _id = _unit addeventhandler["Killed", { [_this, "zombieKills"] call local_eventKill }];
  565. };
  566.  
  567. dayz_EjectPlayer = {
  568. // check if player in vehicle
  569. private ["_noDriver","_vehicle","_inVehicle"];
  570. _vehicle = vehicle player;
  571. _inVehicle = (_vehicle != player);
  572. if(_inVehicle) then {
  573. _noDriver = ((_vehicle emptyPositions "driver") > 0);
  574. if (_noDriver && (speed _vehicle) != 0) then {
  575. player action [ "eject", _vehicle];
  576. };
  577. };
  578. };
  579.  
  580. player_sumMedical = {
  581. private["_character","_wounds","_legs","_arms","_medical"];
  582. _character = _this;
  583. _wounds = [];
  584. if (_character getVariable["USEC_injured",false]) then {
  585. {
  586. if (_character getVariable[_x,false]) then {
  587. _wounds set [count _wounds,_x];
  588. };
  589. } count USEC_typeOfWounds;
  590. };
  591. _legs = _character getVariable ["hit_legs",0];
  592. _arms = _character getVariable ["hit_arms",0];
  593. _medical = [
  594. _character getVariable["USEC_isDead",false],
  595. _character getVariable["NORRN_unconscious", false],
  596. _character getVariable["USEC_infected",false],
  597. _character getVariable["USEC_injured",false],
  598. _character getVariable["USEC_inPain",false],
  599. _character getVariable["USEC_isCardiac",false],
  600. _character getVariable["USEC_lowBlood",false],
  601. _character getVariable["USEC_BloodQty",12000],
  602. _wounds,
  603. [_legs,_arms],
  604. _character getVariable["unconsciousTime",0],
  605. _character getVariable["messing",[0,0]]
  606. ];
  607. _medical
  608. };
  609.  
  610. //Server Only
  611. if (isServer) then {
  612. call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\server_functions.sqf";
  613. } else {
  614. eh_localCleanup = {};
  615. };
  616.  
  617. //Snap Pro
  618. if (!isDedicated) then {
  619. player_build = compile preprocessFileLineNumbers "custom\snap_pro\player_build.sqf";
  620. snap_build = compile preprocessFileLineNumbers "custom\snap_pro\snap_build.sqf";
  621. dayz_spaceInterrupt = compile preprocessFileLineNumbers "custom\snap_pro\dayz_spaceInterrupt.sqf";
  622. };
  623.  
  624. /*Plot*/
  625. PlotGetFriends = compile preprocessFileLineNumbers "plotManagement\plotGetFriends.sqf";
  626. PlotNearbyHumans = compile preprocessFileLineNumbers "plotManagement\plotNearbyHumans.sqf";
  627. PlotAddFriend = compile preprocessFileLineNumbers "plotManagement\plotAddFriend.sqf";
  628. PlotRemoveFriend = compile preprocessFileLineNumbers "plotManagement\plotRemoveFriend.sqf";
  629. /*Plot End*/
  630. };
  631.  
  632. initialized = true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement