The-Programmer Forum

EiiNergy a écrit le dernier message :
#18
J'espère que cette fois c'est la bonne, voici le code corrigé :
Code:
if (((backpack player) isEqualTo "") && ((vest player) isEqualTo "")) then {
    life_maxWeight = LIFE_SETTINGS(getNumber,"total_maxWeight");
} else {
    _loadBp = 0;
    _loadVt = 0;

    switch (backpack player) do {
        case "B_AssaultPack_cbr": {_loadBp = 30;};
        case "B_AssaultPack_dgtl": {_loadBp = 30;};
        case "B_AssaultPack_blk": {_loadBp = 30;};
        case "B_AssaultPack_rgr": {_loadBp = 30;};
        case "B_Kitbag_mcamo": {_loadBp = 54;};
        case "B_TacticalPack_blk": {_loadBp = 42;};
        case "B_TacticalPack_oli": {_loadBp = 42;};
        case "B_FieldPack_ocamo": {_loadBp = 36;};
        case "B_FieldPack_blk": {_loadBp = 36;};
        case "B_Bergen_sgg": {_loadBp = 54;};
        case "G_Bergen": {_loadBp = 54;};
        case "B_Kitbag_cbr": {_loadBp = 54;};
        case "B_HuntingBackpack": {_loadBp = 54;};
        case "B_Carryall_cbr": {_loadBp = 60;};
        case "B_Carryall_oli": {_loadBp = 60;};
        case "B_Carryall_khk": {_loadBp = 60;};
        case "B_Parachute": {_loadBp = 12;};
        case "": {_loadBp = 0;};
        default {_loadBp = round(FETCH_CONFIG2(getNumber,"CfgVehicles",(backpack player),"maximumload") / 4);};
    };

    switch (vest player) do {
        case "V_Rangemaster_belt": {_loadVt = 15;};
        case "V_TacVest_blk_POLICE": {_loadVt = 27;};
        case "V_RebreatherB": {_loadVt = 7;};
        case "V_PlateCarrier2_rgr": {_loadVt = 18;};
        case "V_PlateCarrier1_blk": {_loadVt = 27;};
        case "V_HarnessO_brn": {_loadVt = 27;};
        case "V_BandollierB_rgr": {_loadVt = 30;};
        case "V_PlateCarrier1_rgr": {_loadVt = 30;};
        case "V_Press_F": {_loadVt = 19;};
        case "V_HarnessOSpec_gry": {_loadVt = 30;};
        case "V_BandollierB_blk": {_loadVt = 30;};
        case "V_Chestrig_blk": {_loadVt = 30;};
        case "V_TacVestIR_blk": {_loadVt = 30;};
        case "V_TacVest_blk": {_loadVt = 30;};
        case "V_PlateCarrierIA2_dgtl": {_loadVt = 30;};
        case "V_PlateCarrierH_CTRG": {_loadVt = 30;};
        case "V_PlateCarrierL_CTRG": {_loadVt = 30;};
        case "V_BandollierB_cbr": {_loadVt = 30;};
        case "V_TacVest_khk": {_loadVt = 27;};
        case "": {_loadVt = 0;};
        default {_loadVt = round(FETCH_CONFIG2(getNumber,"CfgVehicles",(vest player),"maximumload") / 4);};
    };

    life_maxWeight = LIFE_SETTINGS(getNumber,"total_maxWeight") + _loadBp + _loadVt;

    if (life_god) then {
        life_maxWeight = 500;
    };
};

Ca fonctionne ! Merci beaucoup pour ton aide
Merci d'avoir pris le temps de m'aider et d'avoir trouvé une solution à mon problème :D