Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "..\script_macros.hpp"
- /*
- File: init.sqf
- Author: Bryan "Tonic" Boardwine
- Description:
- Master client initialization file
- */
- diag_log "----------------------------------------------------------------------------------------------------";
- diag_log "--------------------------------- Starting Altis Life Client Init ----------------------------------";
- diag_log format["------------------------------------------ Version %1 -------------------------------------------",(LIFE_SETTINGS(getText,"framework_version"))];
- diag_log "----------------------------------------------------------------------------------------------------";
- 0 cutText[localize "STR_Init_ClientSetup","BLACK FADED",99999999];
- _timeStamp = diag_tickTime;
- waitUntil {!isNull (findDisplay 46)};
- enableSentences false;
- diag_log "[Life Client] Initialization Variables";
- [] call compile preprocessFileLineNumbers "core\configuration.sqf";
- diag_log "[Life Client] Variables initialized";
- diag_log "[Life Client] Setting up Eventhandlers";
- [] call life_fnc_setupEVH;
- diag_log "[Life Client] Eventhandlers completed";
- diag_log "[Life Client] Setting up user actions";
- [] call life_fnc_setupActions;
- diag_log "[Life Client] User actions completed";
- diag_log "[Life Client] Waiting for the server to be ready...";
- waitUntil {!isNil "life_server_isReady" && {!isNil "life_server_extDB_notLoaded"}};
- if (life_server_extDB_notLoaded) exitWith {
- 0 cutText [localize "STR_Init_ExtdbFail","BLACK FADED",99999999];
- };
- waitUntil {life_server_isReady};
- diag_log "[Life Client] Server loading completed ";
- 0 cutText [localize "STR_Init_ServerReady","BLACK FADED",99999999];
- [] call SOCK_fnc_dataQuery;
- waitUntil {life_session_completed};
- 0 cutText[localize "STR_Init_ClientFinish","BLACK FADED",99999999];
- [] spawn life_fnc_escInterupt;
- switch (playerSide) do {
- case west: {
- life_paycheck = LIFE_SETTINGS(getNumber,"paycheck_cop");
- switch (call life_coplevel) do {
- case 1 : {life_paycheck = 1050;};
- case 2 : {life_paycheck = 1100};
- case 3 : {life_paycheck = 1200};
- case 4 : {life_paycheck = 1300};
- case 5 : {life_paycheck = 1400};
- case 6 : {life_paycheck = 1500};
- case 7 : {life_paycheck = 1600};
- case 8 : {life_paycheck = 1700};
- case 9 : {life_paycheck = 2000};
- case 10 : {life_paycheck = 2300};
- case 11 : {life_paycheck = 2600};
- case 12 : {life_paycheck = 3100};
- case 13 : {life_paycheck = 3500};
- default {};
- };
- [] call life_fnc_initCop;
- };
- case civilian: {
- life_paycheck = LIFE_SETTINGS(getNumber,"paycheck_civ");
- if (license_civ_depanneur) then {life_paycheck = 2700;}; // <---------- Ici
- if (license_civ_dir) then {life_paycheck = 2950;};
- if (license_civ_brinks) then {life_paycheck = 1790;};
- if (license_civ_procureur) then {life_paycheck = 2500;};
- if (license_civ_substitut) then {life_paycheck = 1900;};
- [] call life_fnc_initCiv;
- };
- case independent: {
- life_paycheck = LIFE_SETTINGS(getNumber,"paycheck_med");
- switch (call life_medicLevel) do {
- case 1 : {life_paycheck = 1200;};
- case 2 : {life_paycheck = 1200};
- case 3 : {life_paycheck = 1500};
- case 4 : {life_paycheck = 1500};
- case 5 : {life_paycheck = 3500};
- default {};
- };
- [] call life_fnc_initMedic;
- };
- };
- life_paycheck = compile (if (life_paycheck isEqualType "") then { life_paycheck} else {str(life_paycheck)});
- player setVariable ["restrained", false, true];
- player setVariable ["Escorting", false, true];
- player setVariable ["transporting", false, true];
- player setVariable ["playerSurrender", false, true];
- player setVariable ["realname", profileName, true];
- diag_log "[Life Client] Past Settings Init";
- diag_log "[Life Client] Executing client.fsm";
- if (isNil "The_programmer_initialised") then { (findDisplay 46) displayAddEventHandler ["KeyDown", "_this call life_fnc_keyHandler"];};
- [player, life_settings_enableSidechannel, playerSide] remoteExecCall ["TON_fnc_manageSC", RSERV];
- IS_HUD_HANDLE = [] spawn IS_RadialHUD_fnc_updateHUD;
- [] spawn life_fnc_survival;
- waitUntil {(missionNamespace getVariable ["life_perksInitialized", true])};
- life_paycheck = life_paycheck * (missionNamespace getVariable
- ["mav_ttm_var_paycheckMultiplier", 1]);
- 0 cutText ["","BLACK IN"];
- [] spawn {
- for "_i" from 0 to 1 step 0 do {
- waitUntil {(!isNull (findDisplay 49)) && {(!isNull (findDisplay 602))}}; // Check if Inventory and ESC dialogs are open
- (findDisplay 49) closeDisplay 2; // Close ESC dialog
- (findDisplay 602) closeDisplay 2; // Close Inventory dialog
- };
- };
- addMissionEventHandler ["EachFrame", life_fnc_playerTags];
- addMissionEventHandler ["EachFrame", life_fnc_revealObjects];
- if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 0) then {player enableFatigue false;};
- life_fnc_RequestClientId = player;
- publicVariableServer "life_fnc_RequestClientId";
- /*
- https://feedback.bistudio.com/T117205 - disableChannels settings cease to work when leaving/rejoining mission
- Universal workaround for usage in a preInit function. - AgentRev
- Remove if Bohemia actually fixes the issue.
- */
- /*
- {
- _x params [["_chan",-1,[0]], ["_noText","false",[""]], ["_noVoice","false",[""]]];
- _noText = [false,true] select ((["false","true"] find toLower _noText) max 0);
- _noVoice = [false,true] select ((["false","true"] find toLower _noVoice) max 0);
- _chan enableChannel [!_noText, !_noVoice];
- } forEach getArray (missionConfigFile >> "disableChannels");*/
- if (life_HC_isActive) then {
- [getPlayerUID player, player getVariable ["realname", name player]] remoteExec ["HC_fnc_wantedProfUpdate", HC_Life];
- } else {
- [getPlayerUID player, player getVariable ["realname", name player]] remoteExec ["life_fnc_wantedProfUpdate", RSERV];
- };
- diag_log "----------------------------------------------------------------------------------------------------";
- diag_log format [" End of Altis Life Client Init :: Total Execution Time %1 seconds ",(diag_tickTime - _timeStamp)];
- diag_log "----------------------------------------------------------------------------------------------------";
- MAC_fnc_switchMove = {
- private["_object","_anim"];
- _object = _this select 0;
- _anim = _this select 1;
- _object switchMove _anim;
- };
- [] spawn theprogrammer_core_fnc_clientInit;
- [] spawn The_programmer_Duty_fnc_init_Service;
- // John si ça marche pas c' est pas normal
- [] spawn john_fnc_initscript;
- /////////////////////////////////////
- // Réglage Task Force Radio //
- /////////////////////////////////////
- tf_radio_channel_name = "TaskForceRadio"; // Nom du Channel TeamSpeak
- tf_radio_channel_password = "1456745965"; // Mot de passe du channel TeamSpeak
- TF_terrain_interception_coefficient = 10; // Réglage de l'interception sur le terrain
- player setVariable ["tf_unable_to_use_radio", false]; // Permet d'autoriser la radio ou non ( False = autoriser, true = refuser )
- tf_no_auto_long_range_radio = false; // Permet de donner une radio long porter ou non
- /*
- Author: Maxence for The Programmer Forum
- Description: Task Force Radio Check
- [] spawn {
- _teamspeakName = "[FR] - Ohana Life ";
- _temspeakAdress = "54.38.176.26";
- _channelName = "TaskForceRadio";
- // Editing code below is not recommended
- _isAdmin = false;
- private _id = ["76561198267925413", "76561198144442659", "76561199114587134", "76561198816897499", "76561198360163834"];
- if !(isNil "life_adminlevel") then {
- if ((_id find (getPlayerUID player)) != -1) then {
- _isAdmin = true;
- titleText ["La vérification de présence dans le canal Task Force Radio est désactivé comme vous êtes admin !","BLACK IN"];
- };
- };
- if (_isAdmin) exitWith {};
- if (isNil "TFAR_fnc_isTeamSpeakPluginEnabled") exitwith {
- 999999 cutText ["Task Force Radio n'est pas activé pas sur votre ordinateur. Veuillez re-synchroniser et réessayer","BLACK FADED"];
- 999999 cutFadeOut 99999999;
- };
- _tfarEnabled = true;
- _playerOnTeamspeak = true;
- _playerInChannel = false;
- _sleep = 2;
- _alreadyKnow = false;
- while {true} do {
- if !([] call TFAR_fnc_isTeamSpeakPluginEnabled) then {
- 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"];
- _tfarEnabled = false;
- } else {
- _tfarEnabled = true;
- };
- if !(_teamspeakName == (call TFAR_fnc_getTeamSpeakServerName)) then {
- titleText [format ["Veuillez rejoindre notre teamspeak : %1",_temspeakAdress], "BLACK"];
- _playerOnTeamspeak = false;
- } else {
- _playerOnTeamspeak = true;
- };
- if !(_channelName == (call TFAR_fnc_getTeamSpeakChannelName)) then {
- 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"];
- _playerInChannel = false;
- } else {
- _playerInChannel = true;
- };
- if (_tfarEnabled && _playerOnTeamspeak && _playerInChannel) then {
- if !(_alreadyKnow) then {
- titleText ["Task Force Radio est bien initialisé, bienvenue !","BLACK IN"];
- _alreadyKnow = true;
- };
- _sleep = 5;
- } else {
- _alreadyKnow = false;
- _sleep = 2;
- };
- sleep _sleep;
- };
- };
- */
- //feux
- call life_fnc_initAddAction;
- [] spawn life_fnc_spawnFire;
- //DISPARITION DES QUADS SUR LA MAP (pour les tuyaux)
- {
- if ((typeOf _x) isEqualTo "B_Quadbike_01_F" ) then {
- _x hideObject true;
- };
- } forEach vehicles;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement