désolé mah je n'ai pas l'impression que cela fonctionne correctement. tu as une idée de ce que j'ai fais de travers ?
[CODE title="initPlayerLocal.sqf"]#include "script_macros.hpp"
/*
File: initPlayerLocal.sqf
Author:
Description:
Starts the initialization of the player.
*/
if (!hasInterface && !isServer) exitWith {
[] call compile preprocessFileLineNumbers "\life_hc\initHC.sqf";
};
CONST(BIS_fnc_endMission,BIS_fnc_endMission);
if (LIFE_SETTINGS(getNumber,"spyGlass_toggle") isEqualTo 1) then {[] execVM "SpyGlass\fn_initSpy.sqf";};
[] execVM "core\init.sqf";
[] execVM "briefing.sqf";
[] execVM "core\functions\fn_markers.sqf";[/CODE]
[CODE title="init.sqf"]#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)};
[] call compile preprocessFileLineNumbers "core\clientValidator.sqf";
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");
[] call life_fnc_initCop;
};
case civilian: {
life_paycheck = LIFE_SETTINGS(getNumber,"paycheck_civ");
[] call life_fnc_initCiv;
};
case independent: {
life_paycheck = LIFE_SETTINGS(getNumber,"paycheck_med");
[] call life_fnc_initMedic;
};
};
CONSTVAR(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";
[] execFSM "core\fsm\client.fsm";
diag_log "[Life Client] Executing client.fsm";
(findDisplay 46) displayAddEventHandler ["KeyDown", "_this call life_fnc_keyHandler"];
[player, life_settings_enableSidechannel, playerSide] remoteExecCall ["TON_fnc_manageSC", RSERV];
[] spawn life_fnc_survival;
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;};
if (LIFE_SETTINGS(getNumber,"pump_service") isEqualTo 1) then {
[] execVM "core\fn_setupStationService.sqf";
};
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];
};
[] call life_fnc_hudSetup;
diag_log "----------------------------------------------------------------------------------------------------";
diag_log format [" End of Altis Life Client Init :: Total Execution Time %1 seconds ",(diag_tickTime - _timeStamp)];
diag_log "----------------------------------------------------------------------------------------------------";
[] execVM "core\functions\fn_markers.sqf";[/CODE]
[CODE title="fn_markers.sqf"]/*
Author: Yuri Zoko
Web site: www.the-programmer.com
Discord: discord.the-programmer.com
Terms of use:
- This file is forbidden unless you have permission from the author. If you have this file without permission to use it please do not use it and do not share it.
- If you have permission to use this file, you can use it on your server however it is strictly forbidden to share it.
- Out of respect for the author please do not delete this information.
*/
_illegal = ["heroin_1",
"heroin_p",
"heroin_area",
"cocaine_1",
"cocaine_processing",
"coke_area",
"weed_1",
"Weed_p_1",
"weed_area",
"gold_bar_dealer","];
{_x setMarkerAlphaLocal 0}foreach _illegal;
if (license_civ_bandit) then {
{_x setMarkerAlphaLocal 1}foreach ["gold_bar_dealer",
"cocaine_1",
"cocaine_processing",
"coke_area",
"weed_area",
"weed_1",
"Weed_p_1"];
};
if (license_civ_rebel) then {
{_x setMarkerAlphaLocal 1}foreach ["gold_bar_dealer",
"heroin_1",
"heroin_p",
"heroin_area",
"cocaine_1",
"cocaine_processing",
"coke_area",
"weed_area",
"weed_1",
"Weed_p_1"];
};
[/CODE]