Français [Whitelist Menu] Afficher le nom des grade au lieu des cop et med level

  • Auteur de la discussion Auteur de la discussion I'm the Boss
  • Date de début Date de début

I'm the Boss

Leader
Membre du personnel
2/1/20
701
3
44
1 100
Bonjour !
Ce tuto sera en rapport avec le script du Whitelist Menu vendu par The Programmer.​

  • Rendez vous dans le pbo du Whitelist Menu et dans /client/fn_whitelistCategory.sqf
Remplacez le par celui-ci
Code:
/*
    Author: Maxence Lyon
    Modifié par Zaros
    Altis DEV: https://altisdev.com/user/maxence-lyon
    Teamspeak 3: ts.the-programmer.com
    Web site: www.the-programmer.com
    Steam: « Une Vache Sur CS – Maxence », please leave a message on my profile who says the exact reason before adding me.

    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.

    License number:
    Server's name:
    Owner's name:
*/
_category = param [0,"",[""]];
disableSerialization;

if (_category isEqualTo "") exitWith {};
_baseConfig = missionConfigFile >> "Max_Settings_WhitelistMenu";

if !(isClass (_baseConfig >> "categories" >> _category)) exitWith {};
_config = _baseConfig >> "categories" >> _category;

_display = findDisplay 29550;
_list = _display displayCtrl 29552;
_addButton = _display displayCtrl 8550;
_removeButton = _display displayCtrl 54656;

_addButton ctrlEnable false;
_removeButton ctrlEnable false;
lbClear _list;

_condition1 = getText (_config >> "condition_addLicense");
_condition_result1 = if (_condition1 isEqualTo "") then {true} else {call compile _condition1};
if !(isNil "_condition_result1") then {
    if (_condition_result1 isEqualType true) then {
        if (_condition_result1 isEqualTo true) then {
            _addButton buttonSetAction format ["['%1'] call max_whitelist_fnc_whitelistAdd",_category];
            _addButton ctrlEnable true;
        };
    };
};

_condition2 = getText (_config >> "condition_removeLicense");
_condition_result2 = if (_condition2 isEqualTo "") then {true} else {call compile _condition2};

if !(isNil "_condition_result2") then {
    if (_condition_result2 isEqualType true) then {
        if (_condition_result2 isEqualTo true) then {
            _removeButton buttonSetAction format ["['%1'] call max_whitelist_fnc_whitelistRemove",_category];
            _removeButton ctrlEnable true;
        };
    };
};

if (((getArray (_baseConfig >> "cop_level_data")) select 0) isEqualTo _category) then {
    for "_i" from 0 to ((getArray (_baseConfig >> "cop_level_data")) select 1) do {
        _displayRank = "";
            {
                if (_i isEqualTo (_x select 0)) exitWith {_displayRank = (_x select 1);};
            } forEach getArray (missionConfigFile >> "Max_Settings_WhitelistMenu" >> "copLevelText");

        if (_displayRank isEqualTo "") then {
                    _list lbAdd format [(["STR_COP_LEVEL_LIST","Max_Settings_WhitelistMenu","WhitelistMenu_Localization"] call theprogrammer_core_fnc_localize),_i];
                } else {
                    _list lbAdd _displayRank;
                };

        _list lbSetData [(lbSize _list)-1,format ["coplevel%1",_i]];
    };
};

if (((getArray (_baseConfig >> "medic_level_data")) select 0) isEqualTo _category) then {
    for "_j" from 0 to ((getArray (_baseConfig >> "medic_level_data")) select 1) do {
        _displayRank = "";
                {
                    if (_j isEqualTo (_x select 0)) exitWith {_displayRank = (_x select 1);};
                } forEach getArray (missionConfigFile >> "Max_Settings_WhitelistMenu" >> "medLevelText");

                if (_displayRank isEqualTo "") then {
                    _list lbAdd format [(["STR_MED_LEVEL_LIST","Max_Settings_WhitelistMenu","WhitelistMenu_Localization"] call theprogrammer_core_fnc_localize),_j];
                } else {
                    _list lbAdd _displayRank;
                };

        _list lbSetData [(lbSize _list)-1,format ["medlevel%1",_j]];
    };
};

if (((getArray (_baseConfig >> "adac_level_data")) select 0) isEqualTo _category) then {
    for "_k" from 0 to ((getArray (_baseConfig >> "adac_level_data")) select 1) do {
        _displayRank = "";
                {
                    if (_k isEqualTo (_x select 0)) exitWith {_displayRank = (_x select 1);};
                } forEach getArray (missionConfigFile >> "Max_Settings_WhitelistMenu" >> "adaLevelText");

                if (_displayRank isEqualTo "") then {
                    _list lbAdd format [(["STR_MED_LEVEL_LIST","Max_Settings_WhitelistMenu","WhitelistMenu_Localization"] call theprogrammer_core_fnc_localize),_k];
                } else {
                    _list lbAdd _displayRank;
                };
        _list lbSetData [(lbSize _list)-1,format ["adalevel%1",_k]];
    };
};

_licenses = getArray (_config >> "licenses");

{
    _x params [
        ["_name",""],
        ["_variable",""],
        ["_condition",""]
    ];

    _condition_result = if (_condition isEqualTo "") then {true} else {call compile _condition};
    if !(isNil "_condition_result") then {
        if (_condition_result isEqualType true) then {
            if (_condition_result isEqualTo true) then {
                _list lbAdd _name;
                _list lbSetData [(lbSize _list)-1,_variable];
            };
        };
    };
} forEach _licenses;

  • Puis dans le config_master de votre script supprimer les anciennes lignes, et ajouter celle-ci en dessous de la tonic version.
Code:
cop_level_data[] = {"cops",15,"coplevel"}; // Format is : {"Category class name below",Maximum Level,"Column name in database"}

    copLevelText[] = {
        //{life_coplevel,"TEXT"},
        {0,"Non Whitelist"},
        {1,"1ère Classe"},
        {2,"Brigadier"},
        {3,"Brigadier-Chef"},
        {4,"Maréchal des Logis"},
        {5,"Gendarme"},
        {6,"Maréchal des Logis-Chef"},
        {7,"Adjudant"},
        {8,"Adjudant-Chef"},
        {9,"Major"},
        {10,"Sous-Lieutenant"},
        {11,"Lieutenant"},
        {12,"Capitaine"},
        {13,"Commandant"},
        {14,"Lieutenant-Colonel"},
        {15,"Colonel"}
    };

    medic_level_data[] = {"medics",5,"mediclevel"};

    medLevelText[] = {
        //{life_medicLevel,"TEXT"},
        {0,"Non Whitelist"},
        {1,"Recrue"},
        {2,"Sapeur Pompier"},
        {3,"Adjudant"},
        {4,"Sergent"},
        {5,"Colonel"}
    };

    adac_level_data[] = {"militaires",17,"adaclevel"}; // You can put "" for the category class name to hide it

    adaLevelText[] = {
        //{life_adacLevel,"TEXT"},
        {0,"Non Whitelist"},
        {1,"Recrue"},
        {2,"Sapeur Pompier"},
        {3,"Adjudant"},
        {4,"Sergent"},
        {5,"Colonel"}
    };

Voila tout devrait fonctionner ! :) Pensez à bien re-modifier vos lignes. Le script supporte l'adaclevel aussi !
 
Dernière édition par un modérateur:
bonjour ,
J'ai un petit soucis ,moi dans la liste c'est juste marqué "cop level" et non les grades