Français Crafting : souci d'affichage d'inventaire

Hello, est-ce que tu peux partager tes logs client ?
Et les fichiers que tu as modifié ?
ha du coup j'ai remis d'origine je vais refaire le tuto il tout simple pourtant

edit :
voila je viens de le refaire j'ai ceci

j'ai modifier : tp_openWorkBench et tp_workBenchInventory comme dan le tuto


Code:
/*
    Author: Maxence
    Web site: www.the-programmer.com
    Discord: https://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.
*/
if (life_action_inUse) exitWith {hint localize "STR_NOTF_Action";};

_workbench = cursorObject;
if (isNull _workbench) exitWith {};

_config = missionConfigFile >> "Max_Settings_Craft";
if !((typeOf _workbench) in (getArray (_config >> "all_workbench_classnames"))) exitWith {};

if (dialog) exitWith {};
if !(isNull (_workbench getVariable ["workbench_in_use_by",objNull])) exitWith {hint localize "STR_MISC_VehInvUse";};

createDialog "Maxence_Craft";
disableSerialization;

_workbench setVariable ["workbench_in_use_by",player,true];
_display = findDisplay 6940;
(_display displayCtrl 6949) ctrlSetText format ["%1\main.paa",(getText (_config >> "textures_base_path"))];

if ((getNumber (_config >> "show_only_one_category")) isEqualTo 1) then {
    _craftsList = _display displayCtrl 6955;
    lbClear _craftsList;

    (_display displayCtrl 6941) ctrlShow false;
    _categoriesList = _display displayCtrl 6954;

    {
        _typeConfigPath = _x;
        _itemType = configName _typeConfigPath;

        _categoryAdded = false;

        if (isClass _typeConfigPath) then {
            if (_itemType in ["vItem","weapon","magazine","vehicle","backpack","uniform"]) then {
                for "_i" from 0 to (count _typeConfigPath)-1 do {
                    if (_categoryAdded) exitWith {};
                    _configPath = _typeConfigPath select _i;

                    if (isClass _configPath) then {
                        _condition = getText (_configPath >> "condition");

                        if ([_condition] call theprogrammer_core_fnc_checkCondition) exitWith {
                            _categoryAdded = true;

                            _categoriesList lbAdd format ["%1",([(getText (_typeConfigPath >> "category_display_name")),"Max_Settings_Craft","Craft_Localization"] call theprogrammer_core_fnc_localize)];
                            _categoriesList lbSetData [(lbSize _categoriesList)-1,_itemType];
                        };
                    };
                };
            };
        };
    } forEach ("true" configClasses (_config >> "crafts"));

    _craftsList lbAdd (["STR_SELECT_CATEGORY","Max_Settings_Craft","Craft_Localization"] call theprogrammer_core_fnc_localize);
    _craftsList lbSetData [(lbSize _craftsList)-1,"category"];

    _craftsList ctrlAddEventHandler ["LBSelChanged",format ["[""%1""] spawn max_craft_fnc_craftLbChanged;",netId (_workbench)]];
} else {
    _craftsList = _display displayCtrl 6941;
    lbClear _craftsList;

    (_display displayCtrl 6954) ctrlShow false;
    (_display displayCtrl 6955) ctrlShow false;

    {
_fnc_hasAllRequiredItems = {
    params [
        ["_itemType","",[""]],
        ["_itemClass","",[""]],
        ["_etabli",objNull,[objNull]]
    ];

    _itemClassConfig = missionConfigFile >> "Max_Settings_Craft" >> "crafts" >> _itemType >> _itemClass;
    _hasItems = true;

    if !(isClass _itemClassConfig) exitWith {false;};
    _data = (_etabli getVariable ["workbench_inventory",[[],0]]) select 0;

    {
        _hasItem = false;

        _index = [(_x select 0),_data] call max_craft_fnc_index;
        if !(_index isEqualTo -1) then {
            _value = (_data select _index) select 1;
            if (_value >= (_x select 1)) then {_hasItem = true;};
        };

        if !(_hasItem) exitWith {_hasItems = false;};
    } forEach (getArray (_itemClassConfig >> "itemsRequired"));

    _money = getNumber (_itemClassConfig >> "moneyRequired");
    if (_money > 0) then {if (life_cash < _money) then {_hasItems = false;};};

    _hasItems;
};

_craftsList = _display displayCtrl 6941;
lbClear _craftsList;

           _vehicleInfo = [_itemResult] call life_fnc_fetchVehInfo;
                                    _itemName = _vehicleInfo select 3;
                                    _icon = _vehicleInfo select 2;
                                };

                                case "backpack" : {
                                    _itemInfo = [_itemResult] call life_fnc_fetchCfgDetails;
                                    _itemName = _itemInfo select 1;
                                    _icon = _itemInfo select 2;
                                };

                                case "uniform" : {
                                    _itemInfo = [_itemResult] call life_fnc_fetchCfgDetails;
                                    _itemName = _itemInfo select 1;
                                    _icon = _itemInfo select 2;
                                };

                                default {};
                            };

                            if ([_itemType,_itemClass,_workbench] call _fnc_hasAllRequiredItems) then {
                                _craftsList lbAdd format ["- %1",_itemName];
                                _craftsList lbSetData [(lbSize _craftsList)-1,str [_itemType,_itemClass]];
                                if !(_icon isEqualTo "") then {
                                    _craftsList lbSetPicture [(lbSize _craftsList)-1,_icon];
                                };
                            };
                        };
                    };
                };
            } else {
                if ((_itemClass isEqualTo "category_display_name") && ((count _typeConfigPath) > 1)) then {
                    if ((lbSize _craftsList) > 0) then {
                        _craftsList lbAdd "";
                        _craftsList lbSetData [(lbSize _craftsList)-1,"category"];
                    };

                    _craftsList lbAdd format ["%1 :",([(getText (_configPath)),"Max_Settings_Craft","Craft_Localization"] call theprogrammer_core_fnc_localize)];
                    _craftsList lbSetData [(lbSize _craftsList)-1,"category"];
                };
            };
        };
    };
} forEach ("true" configClasses (missionConfigFile >> "Max_Settings_Craft" >> "crafts"));

    _craftsList ctrlAddEventHandler ["LBSelChanged",format ["[""%1""] spawn max_craft_fnc_craftLbChanged;",netId (_workbench)]];
};

(_display displayCtrl 6950) buttonSetAction format ["[""%1""] spawn max_craft_fnc_workBenchTakeItem;",netId (_workbench)];
(_display displayCtrl 6951) buttonSetAction format ["[""%1""] spawn max_craft_fnc_workBenchStoreItem;",netId (_workbench)];
(_display displayCtrl 6952) buttonSetAction format ["[""%1""] spawn max_craft_fnc_craftAction;",netId (_workbench)];
(_display displayCtrl 6953) buttonSetAction format ["[""%1""] spawn max_craft_fnc_craftCancel;",netId (_workbench)];

[_workbench] spawn max_craft_fnc_workBenchInventory;
[_workbench] spawn max_craft_fnc_workBenchProgressBar;

waitUntil {(isNull (findDisplay 6940))};
_workbench setVariable ["workbench_in_use_by",objNull,true];


Code:
/*
    Author: Maxence
    Web site: www.the-programmer.com
    Discord: https://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.
*/
_workbench = param [0,objNull,[objNull]];
if (isNull _workbench) exitWith {closeDialog 0;};

disableSerialization;
if !(alive player) exitWith {closeDialog 0;};

_currentlyCrafting = _workbench getVariable ["workbench_in_use_by",player];
if (!(isNull _currentlyCrafting) && !(_currentlyCrafting isEqualTo player)) exitWith {closeDialog 0; hint localize "STR_MISC_VehInvUse";};

_display = findDisplay 6940;
_tInv = _display displayCtrl 6945;
_pInv = _display displayCtrl 6946;
lbClear _tInv;
lbClear _pInv;

_data = _workbench getVariable ["workbench_inventory",[]];
if ((count _data) isEqualTo 0) then {_workbench setVariable ["workbench_inventory",[[],0],true]; _data = [];} else {_data = (_data select 0);};

{
    _val = missionNamespace getVariable [format ["life_inv_%1",getText (missionConfigFile >> "VirtualItems" >> (configName _x) >> "variable")],0];

    if (_val > 0) then {
        _pInv lbAdd format ["[%1] - %2",_val,localize (getText (_x >> "displayName"))];
        _pInv lbSetData [(lbSize _pInv)-1,(configName _x)];
        _icon = getText (_x >> "icon");

        if !(_icon isEqualTo "") then {
            _pInv lbSetPicture [(lbSize _pInv)-1,_icon];
        };
    };
} forEach ("true" configClasses (missionConfigFile >> "VirtualItems"));

{
    _name = getText (missionConfigFile >> "VirtualItems" >> (_x select 0) >> "displayName");
    _val = _x select 1;

    if (_val > 0) then {
        _tInv lbAdd format ["[%1] - %2",_val,(localize _name)];
        _tInv lbSetData [(lbSize _tInv)-1,(_x select 0)];
        _icon = getText (missionConfigFile >> "VirtualItems" >> (_x select 0) >> "icon");

        if !(_icon isEqualTo "") then {
            _tInv lbSetPicture [(lbSize _tInv)-1,_icon];
        };
    };
} forEach _data;
_fnc_hasAllRequiredItems = {
    params [
        ["_itemType","",[""]],
        ["_itemClass","",[""]],
        ["_etabli",objNull,[objNull]]
    ];

    _itemClassConfig = missionConfigFile >> "Max_Settings_Craft" >> "crafts" >> _itemType >> _itemClass;
    _hasItems = true;

    if !(isClass _itemClassConfig) exitWith {false;};
    _data = (_etabli getVariable ["workbench_inventory",[[],0]]) select 0;

    {
        _hasItem = false;

        _index = [(_x select 0),_data] call max_craft_fnc_index;
        if !(_index isEqualTo -1) then {
            _value = (_data select _index) select 1;
            if (_value >= (_x select 1)) then {_hasItem = true;};
        };

        if !(_hasItem) exitWith {_hasItems = false;};
    } forEach (getArray (_itemClassConfig >> "itemsRequired"));

    _money = getNumber (_itemClassConfig >> "moneyRequired");
    if (_money > 0) then {if (life_cash < _money) then {_hasItems = false;};};

    _hasItems;
};

_craftsList = _display displayCtrl 6941;
lbClear _craftsList;

{
    _typeConfigPath = _x;
    _itemType = configName _typeConfigPath;

    if (isClass _typeConfigPath) then {
        for "_i" from 0 to (count _typeConfigPath)-1 do {
            _configPath = _typeConfigPath select _i;
            _itemClass = configName _configPath;

            if ((isClass _configPath) && (_itemType in ["vItem","weapon","magazine","vehicle","backpack","uniform"])) then {
                _condition = getText (_configPath >> "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 {
                            _itemResult = getText (_configPath >> "itemGive");
                            _itemName = "";
                            _icon = "";

                            switch (_itemType) do {
                                case "vItem" : {
                                    _itemConfig = missionConfigFile >> "VirtualItems" >> _itemResult;
                                    _itemName = localize (getText (_itemConfig >> "displayName"));
                                    _icon = getText (_itemConfig >> "icon");
                                };

                                case "weapon" : {
                                    _itemInfo = [_itemResult] call life_fnc_fetchCfgDetails;
                                    _itemName = _itemInfo select 1;
                                    _icon = _itemInfo select 2;
                                };

                                case "magazine" : {
                                    _itemInfo = [_itemResult] call life_fnc_fetchCfgDetails;
                                    _itemName = _itemInfo select 1;
                                    _icon = _itemInfo select 2;
                                };

                                case "vehicle" : {
                                    _vehicleInfo = [_itemResult] call life_fnc_fetchVehInfo;
                                    _itemName = _vehicleInfo select 3;
                                    _icon = _vehicleInfo select 2;
                                };

                                case "backpack" : {
                                    _itemInfo = [_itemResult] call life_fnc_fetchCfgDetails;
                                    _itemName = _itemInfo select 1;
                                    _icon = _itemInfo select 2;
                                };

                                case "uniform" : {
                                    _itemInfo = [_itemResult] call life_fnc_fetchCfgDetails;
                                    _itemName = _itemInfo select 1;
                                    _icon = _itemInfo select 2;
                                };

                                default {};
                            };

                            if ([_itemType,_itemClass,_workbench] call _fnc_hasAllRequiredItems) then {
                                _craftsList lbAdd format ["- %1",_itemName];
                                _craftsList lbSetData [(lbSize _craftsList)-1,str [_itemType,_itemClass]];
                                if !(_icon isEqualTo "") then {
                                    _craftsList lbSetPicture [(lbSize _craftsList)-1,_icon];
                                };
                            };
                        };
                    };
                };
            } else {
                if ((_itemClass isEqualTo "category_display_name") && ((count _typeConfigPath) > 1)) then {
                    if ((lbSize _craftsList) > 0) then {
                        _craftsList lbAdd "";
                        _craftsList lbSetData [(lbSize _craftsList)-1,"category"];
                    };

                    _craftsList lbAdd format ["%1 :",([(getText (_configPath)),"Max_Settings_Craft","Craft_Localization"] call theprogrammer_core_fnc_localize)];
                    _craftsList lbSetData [(lbSize _craftsList)-1,"category"];
                };
            };
        };
    };
} forEach ("true" configClasses (missionConfigFile >> "Max_Settings_Craft" >> "crafts"));
Sans titre.png
 
Dernière édition:
Upvote 0
voici lrd logs : Paste-Me
du coup je remarque aussi que l'on peut plus quitter le jeu avec echap le compteur a disparu apres avoir reinstaller
effectivement dans les log je vois ceci enfin j'ai pas tout eplucher mais ça j'ai vu :
Code:
20:18:10 File crafting_system\client\tp_openWorkBench.sqf..., line 108
20:18:10 Error in expression <e [(lbSize _craftsList)-1,_icon];
};
};
};
};
};
} else {
if ((_itemClass isEqua>
20:18:10   Error position: <};
};
};
} else {
if ((_itemClass isEqua>
20:18:10   Error Missing {
20:18:10 File crafting_system\client\tp_openWorkBench.sqf..., line 108
20:18:10 ../lib/Network/networkServer.cpp OnClientStateChanged:NOT IMPLEMENTED - briefing!
20:18:10  Mission id: 51aa631973409dbcc3377cf1dcf8a0559ebe3297
20:18:10 Game started.
20:18:10 "extDB3: Connected to Database"
20:18:10 "----------------------------------------------------------------------------------------------------"
20:18:10 "---------------------------------- Starting Altis Life Server Init ---------------------------------"
20:18:10 "---------------------------- Version 5.0.0 ----------------------------"
20:18:10 "----------------------------------------------------------------------------------------------------"
20:18:10 "----------------------------------------------------------------------------------------------------"
20:18:10 "               End of Altis Life Server Init :: Total Execution Time 0.0019989 seconds "
20:18:10 "----------------------------------------------------------------------------------------------------"
20:18:10 Attempt to override final function - bis_fnc_storeparamsvalues_data
20:18:10 Error in expression <e [(lbSize _craftsList)-1,_icon];
};
};
};
};
};
} else {
if ((_itemClass isEqua>
20:18:10   Error position: <};
};
};
} else {
if ((_itemClass isEqua>
20:18:10   Error Missing {
20:18:10 File crafting_system\client\tp_openWorkBench.sqf..., line 108
20:18:10 Error in expression <e [(lbSize _craftsList)-1,_icon];
};
};
};
};
};
} else {
if ((_itemClass isEqua>
20:18:10   Error position: <};
};
};
} else {
if ((_itemClass isEqua>
20:18:10   Error Missing {
20:18:10 File crafting_system\client\tp_openWorkBench.sqf..., line 108
 
Upvote 0