Advertisement
Guest User

init.sqf

a guest
Aug 1st, 2014
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.53 KB | None | 0 0
  1. startLoadingScreen ["","RscDisplayLoadCustom"];
  2. cutText ["","BLACK OUT"];
  3. enableSaving [false, false];
  4.  
  5. //Server Settings
  6. dayZ_instance = 8178;
  7. //dayZ_serverName = "UK1337"; // Servername (country code + server number)
  8. dayz_antihack = 0; // DayZ Antihack / 1 = enabled // 0 = disabled
  9. dayz_REsec = 0; // DayZ RE Security / 1 = enabled // 0 = disabled
  10.  
  11. //Game Settings
  12. dayz_spawnselection = 0; // DayZ Spawnselection / 1 = enabled // 0 = disabled, No current spawn limits.
  13. dayz_spawnCrashSite_clutterCutter = 0; // Helicrash Settings / 0 = loot hidden in grass // 1 = loot lifted // 2 = no grass around the Helicrash
  14. dayz_spawnInfectedSite_clutterCutter = 0; // Infected Base Settings / 0 = loot hidden in grass // 1 = loot lifted // 2 = no grass around the infected base
  15.  
  16. initialized = false;
  17. dayzHiveRequest = [];
  18. dayz_previousID = 0;
  19. 0 fadeSound 0;
  20. //disable greeting menu
  21. player setVariable ["BIS_noCoreConversations", true];
  22. //disable radio messages to be heard and shown in the left lower corner of the screen
  23. //enableRadio false;
  24.  
  25. //Load in compiled functions
  26. call compile preprocessFileLineNumbers "custom\variables.sqf"; //Initilize the Variables (IMPORTANT: Must happen very early)
  27. progressLoadingScreen 0.1;
  28. call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf"; //Initilize the publicVariable event handlers
  29. progressLoadingScreen 0.2;
  30. call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf"; //Functions used by CLIENT for medical
  31. progressLoadingScreen 0.4;
  32. call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile regular functions
  33. progressLoadingScreen 1.0;
  34.  
  35. stream_locationCheck = {
  36. //Thank you very fucking much, KK!
  37. };
  38.  
  39. "filmic" setToneMappingParams [0.153, 0.357, 0.231, 0.1573, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
  40.  
  41. [] execVM "\ddopp_taserpack\scripts\init_Taser.sqf";
  42.  
  43. [] spawn {
  44. while {true} do {
  45. waitUntil {((isNil "BIS_Effects_Rifle") OR {(count(toArray(str(BIS_Effects_Rifle)))!=7)})};
  46. diag_log "Res3tting B!S effects...";
  47. /* BIS_Effects_* fixes from Dwarden */
  48. BIS_Effects_EH_Killed = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\BIS_Effects\killed.sqf";
  49. BIS_Effects_AirDestruction = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\BIS_Effects\AirDestruction.sqf";
  50. BIS_Effects_AirDestructionStage2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\BIS_Effects\AirDestructionStage2.sqf";
  51.  
  52. BIS_Effects_globalEvent = {
  53. BIS_effects_gepv = _this;
  54. publicVariable "BIS_effects_gepv";
  55. _this call BIS_Effects_startEvent;
  56. };
  57.  
  58. BIS_Effects_startEvent = {
  59. switch (_this select 0) do {
  60. case "AirDestruction": {
  61. [_this select 1] spawn BIS_Effects_AirDestruction;
  62. };
  63. case "AirDestructionStage2": {
  64. [_this select 1, _this select 2, _this select 3] spawn BIS_Effects_AirDestructionStage2;
  65. };
  66. case "Burn": {
  67. [_this select 1, _this select 2, _this select 3, false, true] spawn BIS_Effects_Burn;
  68. };
  69. };
  70. };
  71.  
  72. "BIS_effects_gepv" addPublicVariableEventHandler {
  73. (_this select 1) call BIS_Effects_startEvent;
  74. };
  75.  
  76. BIS_Effects_EH_Fired = {false};
  77. BIS_Effects_Rifle = {false};
  78. sleep 1;
  79. };
  80. };
  81.  
  82. if ((!isServer) && (isNull player) ) then
  83. {
  84. waitUntil {!isNull player};
  85. waitUntil {time > 3};
  86. };
  87.  
  88. if ((!isServer) && (player != player)) then
  89. {
  90. waitUntil {player == player};
  91. waitUntil {time > 3};
  92. };
  93.  
  94. if (isServer) then {
  95. _serverMonitor = [] execVM "\z\addons\dayz_code\system\server_monitor.sqf";
  96. "PVDZ_sec_atp" addPublicVariableEventHandler {
  97. _x = _this select 1;
  98. if (typeName _x == "STRING") then {
  99. diag_log _x;
  100. }
  101. else {
  102. _unit = _x select 0;
  103. _source = _x select 1;
  104. if (((!(isNil {_source})) AND {(!(isNull _source))}) AND {((_source isKindOf "CAManBase") AND {(owner _unit != owner _source)})}) then {
  105. diag_log format ["P1ayer %1 hit by %2 %3 from %4 meters",
  106. _unit call fa_plr2Str, _source call fa_plr2Str, _x select 2, _x select 3];
  107. if (_unit getVariable["processedDeath", 0] == 0) then {
  108. _unit setVariable [ "attacker", name _source ];
  109. _unit setVariable [ "noatlf4", diag_ticktime ]; // server-side "not in combat" test, if player is not already dead
  110. };
  111. };
  112. };
  113. };
  114. };
  115.  
  116. if (!isDedicated) then {[] execVM "custom\AutoRefuel\kh_actions.sqf";
  117. [] execVM "custom\effects.sqf";
  118. //Conduct map operations
  119. waitUntil {!isNil "dayz_loadScreenMsg"};
  120. dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
  121.  
  122. //Run the player monitor
  123. _id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
  124. _playerMonitor = [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
  125. [] execVM "nosidechat.sqf";
  126. if (dayz_antihack == 1) then {
  127. //[] execVM "\z\addons\dayz_code\system\antihack.sqf";
  128. };
  129. p2_loadouts = compile preprocessFileLineNumbers "Loadouts\loadouts.sqf";
  130. waitUntil { !isNil ("dayz_animalCheck") and !(player getVariable ["humanity",0] > 5000 and typeOf player == "Survivor2_DZ") and !(player getVariable ["humanity",0] < -2000 and (typeOf player == "Survivor2_DZ" or typeOf player == "SurvivorW2_DZ") ) and !(player getVariable ["humanity",0] > 0 and (typeOf player == "Bandit1_DZ" or typeOf player == "BanditW1_DZ") )};
  131. if (PVCDZ_plr_Login2 select 2) then {
  132. player spawn p2_loadouts;
  133. player addWeapon "ItemToolbox";
  134. player addWeapon "ItemMap";
  135. player addWeapon "ItemCompass";
  136. };
  137. };
  138.  
  139. // Logo watermark: adding a logo in the bottom left corner of the screen with the server name in it
  140. if (!isNil "dayZ_serverName") then {
  141. [] spawn {
  142. waitUntil {(!isNull Player) and (alive Player) and (player == player)};
  143. waituntil {!(isNull (findDisplay 46))};
  144. 5 cutRsc ["wm_disp","PLAIN"];
  145. ((uiNamespace getVariable "wm_disp") displayCtrl 1) ctrlSetText dayZ_serverName;
  146. };
  147. };
  148.  
  149. if (dayz_REsec == 1) then {
  150. //#include "\z\addons\dayz_code\system\REsec.sqf"
  151. };
  152.  
  153.  
  154. //custom marker
  155. [] execVM "mapmarkers\Marker.sqf";
  156. [] execVM "mapmarkers\Marker2.sqf";
  157. [] execVM "mapmarkers\Marker3.sqf";
  158. [] execVM "mapmarkers\Marker4.sqf";
  159. [] execVM "mapmarkers\Marker5.sqf";
  160. [] execVM "mapmarkers\Marker6.sqf";
  161. [] execVM "mapmarkers\Marker7.sqf";
  162. [] execVM "mapmarkers\Marker8.sqf";
  163. [] execVM "mapmarkers\Marker9.sqf";
  164. [] execVM "mapmarkers\Marker10.sqf";
  165. [] execVM "mapmarkers\Marker11.sqf";
  166.  
  167. espawn = compile preprocessFileLineNumbers "spawn\spawn.sqf";
  168. waitUntil {!isNil "PVDZ_plr_LoginRecord"};
  169. if ((!isDedicated) && (PVCDZ_plr_Login2 select 2)) then {[] spawn espawn;};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement