Français Solved Synchronisation entre Framework Tonic et ACE Médical

21/3/20
75
2
1
450
Bonjour touts le monde je voudrai savoir si il est posible de synchronisée la Framework de tonic et ace médical ( en gros quand on meurent on à le menu de tonic qui apparait avec "respawn" et "request medic" et quand un réanime avec le défibrillateur de tonic les blessure ace ne sont plus la)

Je voudrai savoir si il est posible de soit garder que le système ace et apres un temps défini mettre directement le menu de respawn
ou
Garder les blessure de ace apres la réanimation au défibrillateur.
 
Dernière édition par un modérateur:
Solution
C'est assez simple finalement :

1) tu créer une lige dans le core\setupEVH.sqf :
Code:
["ace_unconscious", {_this spawn life_fnc_isUnconscious}] call CBA_fnc_addEventHandler;

Ensuite tu créer un fichier dans le core\medical que tu appel "fn_isUnconscious.sqf" et tu mets dedans :
Code:
#include "..\..\script_macros.hpp"

/*
    Author: Yuri Zoko
    Discord: Yuri Zoko#9511

    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...
Salut, désolé du retard ^^'

Pour les markers lors du request medic :

Creéz un nouveau fichier "fn_aceRequestMedic.sqf" dans le dossier core/medical et met dedans :

Code:
/*
    Author: Yuri Zoko
    Discord: Yuri Zoko#9511

    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.

*/
private _in = {
    private _arr = _this select 0;
    private _name = _this select 1;

    (_arr findIf { (_x select 1) isEqualTo _name }) > -1;
};

private _deadMarkers = [];
while {true} do
{
    {
        private _deadMarkerName = format ["%1_dead_marker", _x];
        if (_x getVariable ["ACE_isUnconscious", false]) then
        {
            if ([_deadMarkers, _deadMarkerName] call _in) then
            {
                _deadMarkerName setMarkerPosLocal (visiblePosition _x);
            }
            else
            {
                _marker = createMarkerLocal [_deadMarkerName, visiblePosition _x];
                _marker setMarkerColorLocal "ColorRed";
                _marker setMarkerTypeLocal "loc_Hospital";
                _marker setMarkerTextLocal "Coma";
                _deadMarkers pushBack [_x, _marker];
            };
        }
        else
        {
            if ([_deadMarkers, _deadMarkerName] call _in) then
            {
                private _unit = _x;
                deleteMarkerLocal _deadMarkerName;
                _deadMarkers deleteAt (_deadMarkers findIf { (_x select 0) isEqualTo _unit });
            };
        };
    } forEach playableUnits;

    {
        if (isNull (_x select 0) || { !((_x select 0) getVariable ["ACE_isUnconscious", false]) }) then
        {
            private _currMarker = _x select 1;
            deleteMarkerLocal _currMarker;
            _deadMarkers deleteAt (_deadMarkers findIf { (_x select 1) isEqualTo _currMarker });
        };
    } forEach _deadMarkers;
    sleep 0.5;
};

Déclare ton fichier dans le Functions.hpp dans la class Medical.

Dans ton init_medic.sqf, ajoutes cette ligne :

Code:
[] spawn life_fnc_aceRequestMedic;


Pour les dommages ACE après la mort :

dans ton spawnMenu.sqf, au dessus de
Code:
cutText["","BLACK FADED"];

Ajoutes :

Code:
if((player getVariable ["ACE_isUnconscious",false])) then {
    [player,player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;
};
 
Salut merci beaucoups

Ducoup j'ajoute aussi ca en plus de ce que tu viens de me dire ?
C'est assez simple finalement :

1) tu créer une lige dans le core\setupEVH.sqf :
Code:
["ace_unconscious", {_this spawn life_fnc_isUnconscious}] call CBA_fnc_addEventHandler;

Ensuite tu créer un fichier dans le core\medical que tu appel "fn_isUnconscious.sqf" et tu mets dedans :
Code:
#include "..\..\script_macros.hpp"

/*
    Author: Yuri Zoko
    Discord: Yuri Zoko#9511

    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.

*/

params [
    ["_unit",objNull,[objNull]]
];
disableSerialization;

//close the esc dialog
if (dialog) then {
    closeDialog 0;
};

sleep 5;

if(!(player getVariable ["ACE_isUnconscious",false])) exitWith {};

    createDialog "DeathScreen";
    (findDisplay 7300) displaySetEventHandler ["KeyDown","if ((_this select 1) isEqualTo 1) then {true}"]; //Block the ESC menu

    //Create a thread for something?
    _unit spawn {
        private ["_maxTime","_RespawnBtn","_Timer"];
        disableSerialization;
        _RespawnBtn = ((findDisplay 7300) displayCtrl 7302);
        _Timer = ((findDisplay 7300) displayCtrl 7301);
        if (LIFE_SETTINGS(getNumber,"respawn_timer") < 5) then {
            _maxTime = time + 5;
        } else {
            _maxTime = time + LIFE_SETTINGS(getNumber,"respawn_timer");
        };
        _RespawnBtn ctrlEnable false;
        waitUntil {
            _Timer ctrlSetText format [localize "STR_Medic_Respawn",[(_maxTime - time),"MM:SS"] call BIS_fnc_secondsToString];
            round(_maxTime - time) <= 0 || isNull _this
        };
        _RespawnBtn ctrlEnable true;
        _Timer ctrlSetText localize "STR_Medic_Respawn_2";
    };

    _unit spawn {
        disableSerialization;
        private _requestBtn = ((findDisplay 7300) displayCtrl 7303);
        _requestBtn ctrlEnable false;
        private _requestTime = time + 5;
        waitUntil {round(_requestTime - time) <= 0 || isNull _this};
        _requestBtn ctrlEnable true;
    };

    [] spawn life_fnc_deathScreen;

    //Create a thread to follow with some what precision view of the corpse.
  
    life_save_gear = [player] call life_fnc_fetchDeadGear;

Ensuite tu retires cette partie du fn_onPlayerKilled.sqf qui se trouve aussi dans le core\medical :
Code:
createDialog "DeathScreen";
    (findDisplay 7300) displaySetEventHandler ["KeyDown","if ((_this select 1) isEqualTo 1) then {true}"]; //Block the ESC menu

    //Create a thread for something?
    _unit spawn {
        private ["_maxTime","_RespawnBtn","_Timer"];
        disableSerialization;
        _RespawnBtn = ((findDisplay 7300) displayCtrl 7302);
        _Timer = ((findDisplay 7300) displayCtrl 7301);
        if (LIFE_SETTINGS(getNumber,"respawn_timer") < 5) then {
            _maxTime = time + 5;
        } else {
            _maxTime = time + LIFE_SETTINGS(getNumber,"respawn_timer");
        };
        _RespawnBtn ctrlEnable false;
        waitUntil {
            _Timer ctrlSetText format [localize "STR_Medic_Respawn",[(_maxTime - time),"MM:SS"] call BIS_fnc_secondsToString];
            round(_maxTime - time) <= 0 || isNull _this
        };
        _RespawnBtn ctrlEnable true;
        _Timer ctrlSetText localize "STR_Medic_Respawn_2";
    };

    _unit spawn {
        disableSerialization;
        private _requestBtn = ((findDisplay 7300) displayCtrl 7303);
        _requestBtn ctrlEnable false;
        private _requestTime = time + 5;
        waitUntil {round(_requestTime - time) <= 0 || isNull _this};
        _requestBtn ctrlEnable true;
    };

    [] spawn life_fnc_deathScreen;

    //Create a thread to follow with some what precision view of the corpse.
  
    life_save_gear = [player] call life_fnc_fetchDeadGear;

Puis dans ton Functions.hpp, dans la class Medical rajoutes :
Code:
class isUnconscious {};
 
Salut, désolé du retard ^^'

Pour les markers lors du request medic :

Creéz un nouveau fichier "fn_aceRequestMedic.sqf" dans le dossier core/medical et met dedans :

Code:
/*
    Author: Yuri Zoko
    Discord: Yuri Zoko#9511

    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.

*/
private _in = {
    private _arr = _this select 0;
    private _name = _this select 1;

    (_arr findIf { (_x select 1) isEqualTo _name }) > -1;
};

private _deadMarkers = [];
while {true} do
{
    {
        private _deadMarkerName = format ["%1_dead_marker", _x];
        if (_x getVariable ["ACE_isUnconscious", false]) then
        {
            if ([_deadMarkers, _deadMarkerName] call _in) then
            {
                _deadMarkerName setMarkerPosLocal (visiblePosition _x);
            }
            else
            {
                _marker = createMarkerLocal [_deadMarkerName, visiblePosition _x];
                _marker setMarkerColorLocal "ColorRed";
                _marker setMarkerTypeLocal "loc_Hospital";
                _marker setMarkerTextLocal "Coma";
                _deadMarkers pushBack [_x, _marker];
            };
        }
        else
        {
            if ([_deadMarkers, _deadMarkerName] call _in) then
            {
                private _unit = _x;
                deleteMarkerLocal _deadMarkerName;
                _deadMarkers deleteAt (_deadMarkers findIf { (_x select 0) isEqualTo _unit });
            };
        };
    } forEach playableUnits;

    {
        if (isNull (_x select 0) || { !((_x select 0) getVariable ["ACE_isUnconscious", false]) }) then
        {
            private _currMarker = _x select 1;
            deleteMarkerLocal _currMarker;
            _deadMarkers deleteAt (_deadMarkers findIf { (_x select 1) isEqualTo _currMarker });
        };
    } forEach _deadMarkers;
    sleep 0.5;
};

Déclare ton fichier dans le Functions.hpp dans la class Medical.

Dans ton init_medic.sqf, ajoutes cette ligne :

Code:
[] spawn life_fnc_aceRequestMedic;


Pour les dommages ACE après la mort :

dans ton spawnMenu.sqf, au dessus de
Code:
cutText["","BLACK FADED"];

Ajoutes :

Code:
if((player getVariable ["ACE_isUnconscious",false])) then {
    [player,player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;
};
Salut après avoir tester les dommage acer sont toujours la après le respawn !