if (isDedicated) exitWith {};
waitUntil {!(isNull (findDisplay 46))};
waitUntil {EWDB_Loaded == "true"};
waitUntil {!isNull player};
waitUntil {time > 0.1};


call EWDB_fnc_DBGet;
sleep 3;
if (isNil "EWDB") then{
call EWDB_fnc_DBAdd;
};
waitUntil {!isNil "EWDB"};

if (name player != EWDB select 2) then {  ["name",(name player)] call EWDB_fnc_DBUpdate};
if (EWDB select 10 == "") then {  ["GUID"] call EWDB_fnc_DBGUID};
["connections",1] call EWDB_fnc_DBTracker;
call EWDB_fnc_DBGet; 

call EWDB_fnc_DBGetGear;
sleep 3;
if (isNil "EWDBGear") then{
call EWDB_fnc_DBAddGear;
};
waitUntil {!isNil "EWDBGear"};


[] spawn { call EWDB_fnc_DBLoadGear; };
call EWDB_fnc_AddEH;
sleep 2;
waitUntil {!(isNull (findDisplay 46))};
call EWDB_fnc_Introtxt;
call EWDB_fnc_DBVersion;

call EWDB_fnc_DBJoin;



[] spawn { call EWDB_fnc_DBRespawn; };

[] spawn { while {true} do {
	call EWDB_fnc_DBAutoSaveGear;
	sleep 30;
	}
};
[] spawn { while {true} do {
	call EWDB_fnc_DBScore;
	sleep 30;
	}
};