Jump to content

Recommended Posts

I am running Altis Life v5.0.0 (https://github.com/AsYetUntitled/Framework)

 

I have a problem with backpacks not showing the correct max capacity in game (Its well above it) - 

Here is the bp statement in my fn_survival.sqf :

 

 /* Adjustment of carrying capacity based on backpack changes */
    if (backpack player isEqualTo "") then {
        life_maxWeight = LIFE_SETTINGS(getNumber,"total_maxWeight");
        _bp = backpack player;
    } else {
        if (!(backpack player isEqualTo "") && {!(backpack player isEqualTo _bp)}) then {
            _bp = backpack player;
            life_maxWeight = LIFE_SETTINGS(getNumber,"total_maxWeight") + round(FETCH_CONFIG2(getNumber,"CfgVehicles",_bp,"maximumload") / 4);
        };
    };

 

and further down - 

 

{
    private["_bp","_load","_cfg"];
    while{true} do
    {
        waitUntil {backpack player != ""};
        _bp = backpack player;
        _cfg = getNumber(configFile >> "CfgVehicles" >> (backpack player) >> "maximumload");
        _load = round(_cfg / 8);
        life_maxWeight = life_maxWeight + _load;
        if(playerSide == west) then {(unitBackpack player) setObjectTextureGlobal [1,""];}; // <---- Sac invisible chez les flics
        if(playerSide == independent) then {(unitBackpack player) setObjectTextureGlobal [1,""];}; // <----- Sac Invisible chez les Medics
        waitUntil {backpack player != _bp};
        if(backpack player == "") then 
        {
            life_maxWeight = life_maxWeight;
        };
    };
};

 

Thank you

 

 

Share this post


Link to post
Share on other sites

Again... Not familiar with the mission or how it works.

I'm going by what you post and the framework link.

 

Have you changed the values in;

Quote

 

/core/configuration.sqf

or

/config/Config_Master.hpp

 

?

 

The default value should be 24.

  • Thanks 1

Share this post


Link to post
Share on other sites

/config/Config_Master.hpp - 

 

/* Basic System Configurations */
    donor_level = false; //Enable the donor level set in database (var = life_donorlevel; levels = 0,1,2,3,4,5). ATTENTION! Before enabling, read: https://www.bistudio.com/community/game-content-usage-rules & https://www.bistudio.com/monetization
    enable_fatigue = false; //Set to false to disable the ARMA 3 fatigue system.
    total_maxWeight = 24; //Static variable for the maximum weight allowed without having a backpack
    respawn_timer = 130; //How many seconds a player should wait, before being able to respawn. Minimum 5 seconds.

 

 

 

/core/configuration.sqf - 

 

*****************************
****** Weight Variables *****
*****************************
*/
life_maxWeight = LIFE_SETTINGS(getNumber, "total_maxWeight");
life_carryWeight = 0; //Represents the players current inventory weight (MUST START AT 0).

/*

 

No i have not changed them

Share this post


Link to post
Share on other sites

Cool.
I'm not sure what the issue is then.

 

You mentioned that the max capacity value was well above what it should be.

How are you returning that value and what sort of values are you getting?

  • Thanks 1

Share this post


Link to post
Share on other sites

The value is in the thousands - when adding an item to the back pack it goes down by the virtual items weight.

0/9436 (on the top of the backpack / Inventory section)

 

I am not sure how the value is returning (Obviously in the UI for the max weight allowed for the backpack) as i have never changed anything to do with the back packs or the weight of virtual items,.

Share this post


Link to post
Share on other sites

I've been searching for the answer - just had an idea - I have disabled fatigue, this might cause the display to be wrong. Testing now

Share this post


Link to post
Share on other sites

No it wasn't... Now every time i open my Y menu it adds the backpack carry weight to it's self again - original 204, then 408, then 612, 1224... and so on

Share this post


Link to post
Share on other sites

When the player has no backpack it sets max to 24 like desired in the code. So it is definitely to do with the backpack setup...

 

I have used the life_carryWeight = 0 but it has affected the whole server... i might need to reverse it, Or rebuild the server from scratch.. I have wiped (dumped) the server data from my base and it did not change.

Share this post


Link to post
Share on other sites

Took the backpack off and used the life_carryWeight = 0 to try and reset it - did not change

 

This is a bad bug... if anyone has a clue about what is going on any help would be very appreciated. 

Share this post


Link to post
Share on other sites

ok so after further testing - mining, a new bug has appeared - The total max weight of the backpack is correct - at first i was able to hold 27 gems in my carryall back pack - after awhile mining and emptying the gems into a vehicle the carry capacity dropped to 18, then further along it dropped to 12, then to  8. It seems the backpack is not properly registering the emptying... 

 

As i am running it off my PC it is lagging - resetting the server to see if it helps - This is exactly why - Fixed

 

My fn.survival.sql - 



 

Spoiler

#include "..\script_macros.hpp"
/*
    File: fn_survival.sqf
    Author: Bryan "Tonic" Boardwine

    Description:
    All survival? things merged into one thread.
*/
private ["_fnc_food","_fnc_water","_foodTime","_waterTime","_bp","_walkDis","_lastPos","_curPos"];
_fnc_food =  {
    if (life_hunger < 2) then {player setDamage 1; hint localize "STR_NOTF_EatMSG_Death";}
    else
    {
        life_hunger = life_hunger - 10;
        [] call life_fnc_hudUpdate;
        if (life_hunger < 2) then {player setDamage 1; hint localize "STR_NOTF_EatMSG_Death";};
        switch (life_hunger) do {
            case 30: {hint localize "STR_NOTF_EatMSG_1";};
            case 20: {hint localize "STR_NOTF_EatMSG_2";};
            case 10: {
                hint localize "STR_NOTF_EatMSG_3";
                if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
            };
        };
    };
};

_fnc_water = {
    if (life_thirst < 2) then {player setDamage 1; hint localize "STR_NOTF_DrinkMSG_Death";}
    else
    {
        life_thirst = life_thirst - 10;
        [] call life_fnc_hudUpdate;
        if (life_thirst < 2) then {player setDamage 1; hint localize "STR_NOTF_DrinkMSG_Death";};
        switch (life_thirst) do  {
            case 30: {hint localize "STR_NOTF_DrinkMSG_1";};
            case 20: {
                hint localize "STR_NOTF_DrinkMSG_2";
                if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
            };
            case 10: {
                hint localize "STR_NOTF_DrinkMSG_3";
                if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
            };
        };
    };
};

//Setup the time-based variables.
_foodTime = time;
_waterTime = time;
_walkDis = 0;
_bp = "";
_lastPos = visiblePosition player;
_lastPos = (_lastPos select 0) + (_lastPos select 1);
_lastState = vehicle player;

for "_i" from 0 to 1 step 0 do {
    /* Thirst / Hunger adjustment that is time based */
    if ((time - _waterTime) > 600 && {!life_god}) then {[] call _fnc_water; _waterTime = time;};
    if ((time - _foodTime) > 850 && {!life_god}) then {[] call _fnc_food; _foodTime = time;};

    /* Adjustment of carrying capacity based on backpack changes */
    if (backpack player isEqualTo "") then {
        life_maxWeight = LIFE_SETTINGS(getNumber,"total_maxWeight");
        _bp = backpack player;
    } else {

        if (backpack player isEqualTo "B_OutdoorPack_blk") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 15; //the weight you want.
        };

        if (backpack player isEqualTo "B_AssaultPack_khk") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 20; //the weight you want.
        };

        if (backpack player isEqualTo "B_AssaultPack_dgtl") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 20; //the weight you want.
        };

        if (backpack player isEqualTo "B_AssaultPack_rgr") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 20; //the weight you want.
        };

        if (backpack player isEqualTo "B_AssaultPack_sgg") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 20; //the weight you want.
        };

        if (backpack player isEqualTo "B_AssaultPack_blk") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 20; //the weight you want.
        };

        if (backpack player isEqualTo "B_AssaultPack_cbr") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 20; //the weight you want.
        };

        if (backpack player isEqualTo "B_AssaultPack_mcamo") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 20; //the weight you want.
        };

        if (backpack player isEqualTo "B_TacticalPack_oli") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 25; //the weight you want.
        };

        if (backpack player isEqualTo "B_Kitbag_mcamo") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 35; //the weight you want.
        };

        if (backpack player isEqualTo "B_Kitbag_sgg") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 35; //the weight you want.
        };

        if (backpack player isEqualTo "B_Kitbag_cbr") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 35; //the weight you want.
        };

        if (backpack player isEqualTo "B_FieldPack_blk") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 40; //the weight you want.
        };

        if (backpack player isEqualTo "B_FieldPack_ocamo") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 40; //the weight you want.
        };

        if (backpack player isEqualTo "B_FieldPack_oucamo") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 40; //the weight you want.
        };

        if (backpack player isEqualTo "B_Bergen_sgg") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 45; //the weight you want.
        };

        if (backpack player isEqualTo "B_Bergen_mcamo") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 45; //the weight you want.
        };

        if (backpack player isEqualTo "B_Bergen_rgr") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 45; //the weight you want.
        };

        if (backpack player isEqualTo "B_Bergen_blk") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 45; //the weight you want.
        };
        
        if (backpack player isEqualTo "B_ViperHarness_blk_F") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 55; //the weight you want.
        };

        if (backpack player isEqualTo "B_ViperHarness_ghex_F") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 55; //the weight you want.
        };

        if (backpack player isEqualTo "B_ViperHarness_oli_F") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 55; //the weight you want.
        };

        if (backpack player isEqualTo "B_FieldPack_ocamo_Medic") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 55; //the weight you want.
        };

        if (backpack player isEqualTo "B_FieldPack_ocamo_ReconMedic") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 55; //the weight you want.
        };

        if (backpack player isEqualTo "B_Carryall_ocamo") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 70; //the weight you want.
        };

        if (backpack player isEqualTo "B_Carryall_oucamo") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 70; //the weight you want.
        };

        if (backpack player isEqualTo "B_Carryall_mcamo") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 70; //the weight you want.
        };

        if (backpack player isEqualTo "B_Carryall_ocamo") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 70; //the weight you want.
        };

        if (backpack player isEqualTo "B_Carryall_oli") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 70; //the weight you want.
        };

        if (backpack player isEqualTo "B_Carryall_khk") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 70; //the weight you want.
        };

        if (backpack player isEqualTo "B_Carryall_cbr") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 70; //the weight you want.
        };

        if (backpack player isEqualTo "B_Bergen_tna_f") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 90; //the weight you want.
        };

    
        if (!(backpack player isEqualTo "") && {!(backpack player isEqualTo _bp)}) then {
            _bp = backpack player;
            life_maxWeight = LIFE_SETTINGS(getNumber,"total_maxWeight") + round(FETCH_CONFIG2(getNumber,"CfgVehicles",_bp,"maximumload") / 4);
        };
    };

    /* Check if the player's state changed? */
    if (!(vehicle player isEqualTo _lastState) || {!alive player}) then {
        [] call life_fnc_updateViewDistance;
        _lastState = vehicle player;
    };

    /* Check if the weight has changed and the player is carrying to much */
    if (life_carryWeight > life_maxWeight && {!isForcedWalk player} && {!life_god}) then {
        player forceWalk true;
        if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
        hint localize "STR_NOTF_MaxWeight";
    } else {
        if (isForcedWalk player) then {
            player forceWalk false;
        };
    };

    /* Travelling distance to decrease thirst/hunger which is captured every second so the distance is actually greater then 650 */
    if (!alive player || {life_god}) then {_walkDis = 0;} else {
        _curPos = visiblePosition player;
        _curPos = (_curPos select 0) + (_curPos select 1);
        if (!(_curPos isEqualTo _lastPos) && {(isNull objectParent player)}) then {
            _walkDis = _walkDis + 1;
            if (_walkDis isEqualTo 650) then {
                _walkDis = 0;
                life_thirst = life_thirst - 5;
                life_hunger = life_hunger - 5;
                [] call life_fnc_hudUpdate;
            };
        };
        _lastPos = visiblePosition player;
        _lastPos = (_lastPos select 0) + (_lastPos select 1);
    };
    uiSleep 1;

    [] spawn
{
    private["_bp","_load","_cfg"];
    while{true} do
    {
        waitUntil {backpack player != ""};
        _bp = backpack player;
        _cfg = getNumber(configFile >> "CfgVehicles" >> (backpack player) >> "maximumload");
        _load = round(_cfg / 8);
        life_maxWeight = life_maxWeight + _load;
        if(playerSide == west) then {(unitBackpack player) setObjectTextureGlobal [1,""];}; // <---- Sac invisible chez les flics
        if(playerSide == independent) then {(unitBackpack player) setObjectTextureGlobal [1,""];}; // <----- Sac Invisible chez les Medics
        waitUntil {backpack player != _bp};
        if(backpack player == "") then 
        {
            life_maxWeight = life_maxWeight;
        };
    };
};

};

 

Share this post


Link to post
Share on other sites
9 hours ago, Maff said:

@Steel_Dragon

 

For people from the future... How did you solve it?

by separately adding each backpack and adding each separate max weight for each - see the spoiler below - 

Spoiler

#include "..\script_macros.hpp"
/*
    File: fn_survival.sqf
    Author: Bryan "Tonic" Boardwine

    Description:
    All survival? things merged into one thread.
*/
private ["_fnc_food","_fnc_water","_foodTime","_waterTime","_bp","_walkDis","_lastPos","_curPos"];
_fnc_food =  {
    if (life_hunger < 2) then {player setDamage 1; hint localize "STR_NOTF_EatMSG_Death";}
    else
    {
        life_hunger = life_hunger - 10;
        [] call life_fnc_hudUpdate;
        if (life_hunger < 2) then {player setDamage 1; hint localize "STR_NOTF_EatMSG_Death";};
        switch (life_hunger) do {
            case 30: {hint localize "STR_NOTF_EatMSG_1";};
            case 20: {hint localize "STR_NOTF_EatMSG_2";};
            case 10: {
                hint localize "STR_NOTF_EatMSG_3";
                if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
            };
        };
    };
};

_fnc_water = {
    if (life_thirst < 2) then {player setDamage 1; hint localize "STR_NOTF_DrinkMSG_Death";}
    else
    {
        life_thirst = life_thirst - 10;
        [] call life_fnc_hudUpdate;
        if (life_thirst < 2) then {player setDamage 1; hint localize "STR_NOTF_DrinkMSG_Death";};
        switch (life_thirst) do  {
            case 30: {hint localize "STR_NOTF_DrinkMSG_1";};
            case 20: {
                hint localize "STR_NOTF_DrinkMSG_2";
                if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
            };
            case 10: {
                hint localize "STR_NOTF_DrinkMSG_3";
                if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
            };
        };
    };
};

//Setup the time-based variables.
_foodTime = time;
_waterTime = time;
_walkDis = 0;
_bp = "";
_lastPos = visiblePosition player;
_lastPos = (_lastPos select 0) + (_lastPos select 1);
_lastState = vehicle player;

for "_i" from 0 to 1 step 0 do {
    /* Thirst / Hunger adjustment that is time based */
    if ((time - _waterTime) > 600 && {!life_god}) then {[] call _fnc_water; _waterTime = time;};
    if ((time - _foodTime) > 850 && {!life_god}) then {[] call _fnc_food; _foodTime = time;};

    /* Adjustment of carrying capacity based on backpack changes */
    if (backpack player isEqualTo "") then {
        life_maxWeight = LIFE_SETTINGS(getNumber,"total_maxWeight");
        _bp = backpack player;
    } else {

        if (backpack player isEqualTo "B_OutdoorPack_blk") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 15; //the weight you want.
        };

        if (backpack player isEqualTo "B_AssaultPack_khk") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 20; //the weight you want.
        };

        if (backpack player isEqualTo "B_AssaultPack_dgtl") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 20; //the weight you want.
        };

        if (backpack player isEqualTo "B_AssaultPack_rgr") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 20; //the weight you want.
        };

        if (backpack player isEqualTo "B_AssaultPack_sgg") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 20; //the weight you want.
        };

        if (backpack player isEqualTo "B_AssaultPack_blk") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 20; //the weight you want.
        };

        if (backpack player isEqualTo "B_AssaultPack_cbr") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 20; //the weight you want.
        };

        if (backpack player isEqualTo "B_AssaultPack_mcamo") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 20; //the weight you want.
        };

        if (backpack player isEqualTo "B_TacticalPack_oli") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 25; //the weight you want.
        };

        if (backpack player isEqualTo "B_Kitbag_mcamo") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 35; //the weight you want.
        };

        if (backpack player isEqualTo "B_Kitbag_sgg") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 35; //the weight you want.
        };

        if (backpack player isEqualTo "B_Kitbag_cbr") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 35; //the weight you want.
        };

        if (backpack player isEqualTo "B_FieldPack_blk") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 40; //the weight you want.
        };

        if (backpack player isEqualTo "B_FieldPack_ocamo") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 40; //the weight you want.
        };

        if (backpack player isEqualTo "B_FieldPack_oucamo") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 40; //the weight you want.
        };

        if (backpack player isEqualTo "B_Bergen_sgg") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 45; //the weight you want.
        };

        if (backpack player isEqualTo "B_Bergen_mcamo") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 45; //the weight you want.
        };

        if (backpack player isEqualTo "B_Bergen_rgr") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 45; //the weight you want.
        };

        if (backpack player isEqualTo "B_Bergen_blk") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 45; //the weight you want.
        };
        
        if (backpack player isEqualTo "B_ViperHarness_blk_F") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 55; //the weight you want.
        };

        if (backpack player isEqualTo "B_ViperHarness_ghex_F") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 55; //the weight you want.
        };

        if (backpack player isEqualTo "B_ViperHarness_oli_F") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 55; //the weight you want.
        };

        if (backpack player isEqualTo "B_FieldPack_ocamo_Medic") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 55; //the weight you want.
        };

        if (backpack player isEqualTo "B_FieldPack_ocamo_ReconMedic") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 55; //the weight you want.
        };

        if (backpack player isEqualTo "B_Carryall_ocamo") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 70; //the weight you want.
        };

        if (backpack player isEqualTo "B_Carryall_oucamo") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 70; //the weight you want.
        };

        if (backpack player isEqualTo "B_Carryall_mcamo") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 70; //the weight you want.
        };

        if (backpack player isEqualTo "B_Carryall_ocamo") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 70; //the weight you want.
        };

        if (backpack player isEqualTo "B_Carryall_oli") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 70; //the weight you want.
        };

        if (backpack player isEqualTo "B_Carryall_khk") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 70; //the weight you want.
        };

        if (backpack player isEqualTo "B_Carryall_cbr") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 70; //the weight you want.
        };

        if (backpack player isEqualTo "B_Bergen_tna_f") then { //Backpack id right now is ""
            _bp = backpack player;
            life_maxWeight = 90; //the weight you want.
        };

    
        if (!(backpack player isEqualTo "") && {!(backpack player isEqualTo _bp)}) then {
            _bp = backpack player;
            life_maxWeight = LIFE_SETTINGS(getNumber,"total_maxWeight") + round(FETCH_CONFIG2(getNumber,"CfgVehicles",_bp,"maximumload") / 4);
        };
    };

    /* Check if the player's state changed? */
    if (!(vehicle player isEqualTo _lastState) || {!alive player}) then {
        [] call life_fnc_updateViewDistance;
        _lastState = vehicle player;
    };

    /* Check if the weight has changed and the player is carrying to much */
    if (life_carryWeight > life_maxWeight && {!isForcedWalk player} && {!life_god}) then {
        player forceWalk true;
        if (LIFE_SETTINGS(getNumber,"enable_fatigue") isEqualTo 1) then {player setFatigue 1;};
        hint localize "STR_NOTF_MaxWeight";
    } else {
        if (isForcedWalk player) then {
            player forceWalk false;
        };
    };

    /* Travelling distance to decrease thirst/hunger which is captured every second so the distance is actually greater then 650 */
    if (!alive player || {life_god}) then {_walkDis = 0;} else {
        _curPos = visiblePosition player;
        _curPos = (_curPos select 0) + (_curPos select 1);
        if (!(_curPos isEqualTo _lastPos) && {(isNull objectParent player)}) then {
            _walkDis = _walkDis + 1;
            if (_walkDis isEqualTo 650) then {
                _walkDis = 0;
                life_thirst = life_thirst - 5;
                life_hunger = life_hunger - 5;
                [] call life_fnc_hudUpdate;
            };
        };
        _lastPos = visiblePosition player;
        _lastPos = (_lastPos select 0) + (_lastPos select 1);
    };
    uiSleep 1;

    [] spawn
{
    private["_bp","_load","_cfg"];
    while{true} do
    {
        waitUntil {backpack player != ""};
        _bp = backpack player;
        _cfg = getNumber(configFile >> "CfgVehicles" >> (backpack player) >> "maximumload");
        _load = round(_cfg / 8);
        life_maxWeight = life_maxWeight + _load;
        if(playerSide == west) then {(unitBackpack player) setObjectTextureGlobal [1,""];}; // <---- Sac invisible chez les flics
        if(playerSide == independent) then {(unitBackpack player) setObjectTextureGlobal [1,""];}; // <----- Sac Invisible chez les Medics
        waitUntil {backpack player != _bp};
        if(backpack player == "") then 
        {
            life_maxWeight = life_maxWeight;
        };
    };
};

};

 

Share this post


Link to post
Share on other sites

Hey man, I'm having a similar issue, whatever I do, my max weight stays at the default 24 weight, no matter what backpack I wear.

 

I tried using your code (doing them all separately) but it still isn't working.

Share this post


Link to post
Share on other sites
On 4/12/2020 at 1:14 AM, Woolsey_Tv said:

Hey man, I'm having a similar issue, whatever I do, my max weight stays at the default 24 weight, no matter what backpack I wear.

 

I tried using your code (doing them all separately) but it still isn't working.

Try returning to default code it seems to have helped others fix it.

fn_survival.sqf -

 

 

    } else {
        if (!(backpack player isEqualTo "") && {!(backpack player isEqualTo _bp)}) then {
            _bp = backpack player;
            life_maxWeight = LIFE_SETTINGS(getNumber,"total_maxWeight") + round(FETCH_CONFIG2(getNumber,"CfgVehicles",_bp,"maximumload") / 4);

            [] call life_fnc_hudUpdate;
        };
    };

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×