-
Notifications
You must be signed in to change notification settings - Fork 5
/
init.sqf
119 lines (97 loc) · 3.77 KB
/
init.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
// @file Version: 1.2
// @file Name: init.sqf
// @file Author: [404] Deadbeat, [GoT] JoSchaap, AgentRev
// @file Description: The main init.
#include "debugFlag.hpp"
#ifdef A3W_DEBUG
#define DEBUG true
#else
#define DEBUG false
#endif
enableSaving [false, false];
// block script injection exploit
inGameUISetEventHandler ["PrevAction", ""];
inGameUISetEventHandler ["Action", ""];
inGameUISetEventHandler ["NextAction", ""];
_descExtPath = str missionConfigFile;
currMissionDir = compileFinal str (_descExtPath select [0, count _descExtPath - 15]);
X_Server = false;
X_Client = false;
X_JIP = false;
//disable TAW grass Option 'None'
tawvd_disablenone = true;
// versionName = ""; // Set in STR_WL_WelcomeToWasteland in stringtable.xml
if (isServer) then { X_Server = true };
if (!isDedicated) then { X_Client = true };
if (isNull player) then { X_JIP = true };
A3W_scriptThreads = [];
[DEBUG] call compile preprocessFileLineNumbers "globalCompile.sqf";
//[] spawn compile preprocessFileLineNumbers "addons\spawn\functions.sqf";
//init Wasteland Core
[] execVM "config.sqf";
[] execVM "storeConfig.sqf"; // Separated as its now v large
[] execVM "briefing.sqf";
if (!isDedicated) then
{
[] spawn
{
if (hasInterface) then // Normal player
{
9999 cutText ["Welcome to A3Wasteland, please wait for your client to initialize", "BLACK", 0.01];
waitUntil {!isNull player};
player setVariable ["playerSpawning", true, true];
playerSpawning = true;
removeAllWeapons player;
client_initEH = player addEventHandler ["Respawn", { removeAllWeapons (_this select 0) }];
// Reset group & side
[player] joinSilent createGroup playerSide;
execVM "client\init.sqf";
if ((vehicleVarName player) select [0,17] == "BIS_fnc_objectVar") then { player setVehicleVarName "" }; // undo useless crap added by BIS
}
else // Headless
{
waitUntil {!isNull player};
if (getText (configFile >> "CfgVehicles" >> typeOf player >> "simulation") == "headlessclient") then
{
execVM "client\headless\init.sqf";
};
};
player setVehicleVarName ""; // undo BIS_fnc_objectVar crap
};
};
if (isServer) then
{
diag_log format ["############################# %1 #############################", missionName];
diag_log "WASTELAND SERVER - Initializing Server";
[] execVM "server\init.sqf";
};
//init 3rd Party Scripts (not supposed to run on HC)
if (hasInterface || isServer) then
{
[] execVM "addons\vactions\functions.sqf";
[] execVM "addons\parking\functions.sqf";
[] execVM "addons\storage\functions.sqf";
[] execVM "addons\R3F_ARTY_AND_LOG\init.sqf";
[] execVM "addons\JumpMF\init.sqf";
[] execVM "addons\outlw_magRepack\MagRepack_init.sqf";
[] execVM "addons\JTS_PM\Functions.sqf";
[] execVM "addons\scripts\servercredits.sqf";
[] execVM "addons\resupply\resupply_actions.sqf";
[] execVM "addons\lsd_nvg\init.sqf";
[] execVM "addons\stickyCharges\init.sqf";
[] execVM "addons\vsave\vsfunctions.sqf";
[] execVM "addons\APOC_Airdrop_Assistance\init.sqf";
//[] execVM "addons\statusBar\statusBar.sqf"; // shows FPS and teamspeak details
[] execVM "addons\bounty\init.sqf";
if (isNil "drn_DynamicWeather_MainThread") then { drn_DynamicWeather_MainThread = [] execVM "addons\scripts\DynamicWeatherEffects.sqf" };
};
// Remove line drawings from map
(createTrigger ["EmptyDetector", [0,0,0], false]) setTriggerStatements
[
"!triggerActivated thisTrigger",
"thisTrigger setTriggerTimeout [30,30,30,false]",
"{if (markerShape _x == 'POLYLINE') then {deleteMarker _x}} forEach allMapMarkers"
];