Advertisement
Guest User

Untitled

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