Advertisement
skynix

Untitled

Jan 3rd, 2022
792
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 10.11 KB | None | 0 0
  1. #include "..\script_macros.hpp"
  2. /*
  3.     File: init.sqf
  4.     Author: Bryan "Tonic" Boardwine
  5.     Description:
  6.     Master client initialization file
  7. */
  8. diag_log "----------------------------------------------------------------------------------------------------";
  9. diag_log "--------------------------------- Starting Altis Life Client Init ----------------------------------";
  10. diag_log format["------------------------------------------ Version %1 -------------------------------------------",(LIFE_SETTINGS(getText,"framework_version"))];
  11. diag_log "----------------------------------------------------------------------------------------------------";
  12.  
  13. 0 cutText[localize "STR_Init_ClientSetup","BLACK FADED",99999999];
  14. _timeStamp = diag_tickTime;
  15.  
  16. waitUntil {!isNull (findDisplay 46)};
  17. enableSentences false;
  18.  
  19. diag_log "[Life Client] Initialization Variables";
  20. [] call compile preprocessFileLineNumbers "core\configuration.sqf";
  21. diag_log "[Life Client] Variables initialized";
  22.  
  23. diag_log "[Life Client] Setting up Eventhandlers";
  24. [] call life_fnc_setupEVH;
  25. diag_log "[Life Client] Eventhandlers completed";
  26.  
  27. diag_log "[Life Client] Setting up user actions";
  28. [] call life_fnc_setupActions;
  29. diag_log "[Life Client] User actions completed";
  30.  
  31. diag_log "[Life Client] Waiting for the server to be ready...";
  32. waitUntil {!isNil "life_server_isReady" && {!isNil "life_server_extDB_notLoaded"}};
  33.  
  34. if (life_server_extDB_notLoaded) exitWith {
  35.     0 cutText [localize "STR_Init_ExtdbFail","BLACK FADED",99999999];
  36. };
  37.  
  38. waitUntil {life_server_isReady};
  39. diag_log "[Life Client] Server loading completed ";
  40. 0 cutText [localize "STR_Init_ServerReady","BLACK FADED",99999999];
  41.  
  42. [] call SOCK_fnc_dataQuery;
  43. waitUntil {life_session_completed};
  44. 0 cutText[localize "STR_Init_ClientFinish","BLACK FADED",99999999];
  45.  
  46. [] spawn life_fnc_escInterupt;
  47.  
  48. switch (playerSide) do {
  49.     case west: {
  50.         life_paycheck = LIFE_SETTINGS(getNumber,"paycheck_cop");
  51.  
  52.         switch (call life_coplevel) do {
  53.             case 1 : {life_paycheck = 1050;};
  54.             case 2 : {life_paycheck = 1100};
  55.             case 3 : {life_paycheck = 1200};
  56.             case 4 : {life_paycheck = 1300};
  57.             case 5 : {life_paycheck = 1400};
  58.             case 6 : {life_paycheck = 1500};
  59.             case 7 : {life_paycheck = 1600};
  60.             case 8 : {life_paycheck = 1700};
  61.             case 9 : {life_paycheck = 2000};
  62.             case 10 : {life_paycheck = 2300};
  63.             case 11 : {life_paycheck = 2600};
  64.             case 12 : {life_paycheck = 3100};
  65.             case 13 : {life_paycheck = 3500};
  66.             default {};
  67.         };
  68.  
  69.         [] call life_fnc_initCop;
  70.     };
  71.     case civilian: {
  72.         life_paycheck = LIFE_SETTINGS(getNumber,"paycheck_civ");
  73.         if (license_civ_depanneur) then {life_paycheck = 2700;}; // <---------- Ici
  74.         if (license_civ_dir) then {life_paycheck = 2950;};
  75.         if (license_civ_brinks) then {life_paycheck = 1790;};
  76.         if (license_civ_procureur) then {life_paycheck = 2500;};
  77.         if (license_civ_substitut) then {life_paycheck = 1900;};
  78.         [] call life_fnc_initCiv;
  79.     };
  80.     case independent: {
  81.         life_paycheck = LIFE_SETTINGS(getNumber,"paycheck_med");
  82.  
  83.         switch (call life_medicLevel) do {
  84.             case 1 : {life_paycheck = 1200;};
  85.             case 2 : {life_paycheck = 1200};
  86.             case 3 : {life_paycheck = 1500};
  87.             case 4 : {life_paycheck = 1500};
  88.             case 5 : {life_paycheck = 3500};
  89.             default {};
  90.         };
  91.  
  92.         [] call life_fnc_initMedic;
  93.     };
  94. };
  95. life_paycheck = compile (if (life_paycheck isEqualType "") then { life_paycheck} else {str(life_paycheck)});
  96.  
  97. player setVariable ["restrained", false, true];
  98. player setVariable ["Escorting", false, true];
  99. player setVariable ["transporting", false, true];
  100. player setVariable ["playerSurrender", false, true];
  101. player setVariable ["realname", profileName, true];
  102.  
  103. diag_log "[Life Client] Past Settings Init";
  104. diag_log "[Life Client] Executing client.fsm";
  105.  
  106. if (isNil "The_programmer_initialised") then { (findDisplay 46) displayAddEventHandler ["KeyDown", "_this call life_fnc_keyHandler"];};
  107. [player, life_settings_enableSidechannel, playerSide] remoteExecCall ["TON_fnc_manageSC", RSERV];
  108. IS_HUD_HANDLE = [] spawn IS_RadialHUD_fnc_updateHUD;
  109. [] spawn life_fnc_survival;
  110. waitUntil {(missionNamespace getVariable ["life_perksInitialized", true])};
  111. life_paycheck = life_paycheck * (missionNamespace getVariable
  112. ["mav_ttm_var_paycheckMultiplier", 1]);
  113.  
  114. 0 cutText ["","BLACK IN"];
  115.  
  116. [] spawn {
  117.     for "_i" from 0 to 1 step 0 do {
  118.         waitUntil {(!isNull (findDisplay 49)) && {(!isNull (findDisplay 602))}}; // Check if Inventory and ESC dialogs are open
  119.         (findDisplay 49) closeDisplay 2; // Close ESC dialog
  120.         (findDisplay 602) closeDisplay 2; // Close Inventory dialog
  121.     };
  122. };
  123.  
  124. addMissionEventHandler ["EachFrame", life_fnc_playerTags];
  125. addMissionEventHandler ["EachFrame", life_fnc_revealObjects];
  126.  
  127. if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 0) then {player enableFatigue false;};
  128.  
  129. life_fnc_RequestClientId = player;
  130. publicVariableServer "life_fnc_RequestClientId";
  131.  
  132. /*
  133.     https://feedback.bistudio.com/T117205 - disableChannels settings cease to work when leaving/rejoining mission
  134.     Universal workaround for usage in a preInit function. - AgentRev
  135.     Remove if Bohemia actually fixes the issue.
  136. */
  137. /*
  138. {
  139.     _x params [["_chan",-1,[0]], ["_noText","false",[""]], ["_noVoice","false",[""]]];
  140.  
  141.     _noText = [false,true] select ((["false","true"] find toLower _noText) max 0);
  142.     _noVoice = [false,true] select ((["false","true"] find toLower _noVoice) max 0);
  143.  
  144.     _chan enableChannel [!_noText, !_noVoice];
  145.  
  146. } forEach getArray (missionConfigFile >> "disableChannels");*/
  147.  
  148. if (life_HC_isActive) then {
  149.     [getPlayerUID player, player getVariable ["realname", name player]] remoteExec ["HC_fnc_wantedProfUpdate", HC_Life];
  150. } else {
  151.     [getPlayerUID player, player getVariable ["realname", name player]] remoteExec ["life_fnc_wantedProfUpdate", RSERV];
  152. };
  153.  
  154.  
  155. diag_log "----------------------------------------------------------------------------------------------------";
  156. diag_log format ["               End of Altis Life Client Init :: Total Execution Time %1 seconds ",(diag_tickTime - _timeStamp)];
  157. diag_log "----------------------------------------------------------------------------------------------------";
  158.  
  159. MAC_fnc_switchMove = {
  160.     private["_object","_anim"];
  161.     _object = _this select 0;
  162.     _anim = _this select 1;
  163.     _object switchMove _anim;
  164. };
  165. [] spawn theprogrammer_core_fnc_clientInit;
  166. [] spawn The_programmer_Duty_fnc_init_Service;
  167.  
  168. // John si ça marche pas c' est pas normal
  169. [] spawn john_fnc_initscript;
  170. /////////////////////////////////////
  171. // Réglage Task Force Radio //
  172. /////////////////////////////////////
  173. tf_radio_channel_name = "TaskForceRadio"; // Nom du Channel TeamSpeak
  174. tf_radio_channel_password = "1456745965"; // Mot de passe du channel TeamSpeak
  175. TF_terrain_interception_coefficient = 10; // Réglage de l'interception sur le terrain
  176. player setVariable ["tf_unable_to_use_radio", false]; // Permet d'autoriser la radio ou non ( False = autoriser, true = refuser )
  177. tf_no_auto_long_range_radio = false; // Permet de donner une radio long porter ou non
  178. /*
  179.     Author: Maxence for The Programmer Forum
  180.  
  181.     Description: Task Force Radio Check
  182.  
  183. [] spawn {
  184.     _teamspeakName = "[FR] - Ohana Life ";
  185.     _temspeakAdress = "54.38.176.26";
  186.     _channelName = "TaskForceRadio";
  187.  
  188.     // Editing code below is not recommended
  189.    _isAdmin = false;
  190.    private _id = ["76561198267925413", "76561198144442659", "76561199114587134", "76561198816897499", "76561198360163834"];
  191.     if !(isNil "life_adminlevel") then {
  192.         if ((_id find (getPlayerUID player)) != -1) then {
  193.             _isAdmin = true;
  194.             titleText ["La vérification de présence dans le canal Task Force Radio est désactivé comme vous êtes admin !","BLACK IN"];
  195.         };
  196.     };
  197.     if (_isAdmin) exitWith {};
  198.  
  199.     if (isNil "TFAR_fnc_isTeamSpeakPluginEnabled") exitwith {
  200.         999999 cutText ["Task Force Radio n'est pas activé pas sur votre ordinateur. Veuillez re-synchroniser et réessayer","BLACK FADED"];
  201.         999999 cutFadeOut 99999999;
  202.     };
  203.  
  204.     _tfarEnabled = true;
  205.     _playerOnTeamspeak = true;
  206.     _playerInChannel = false;
  207.     _sleep = 2;
  208.     _alreadyKnow = false;
  209.  
  210.     while {true} do {
  211.         if !([] call TFAR_fnc_isTeamSpeakPluginEnabled) then {
  212.             titleText ["Veuillez activer Task Force Radio dans vos plugins teamspeak ! Pour ce faire, rendez-vous dans l'onglet réglages de teamspeak puis plugins et activez-le.", "BLACK"];
  213.             _tfarEnabled = false;
  214.         } else {
  215.             _tfarEnabled = true;
  216.         };
  217.  
  218.         if !(_teamspeakName == (call TFAR_fnc_getTeamSpeakServerName)) then {
  219.             titleText [format ["Veuillez rejoindre notre teamspeak : %1",_temspeakAdress], "BLACK"];
  220.             _playerOnTeamspeak = false;
  221.         } else {
  222.             _playerOnTeamspeak = true;
  223.         };
  224.  
  225.         if !(_channelName == (call TFAR_fnc_getTeamSpeakChannelName)) then {
  226.             titleText ["Veuillez 'reload' votre plugin Task Force Radio pour être déplacer dans le canal vocal ! Pour ce faire rendez-vous dans les réglages de teamspeak puis plugins puis appuyez sur le bouton 'relaod'.", "BLACK"];
  227.             _playerInChannel = false;
  228.         } else {
  229.             _playerInChannel = true;
  230.         };
  231.  
  232.         if (_tfarEnabled && _playerOnTeamspeak && _playerInChannel) then {
  233.             if !(_alreadyKnow) then {
  234.                 titleText ["Task Force Radio est bien initialisé, bienvenue !","BLACK IN"];
  235.                 _alreadyKnow = true;
  236.             };
  237.             _sleep = 5;
  238.         } else {
  239.             _alreadyKnow = false;
  240.             _sleep = 2;
  241.         };
  242.        
  243.         sleep _sleep;
  244.     };
  245. };
  246. */
  247. //feux
  248. call life_fnc_initAddAction;
  249. [] spawn life_fnc_spawnFire;
  250. //DISPARITION DES QUADS SUR LA MAP (pour les tuyaux)
  251. {
  252.     if ((typeOf _x) isEqualTo "B_Quadbike_01_F" ) then {
  253.         _x hideObject true;
  254.     };
  255. } forEach vehicles;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement