Guest User

init.sqf

a guest
Oct 4th, 2013
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.39 KB | None | 0 0
  1. initialized = false;
  2. dayzHiveRequest = [];
  3. dayz_previousID = 0;
  4. 0 fadeSound 0;
  5. //disable greeting menu
  6. player setVariable ["BIS_noCoreConversations", true];
  7. //disable radio messages to be heard and shown in the left lower corner of the screen
  8. enableRadio false;
  9.  
  10. //Load in compiled functions
  11. call compile preprocessFileLineNumbers "dayz_code\init\variables.sqf"; //Initilize the Variables (IMPORTANT: Must happen very early)
  12. progressLoadingScreen 0.1;
  13. call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf"; //Initilize the publicVariable event handlers
  14. progressLoadingScreen 0.2;
  15. call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf"; //Functions used by CLIENT for medical
  16. progressLoadingScreen 0.4;
  17. call compile preprocessFileLineNumbers "dayz_code\init\compiles.sqf"; //Compile regular functions
  18. call compile preprocessFileLineNumbers "dayz_code\init\settings.sqf"; //Initialize custom clientside settings
  19. progressLoadingScreen 1.0;
  20.  
  21. "filmic" setToneMappingParams [0.153, 0.357, 0.231, 0.1573, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
  22.  
  23. [] spawn {
  24. while {true} do {
  25. waitUntil {((isNil "BIS_Effects_Rifle") OR {(count(toArray(str(BIS_Effects_Rifle)))!=7)})};
  26. diag_log "Res3tting B!S effects...";
  27. /* BIS_Effects_* fixes from Dwarden */
  28. BIS_Effects_EH_Killed = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\BIS_Effects\killed.sqf";
  29. BIS_Effects_AirDestruction = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\BIS_Effects\AirDestruction.sqf";
  30. BIS_Effects_AirDestructionStage2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\BIS_Effects\AirDestructionStage2.sqf";
  31.  
  32. BIS_Effects_globalEvent = {
  33. BIS_effects_gepv = _this;
  34. publicVariable "BIS_effects_gepv";
  35. _this call BIS_Effects_startEvent;
  36. };
  37.  
  38. BIS_Effects_startEvent = {
  39. switch (_this select 0) do {
  40. case "AirDestruction": {
  41. [_this select 1] spawn BIS_Effects_AirDestruction;
  42. };
  43. case "AirDestructionStage2": {
  44. [_this select 1, _this select 2, _this select 3] spawn BIS_Effects_AirDestructionStage2;
  45. };
  46. case "Burn": {
  47. [_this select 1, _this select 2, _this select 3, false, true] spawn BIS_Effects_Burn;
  48. };
  49. };
  50. };
  51.  
  52. "BIS_effects_gepv" addPublicVariableEventHandler {
  53. (_this select 1) call BIS_Effects_startEvent;
  54. };
  55.  
  56. BIS_Effects_EH_Fired = {false};
  57. BIS_Effects_Rifle = {false};
  58. sleep 1;
  59. };
  60. };
  61.  
  62. if ((!isServer) && (isNull player) ) then
  63. {
  64. waitUntil {!isNull player};
  65. waitUntil {time > 3};
  66. };
  67.  
  68. if ((!isServer) && (player != player)) then
  69. {
  70. waitUntil {player == player};
  71. waitUntil {time > 3};
  72. };
  73.  
  74. if (isServer) then {
  75. _serverMonitor = [] execVM "\z\addons\dayz_code\system\server_monitor.sqf";
  76. "PVDZ_sec_atp" addPublicVariableEventHandler {
  77. _x = _this select 1;
  78. if (typeName _x == "STRING") then {
  79. diag_log _x;
  80. }
  81. else {
  82. _unit = _x select 0;
  83. _source = _x select 1;
  84. if (((!(isNil {_source})) AND {(!(isNull _source))}) AND {((_source isKindOf "CAManBase") AND {(owner _unit != owner _source)})}) then {
  85. diag_log format ["P1ayer %1 hit by %2 %3 from %4 meters",
  86. _unit call fa_plr2Str, _source call fa_plr2Str, _x select 2, _x select 3];
  87. if (_unit getVariable["processedDeath", 0] == 0) then {
  88. _unit setVariable [ "attacker", name _source ];
  89. _unit setVariable [ "noatlf4", diag_ticktime ]; // server-side "not in combat" test, if player is not already dead
  90. };
  91. };
  92. };
  93. };
  94. };
  95.  
  96. if (!isDedicated) then {
  97. //Conduct map operations
  98. waitUntil {!isNil "dayz_loadScreenMsg"};
  99. dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
  100.  
  101. //Run the player monitor
  102. _id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
  103. _playerMonitor = [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
  104. if (dayz_antihack == 1) then {
  105. [] execVM "\z\addons\dayz_code\system\antihack.sqf";
  106. };
  107. };
  108.  
  109. // Logo watermark: adding a logo in the bottom left corner of the screen with the server name in it
  110. if (!isNil "dayZ_serverName") then {
  111. [] spawn {
  112. waitUntil {(!isNull Player) and (alive Player) and (player == player)};
  113. waituntil {!(isNull (findDisplay 46))};
  114. 5 cutRsc ["wm_disp","PLAIN"];
  115. ((uiNamespace getVariable "wm_disp") displayCtrl 1) ctrlSetText dayZ_serverName;
  116. };
  117. };
  118.  
  119. if (dayz_REsec == 1) then {
  120. #include "\z\addons\dayz_code\system\REsec.sqf"
  121. };
Advertisement
Add Comment
Please, Sign In to add comment