Français Solved Problème avec fn_playerTags.sqf

  • Auteur de la discussion Auteur de la discussion Said
  • Date de début Date de début

Said

User
29/12/19
131
16
12
1 100
Bonsoir, j'ai un petit soucis avec mon fn_playerTags.sqf je n'ai plus l'id de la personne qui s'affiche au dessus de sa tète il fonctionnais parfaitement il a quelque jours mais la il a décider de ne plus fonctionné. Si une personne aurais une idée sa serais cool.



Code:
#include "..\..\script_macros.hpp"
/*
    File: fn_playerTags.sqf
    Author: Bryan "Tonic" Boardwine
 
    Description:
    Adds the tags above other players heads when close and have visible range.
*/
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 (!((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</t>",_texteID];
                    };
                    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";
                            };
                        };
                      
                        format [_texte_format,
                        switch ((_x getVariable "rank")) do
                        {
                            case 1:  {"Eventia_Textures\Data\Police\Recrue.paa"};
                            case 2:  {"Eventia_Textures\Data\Police\Brigadier.paa"};
                            case 3:  {"Eventia_Textures\Data\Police\Brigadier_Chef.paa"};
                            case 4:  {"Eventia_Textures\Data\Police\Sergent.paa"};
                            case 5:  {"Eventia_Textures\Data\Police\Sergent_Chef.paa"};
                            case 6:  {"Eventia_Textures\Data\Police\Adjudant.paa"};
                            case 7:  {"Eventia_Textures\Data\Police\Adjudant_Chef.paa"};
                            case 8:  {"Eventia_Textures\Data\Police\Major.paa"};
                            case 9:  {"Eventia_Textures\Data\Police\Lieutenant.paa"};
                            case 10: {"Eventia_Textures\Data\Police\Capitaine.paa"};
                            case 11: {"Eventia_Textures\Data\Police\Commandant.paa"};
                            case 12: {"Eventia_Textures\Data\Police\Lieutenant_Co.paa"};
                            case 13: {"Eventia_Textures\Data\Police\Colonel.paa"};
                            case 14: {"Eventia_Textures\Data\Police\General.paa"};
                            default  {"\a3\ui_f\data\gui\cfg\Ranks\private_gs.paa"};
                        },
                        switch ((_x getVariable "rank")) do
                        {
                            case 1: {"Recrue"};
                            case 2: {"Brigadier"};
                            case 3: {"Brigadier-Chef"};
                            case 4: {"Sergent"};
                            case 5: {"Sergent-Chef"};
                            case 6: {"Adjudant"};
                            case 7: {"Adjudant-Chef"};
                            case 8: {"Major"};
                            case 9: {"Lieutenant"};
                            case 10: {"Capitaine"};
                            case 11: {"Commandant"};
                            case 12: {"Lieutenant-Colonel"};
                            case 13: {"Colonel"};
                            case 14: {"Général"};
                        },
                        _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";
                            };
                        };
 
                        format [_texte_format,
                        switch ((_x getVariable "rank_medic")) do
                        {
                            case 1:  {"Eventia_Textures\Data\SP\2nd.paa"};
                            case 2:  {"Eventia_Textures\Data\SP\1eresp.paa"};
                            case 3:  {"Eventia_Textures\Data\SP\caposp.paa"};
                            case 4:  {"Eventia_Textures\Data\SP\capocsp.paa"};
                            case 5:  {"Eventia_Textures\Data\SP\sgsp.paa"};
                            case 6:  {"Eventia_Textures\Data\SP\sgscsp.paa"};
                            case 7:  {"Eventia_Textures\Data\SP\adjsp.paa"};
                            case 8:  {"Eventia_Textures\Data\SP\adjcsp.paa"};
                            case 9:  {"Eventia_Textures\Data\SP\ltsp.paa"};
                            case 10: {"Eventia_Textures\Data\SP\cptsp.paa"};
                            case 11: {"Eventia_Textures\Data\SP\commsp.paa"};
                            case 12: {"Eventia_Textures\Data\SP\ltcolsp.paa"};
                            case 13: {"Eventia_Textures\Data\SP\colsp.paa"};
                            case 14: {"Eventia_Textures\Data\SP\genesp.paa"};
                            default  {"\a3\ui_f\data\gui\cfg\Ranks\private_gs.paa"};
                        },
                        switch ((_x getVariable "rank_medic")) do
                        {
                            case 1: {"Seconde Classe"};
                            case 2: {"Premiè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"};
                            case 14: {"Contrôleur Général"};
                        },
                        _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 "";
 
Solution
Hello ,Problème résolu en regardant mes logs client j'ai remarquer que j'avais un erreur dans mon core\init.sqf je l'ai regler et sa fonctionne la merci beaucoup
Hello ,Problème résolu en regardant mes logs client j'ai remarquer que j'avais un erreur dans mon core\init.sqf je l'ai regler et sa fonctionne la merci beaucoup
 
Solution