Français Not solved Ajouter les tags sur les players adac

  • Auteur de la discussion Auteur de la discussion Kawax Delta
  • Date de début Date de début
  • Bonjour Visiteur ! Les sujets de cette catégorie sont clos. Si vous souhaitez réouvrir, merci de nous contacter en précisant le lien du post à réouvrir !

    Hello Visiteur ! The topics in this category are closed. If you wish to reopen, please contact us with the link of the post you wish to reopen !
8/10/20
53
3
300
Bonsoir, j'ai un soucis avec le playerTags quand je veux ajouter une case pour les ADAC ça ne m'affiche rien au dessus de la tête in-game. Merci bonne soirée

Code:
if (!life_settings_tagson) exitWith {};
private ["_ui","_units","_masks"];
#define iconID 78000
#define scale 0.8

if (visibleMap || {!alive player} || {dialog}) exitWith {
    500 cutText["","PLAIN"];
};

_ui = uiNamespace getVariable ["Life_HUD_nameTags",displayNull];
if (isNull _ui) then {
    500 cutRsc["Life_HUD_nameTags","PLAIN"];
    _ui = uiNamespace getVariable ["Life_HUD_nameTags",displayNull];
};

_units = nearestObjects[(visiblePosition player),["CAManBase","Land_Pallet_MilBoxes_F","Land_Sink_F"],50];
_units = _units - [player];

_masks = LIFE_SETTINGS(getArray,"clothing_masks");

private _index = -1;
{
    private _texteID = format["ID : %1",_x getVariable ["id_player", 0]];
    private "_text";
    _idc = _ui displayCtrl (iconID + _forEachIndex);
    if (!(lineIntersects [eyePos player, eyePos _x, player, _x]) && alive _x && {!isNil "_texteID"}) then {
        _pos = switch (typeOf _x) do {
            case "Land_Pallet_MilBoxes_F": {[visiblePosition _x select 0, visiblePosition _x select 1, (getPosATL _x select 2) + 1.5]};
            case "Land_Sink_F": {[visiblePosition _x select 0, visiblePosition _x select 1, (getPosATL _x select 2) + 2]};
            default {[visiblePosition _x select 0, visiblePosition _x select 1, ((_x modelToWorld (_x selectionPosition "head")) select 2)+.5]};
        };
        _sPos = worldToScreen _pos;
        _distance = _pos distance player;
        if (life_invisible) exitWith {};
        if (!((headgear _x) in _masks || (goggles _x) in _masks || (uniform _x) in _masks)) then {
            if (count _sPos > 1 && {_distance < 15}) then {
                _text = switch (true) do
                {
                    case (_x in (units group player) && playerSide isEqualTo civilian):
                    {
                        format ["<t color='#00FF00'>%1 : %2</t>",_texteID, name _x];
                    };
                    case (life_god):
                    {
                        format["<t color='#990000'>ADMIN : %1 : %2</t>", _texteID, name _x];
                    }
                    case (side _x isEqualTo west && {!isNil {_x getVariable "rank"}}):
                    {
                        private _texte_format = "";
                        switch (playerSide) do
                        {
                            case civilian:
                            {
                                _texte_format = "<t size ='1'>%3</t>";
                            };
                            case west:
                            {
                                _texte_format = "<img image='%1' size='1'></img> <t size ='1'>%2</t><br/>%3<br/>%4";
                            };
                            case independent:
                            {
                                _texte_format = "<img image='%1' size='1'></img> <t size ='1'>%2</t><br/>%3<br/>%4";
                            };
                            case east:
                            {
                                _texte_format = "<img image='%1' size='1'></img> <t size ='1'>%2</t><br/>%3<br/>%4";
                            };
                        };
                        format [_texte_format,
                            switch ((_x getVariable "rank")) do
                            {
                                case 1: {"ui\grade-gn\Gav.paa"};
                                case 2: {"ui\grade-gn\Brigadier.paa"};
                                case 3: {"ui\grade-gn\Brigadier-Chef.paa"};
                                case 4: {"ui\grade-gn\Marechal.paa"};
                                case 5: {"ui\grade-gn\Gendarme.paa"};
                                case 6: {"ui\grade-gn\Marechal-Chef.paa"};
                                case 7: {"ui\grade-gn\Adjudant.paa"};
                                case 8: {"ui\grade-gn\Adjudant-Chef.paa"};
                                case 9: {"ui\grade-gn\Major.paa"};
                                case 10: {"ui\grade-gn\Sous-Lieutenant.paa"};
                                case 11: {"ui\grade-gn\Lieutenant.paa"};
                                case 12: {"ui\grade-gn\capitaine.paa"};
                                case 13: {"ui\grade-gn\Commandant.paa"};
                                case 14: {"ui\grade-gn\Lieutenant-Colonel.paa"};
                                case 15: {"ui\grade-gn\Colonel.paa"};
                                default  {"\a3\ui_f\data\gui\cfg\Ranks\private_gs.paa"};
                            },
                            switch ((_x getVariable "rank")) do
                            {
                                case 1: {"GAV"};
                                case 2: {"Brigadier"};
                                case 3: {"Brigadier-Chef"};
                                case 4: {"Maréchal des Logis"};
                                case 5: {"Gendarme"};
                                case 6: {"Maréchal des Logis Chef"};
                                case 7: {"Adjudant"};
                                case 8: {"Adjudant-Chef"};
                                case 9: {"Major"};
                                case 10: {"Sous-Lieutenant"};
                                case 11: {"Lieutenant"};
                                case 12: {"Capitaine"};
                                case 13: {"Commandant"};
                                case 14: {"Lieutenant-Colonel"};
                                case 15: {"Colonel"};
                            },
                            _texteID,
                            name _x];
                    };
                    case (side _x isEqualTo independent):
                    {
                        private _texte_format = "";
                        switch (playerSide) do
                        {
                            case civilian:
                            {
                                _texte_format = "<t size ='1'>%3</t>";
                            };
                            case west:
                            {
                                _texte_format = "<img image='%1' size='1'></img> <t size ='1'>%2</t><br/>%3<br/>%4";
                            };
                            case independent:
                            {
                                _texte_format = "<img image='%1' size='1'></img> <t size ='1'>%2</t><br/>%3<br/>%4";
                            };
                            case east:
                            {
                                _texte_format = "<img image='%1' size='1'></img> <t size ='1'>%2</t><br/>%3<br/>%4";
                            };
                        };
                        format [_texte_format,
                            switch ((_x getVariable "rank_medic")) do
                            {
                                case 1:  {"ui\sc\caporal1.paa"};
                                case 2:  {"ui\sc\caporal.paa"};
                                case 3:  {"ui\sc\caporal-chef.paa"};
                                case 4:  {"ui\sc\sergent.paa"};
                                case 5:  {"ui\sc\sergent-chef.paa"};
                                case 6:  {"ui\sc\adjudant.paa"};
                                case 7:  {"ui\sc\adjudant-chef.paa"};
                                case 8:  {"ui\sc\lieutenant.paa"};
                                case 9:  {"ui\sc\capitaine.paa"};
                                case 10: {"ui\sc\commandant.paa"};
                                case 11: {"ui\sc\lieutenant-colonel.paa"};
                                case 12: {"ui\sc\colonel.paa"};
                                case 13: {"ui\sc\expert.paa"};
                                default  {"a3\ui_f\data\gui\cfg\Ranks\private_gs.paa"};
                            },
                            switch ((_x getVariable "rank_medic")) do
                            {
                                case 1: {"2ème classe"};
                                case 2: {"1ère classe"};
                                case 3: {"Caporal"};
                                case 4: {"Caporal-Chef"};
                                case 5: {"Sergent"};
                                case 6: {"Sergent-Chef"};
                                case 7: {"Adjudant"};
                                case 8: {"Adjudant-Chef"};
                                case 9: {"Lieutenant"};
                                case 10: {"Capitaine"};
                                case 11: {"Commandant"};
                                case 12: {"Lieutenant-Colonel"};
                                case 13: {"Colonel"};
                            },
                            _texteID,
                            name _x];
                    };
                    case (side _x isEqualTo east && {!isNil {_x getVariable "rank_adac"}}):
                    {
                        private _texte_format = "";
                        switch (playerSide) do
                        {
                            case civilian:
                            {
                                _texte_format = "<t size ='1'>%3</t>";
                            };
                            case west:
                            {
                                _texte_format = "<img image='%1' size='1'></img> <t size ='1'>%2</t><br/>%3<br/>%4";
                            };
                            case independent:
                            {
                                _texte_format = "<img image='%1' size='1'></img> <t size ='1'>%2</t><br/>%3<br/>%4";
                            };
                            case east:
                            {
                                _texte_format = "<img image='%1' size='1'></img> <t size ='1'>%2</t><br/>%3<br/>%4";
                            };
                        };
                        format [_texte_format,
                            switch ((_x getVariable "rank_adac")) do
                            {
                                case 1: {"\AF_core\data\ui\grade-gn\Gav.paa"};
                                case 2: {"ui\grade-gn\Brigadier.paa"};
                                case 3: {"ui\grade-gn\Brigadier-Chef.paa"};
                                case 4: {"ui\grade-gn\Marechal.paa"};
                                case 5: {"ui\grade-gn\Gendarme.paa"};
                                case 6: {"ui\grade-gn\Marechal-Chef.paa"};
                                case 7: {"ui\grade-gn\Adjudant.paa"};
                                case 8: {"ui\grade-gn\Adjudant-Chef.paa"};
                                case 9: {"ui\grade-gn\Major.paa"};
                                case 10: {"ui\grade-gn\Aspirant.paa"};
                                case 11: {"ui\grade-gn\Sous-Lieutenant.paa"};
                                case 12: {"ui\grade-gn\Lieutenant.paa"};
                                case 13: {"ui\grade-gn\capitaine.paa"};
                                case 14: {"ui\grade-gn\Commandant.paa"};
                                case 15: {"ui\grade-gn\Lieutenant-Colonel.paa"};
                                case 16: {"ui\grade-gn\Lieutenant-Colonel.paa"};
                                case 17: {"ui\grade-gn\Lieutenant-Colonel.paa"};
                                default  {"\a3\ui_f\data\gui\cfg\Ranks\private_gs.paa"};
                            },
                            switch ((_x getVariable "rank_adac")) do
                            {
                                case 1: {"Chasseur 2C"};
                                case 2: {"Chasseur 1C"};
                                case 3: {"Caporal"};
                                case 4: {"Caporal-Chef "};
                                case 5: {"Sergent"};
                                case 6: {"Sergent-Chef"};
                                case 7: {"Adjudant"};
                                case 8: {"Adjudant-Chef"};
                                case 9: {"Major"};
                                case 10: {"Aspirant"};
                                case 11: {"Sous-Lieutenant"};
                                case 12: {"Lieutenant"};
                                case 13: {"Capitaine"};
                                case 14: {"Commandant"};
                                case 15: {"Lieutenant-Colonel"};
                                case 16: {"Colonel"};
                                case 17: {"Général de Division"};
                            },
                            _texteID,
                            name _x];
                    };
                    default
                    {
                        if (!isNil {(group _x) getVariable "gang_name"}) then {
                            format ["%1<br/><t size='0.8' color='#B6B6B6'>%2</t>",_texteID/*(group _x) getVariable ["gang_name",""]*/];
                        } else {
                            if (alive _x) then {
                                _texteID;
                            } else {
                                if (!isPlayer _x) then {
                                    _x getVariable ["realname","ERROR"];
                                };
                            };
                        };
                    };
                };
    
                _idc ctrlSetStructuredText parseText _text;
                _idc ctrlSetPosition [_sPos select 0, _sPos select 1, 0.4, 0.65];
                _idc ctrlSetScale scale;
                _idc ctrlSetFade 0;
                _idc ctrlCommit 0;
                _idc ctrlShow true;
            } else {
                _idc ctrlShow false;
            };
        } else {
            _idc ctrlShow false;
        };
    } else {
        _idc ctrlShow false;
    };
    _index = _forEachIndex;
} forEach _units;
(_ui displayCtrl (iconID + _index + 1)) ctrlSetStructuredText parseText "";
 
--- Ce message a été généré automatiquement par ChatGPT, le contenu peut être incorrect. Veuillez lire le message avec précaution ! ---

Bonsoir, il semble que le problème pourrait être lié à la position du texte affiché au-dessus de la tête du joueur. Assurez-vous que les conditions pour afficher les PlayerTags sont remplies et que la position du texte est correctement définie. Vérifiez également les différents cas et conditions pour afficher les informations correctes en fonction des rangs et des côtés des joueurs. N'oubliez pas de contrôler la visibilité en fonction de la distance et des conditions spécifiques. Bonne soirée!

--- Pour continuer la discussion avec ChatGPT, cliquez sur "Répondre" en bas à droite de ce message. Sinon, attendez que quelqu'un vous réponde. ---