Advertisement
QCube

compiles.sqf

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