Advertisement
Guest User

Untitled

a guest
May 27th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (isNil "TFAR_fnc_isTeamSpeakPluginEnabled") exitwith {
  2.  
  3. 999999 cutText ["Task Force Radio is not running on your computer. Please re-sync and retry","BLACK FADED"];
  4. 999999 cutFadeOut 99999999;
  5. if (player getvariable "taskfr") then {
  6. player setvariable ["taskfr",false,true];
  7. };
  8. };
  9.  
  10.  
  11.  
  12. _TFenabled = [] call TFAR_fnc_isTeamSpeakPluginEnabled;
  13.  
  14. if (!(_TFenabled)) then {
  15.  
  16. while {!([] call TFAR_fnc_isTeamSpeakPluginEnabled)} do {
  17.  
  18. titleText ["Veuillez activer le plugin TFR || Paramètres -> Plugins", "BLACK"];
  19. sleep 2;
  20. if (player getvariable "taskfr") then {
  21. player setvariable ["taskfr",false,true];
  22. };
  23. };
  24. };
  25.  
  26. Dvid_TFEnabled = true;
  27. Dvid_onTsServer = "InfinityLife V2 - www.infinitylife.fr" == (call TFAR_fnc_getTeamSpeakServerName); ///////////////////////Edit This line (the channel at the top of your TS (where you right click and "Edit Virtual Server"), yes, get the name of that goes here)
  28. Dvid_onChannel = "EN JEU • TASK FORCE RADIO" == (call TFAR_fnc_getTeamSpeakChannelName);
  29. titleText ["Task Force Radio chargé avec succès","BLACK IN"];
  30.  
  31. [] spawn {
  32.  
  33. while {true} do {
  34.  
  35. _isadmin = false;
  36. if (!(isNil "life_adminlevel")) then {
  37. _adminlvl = life_adminlevel call BIS_fnc_parseNumber;
  38.  
  39. if (_adminlvl > 0) then {
  40. _isadmin = true;
  41. };
  42. };
  43.  
  44.  
  45.  
  46. _TFenabled = [] call TFAR_fnc_isTeamSpeakPluginEnabled;
  47. if ((!(_TFenabled)) && (Dvid_TFEnabled)) then {
  48. if (!(_isadmin)) then {
  49. titleText ["Veuillez activer le plugin pour rejoindre le canal TFR || Paramètres -> Plugins", "BLACK"];
  50. Dvid_TFEnabled = false;
  51. };
  52. if (player getvariable "taskfr") then {
  53. player setvariable ["taskfr",false,true];
  54. };
  55. };
  56.  
  57. _onTsServer = "InfinityLife V2 - www.infinitylife.fr" == (call TFAR_fnc_getTeamSpeakServerName); //////////////////////Edit too pls, or dont but it wont work if you dont
  58. if (!(_onTsServer)) then {
  59. if (!(_isadmin)) then {
  60. titleText ["S'il vous plaît joindre le serveur teamspeak ! Adresse : 91.121.43.195:12096 ", "BLACK"];
  61. Dvid_onTsServer = false;
  62. };
  63. if (player getvariable "taskfr") then {
  64. player setvariable ["taskfr",false,true];
  65. };
  66. } else {
  67. if (!(Dvid_onTsServer)) then {
  68. if (!(_isadmin)) then {
  69. titleText ["Vérification du canal TS terminée. Bienvenue !","BLACK IN"];
  70. Dvid_onTsServer = true;
  71. };
  72. if (!(player getvariable "taskfr")) then {
  73. player setvariable ["taskfr",true,true];
  74. };
  75. };
  76. };
  77.  
  78. _onChannel = "EN JEU • TASK FORCE RADIO" == (call TFAR_fnc_getTeamSpeakChannelName);
  79. if (!(_onChannel)) then {
  80. if (!(_isadmin)) then {
  81. titleText ["Veuillez recharger le plugin pour rejoindre le canal TFR || Paramètres -> Plugins -> Recharger tout", "BLACK"];
  82. Dvid_onChannel = false;
  83. };
  84. if (player getvariable "taskfr") then {
  85. player setvariable ["taskfr",false,true];
  86. };
  87. } else {
  88. if (!(Dvid_onChannel)) then {
  89. titleText ["Vérification du canal TS terminée. Bienvenue !","BLACK IN"];
  90. Dvid_onChannel = true;
  91. if (!(player getvariable "taskfr")) then {
  92. player setvariable ["taskfr",true,true];
  93. };
  94. };
  95. };
  96.  
  97.  
  98. if ((_TFenabled) && (!(Dvid_TFEnabled))) then {
  99. titleText ["Plugin enabled, welcome back!","BLACK IN"];
  100. Dvid_TFEnabled = true;
  101. if (!(player getvariable "taskfr")) then {
  102. player setvariable ["taskfr",true,true];
  103. };
  104. };
  105.  
  106. sleep 2;
  107. };
  108.  
  109. };
  110.  
  111. #include "..\script_macros.hpp"
  112. /*
  113. File: init.sqf
  114. Author:
  115.  
  116. Description:
  117. Master client initialization file
  118. */
  119.  
  120. private["_handle","_timeStamp","_server_isReady","_extDB_notLoaded"];
  121.  
  122. if (life_HC_isActive) then {
  123. _server_isReady = life_HC_server_isReady;
  124. _extDB_notLoaded = life_HC_server_extDB_notLoaded;
  125. } else {
  126. _server_isReady = life_server_isReady;
  127. _extDB_notLoaded = life_server_extDB_notLoaded;
  128. };
  129.  
  130. 0 fadeSound 0;
  131. 0 fadeMusic 0;
  132. 0 fadeRadio 0;
  133.  
  134. life_firstSpawn = true;
  135. life_session_completed = false;
  136. 0 cutText["Setting up client, please wait...","BLACK FADED"];
  137. 0 cutFadeOut 9999999;
  138. _timeStamp = diag_tickTime;
  139. diag_log "----------------------------------------------------------------------------------------------------";
  140. diag_log "--------------------------------- Starting Altis Life Client Init ----------------------------------";
  141. diag_log "------------------------------------------ Version 4.4R3 -------------------------------------------";
  142. diag_log "----------------------------------------------------------------------------------------------------";
  143. waitUntil {!isNull player && player == player}; //Wait till the player is ready
  144. [] call compile PreprocessFileLineNumbers "core\clientValidator.sqf";
  145. enableSentences false;
  146.  
  147. //Setup initial client core functions
  148. diag_log "::Life Client:: Initialization Variables";
  149. [] call compile PreprocessFileLineNumbers "core\configuration.sqf";
  150.  
  151. //Set bank amount for new players
  152. switch (playerSide) do {
  153. case west: {
  154. life_paycheck = LIFE_SETTINGS(getNumber,"paycheck_cop");
  155. };
  156. case civilian: {
  157. life_paycheck = LIFE_SETTINGS(getNumber,"paycheck_civ");
  158. };
  159. case independent: {
  160. life_paycheck = LIFE_SETTINGS(getNumber,"paycheck_med");
  161. };
  162. };
  163.  
  164. diag_log "::Life Client:: Variables initialized";
  165. diag_log "::Life Client:: Setting up Eventhandlers";
  166. [] call life_fnc_setupEVH;
  167.  
  168. diag_log "::Life Client:: Eventhandlers completed";
  169. diag_log "::Life Client:: Setting up user actions";
  170. [] call life_fnc_setupActions;
  171. [] execVM "core\functions\fn_markers.sqf";
  172.  
  173. diag_log "::Life Client:: User actions completed";
  174. diag_log "::Life Client:: Waiting for server functions to transfer..";
  175. waitUntil {(!isNil "TON_fnc_clientGangLeader")};
  176.  
  177. diag_log "::Life Client:: Received server functions.";
  178. 0 cutText ["Waiting for the server to be ready...","BLACK FADED"];
  179. 0 cutFadeOut 99999999;
  180.  
  181. diag_log "::Life Client:: Waiting for the server to be ready..";
  182. waitUntil{!isNil "_server_isReady"};
  183. waitUntil{(_server_isReady || !isNil "_extDB_notLoaded")};
  184.  
  185. if (!isNil "_extDB_notLoaded" && {_extDB_notLoaded isEqualType []}) exitWith {
  186. diag_log _extDB_notLoaded;
  187. 999999 cutText ["extDB failed to load, please contact an administrator.","BLACK FADED"];
  188. 999999 cutFadeOut 99999999;
  189. };
  190.  
  191. [] call SOCK_fnc_dataQuery;
  192. waitUntil {life_session_completed};
  193. 0 cutText["Finishing client setup procedure","BLACK FADED"];
  194. 0 cutFadeOut 9999999;
  195.  
  196. //diag_log "::Life Client:: Group Base Execution";
  197. [] spawn life_fnc_escInterupt;
  198.  
  199. switch (playerSide) do {
  200. case west: {
  201. _handle = [] spawn life_fnc_initCop;
  202. waitUntil {scriptDone _handle};
  203. };
  204. case civilian: {
  205. //Initialize Civilian Settings
  206. _handle = [] spawn life_fnc_initCiv;
  207. waitUntil {scriptDone _handle};
  208. };
  209. case independent: {
  210. //Initialize Medics and blah
  211. _handle = [] spawn life_fnc_initMedic;
  212. waitUntil {scriptDone _handle};
  213. };
  214.  
  215. case sideLogic:
  216. {
  217. _handle = [] spawn life_fnc_initZeus;
  218. waitUntil {scriptDone _handle};
  219. };
  220. };
  221.  
  222. player setVariable ["restrained",false,true];
  223. player setVariable ["Escorting",false,true];
  224. player setVariable ["transporting",false,true];
  225. player setVariable ["playerSurrender",false,true];
  226.  
  227. diag_log "Past Settings Init";
  228. [] execFSM "core\fsm\client.fsm";
  229.  
  230. diag_log "Executing client.fsm";
  231. waitUntil {!(isNull (findDisplay 46))};
  232.  
  233. diag_log "Display 46 Found";
  234. (findDisplay 46) displayAddEventHandler ["KeyDown", "_this call life_fnc_keyHandler"];
  235. player addRating 99999999;
  236.  
  237.  
  238.  
  239. [player,life_settings_enableSidechannel,playerSide] remoteExecCall ["TON_fnc_managesc",RSERV];
  240. 0 cutText ["","BLACK IN"];
  241. [] call life_fnc_hudSetup;
  242.  
  243. /* Set up frame-by-frame handlers */
  244. // LIFE_ID_PlayerTags = ["LIFE_PlayerTags","onEachFrame","life_fnc_playerTags"] call BIS_fnc_addStackedEventHandler;
  245. // LIFE_ID_RevealObjects = ["LIFE_RevealObjects","onEachFrame","life_fnc_revealObjects"] call BIS_fnc_addStackedEventHandler;
  246.  
  247. player setVariable ["steam64ID",getPlayerUID player];
  248. player setVariable ["realname",profileName,true];
  249.  
  250. life_fnc_moveIn = compileFinal
  251. "
  252. life_disable_getIn = false;
  253. player moveInCargo (_this select 0);
  254. life_disable_getOut = true;
  255. ";
  256.  
  257. life_fnc_RequestClientId = player;
  258. publicVariableServer "life_fnc_RequestClientId"; //Variable OwnerID for HeadlessClient
  259.  
  260. [] spawn life_fnc_survival;
  261.  
  262. [] spawn {
  263. for "_i" from 0 to 1 step 0 do {
  264. waitUntil{(!isNull (findDisplay 49)) && (!isNull (findDisplay 602))}; // Check if Inventory and ESC dialogs are open
  265. (findDisplay 49) closeDisplay 2; // Close ESC dialog
  266. (findDisplay 602) closeDisplay 2; // Close Inventory dialog
  267. };
  268. };
  269.  
  270. CONSTVAR(life_paycheck); //Make the paycheck static.
  271. if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 0) then {player enableFatigue false;};
  272. /*
  273. if (LIFE_SETTINGS(getNumber,"pump_service") isEqualTo 1) then{
  274. [] execVM "core\fn_setupStationService.sqf";
  275. };
  276. */
  277. [] spawn max_fuelstations_fnc_setupFuelStations;
  278.  
  279. if (life_HC_isActive) then {
  280. [getPlayerUID player,player getVariable["realname",name player]] remoteExec ["HC_fnc_wantedProfUpdate",HC_Life];
  281. } else {
  282. [getPlayerUID player,player getVariable["realname",name player]] remoteExec ["life_fnc_wantedProfUpdate",RSERV];
  283. };
  284.  
  285. [getPlayerUID player] remoteExecCall ["max_facture_fnc_getWaitingFactures",2];
  286. [] spawn max_phone_fnc_initPhone;
  287. [player] remoteExec ["the_programmer_identity_fnc_request",2];
  288.  
  289. {
  290. _dbInfo = _x getVariable ["dbInfo",[]];
  291. if (count _dbInfo > 0) then {
  292. _uid = _dbInfo select 0;
  293. if (_uid isEqualTo (getPlayerUID player)) then {
  294. [(getPlayerUID player),(side player),_x,1] call TON_fnc_keyManagement;
  295. };
  296. };
  297. } forEach allMissionObjects "LandVehicle";
  298.  
  299. [] execVM "scripts\disableChat.sqf";
  300. [] call compile preprocessFileLineNumbers "scripts\autosave\fn_autosave.sqf";
  301.  
  302. diag_log "----------------------------------------------------------------------------------------------------";
  303. diag_log format[" End of Altis Life Client Init :: Total Execution Time %1 seconds ",(diag_tickTime) - _timeStamp];
  304. diag_log "----------------------------------------------------------------------------------------------------";
  305.  
  306. 5 fadeSound 1;
  307. 0 fadeMusic 1;
  308. 0 fadeRadio 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement