Jump to content
Casio91Fin

player inventory weight script

Recommended Posts

Hey.
Does anyone have an Inventory weight script.
The only thing I've found is this, but I don't get it to work

Quote

 

player addEventHandler ["InventoryOpened", {

[] spawn

{

    waitUntil {!isNull (findDisplay 602)};

    player addEventHandler ["InventoryClosed",

    {

        removeMissionEventHandler ["Draw3D", missionNamespace getVariable "WGP_UI_redraw"];

    }];

    _whileopen = addMissionEventHandler ["Draw3D",

    {

        _load = (round (loadAbs player * (1 / 2.2046) * 10 ^ 2 / 10)) / 10 ^ 2;

    }];

    missionNamespace setVariable ["WGP_UI_redraw", _whileopen];

};

}];

 

 

Share this post


Link to post
Share on other sites

What is your script supposed to do? There is the loadAbs command to return the weight of all items a unit is carrying

Share this post


Link to post
Share on other sites
4 hours ago, 7erra said:

What is your script supposed to do?

When a player opens their own inventory 

then somewhere in the corner of the inventory would show how much stuff the player is carrying "Kg" 

Share this post


Link to post
Share on other sites
4 hours ago, 7erra said:

What is your script supposed to do?

 

Convert to metric.

 

*edit* lol, beat me by five seconds

Edited by Harzach

Share this post


Link to post
Share on other sites

The thing is, mass in Arma is already metric, so this is sorta silly.

Share this post


Link to post
Share on other sites

The ACE mod displays this value in the inventory by default. 

It uses this function for the calculation. Note the use of CBA:
https://github.com/acemod/ACE3/blob/master/addons/common/functions/fnc_getWeight.sqf

But you will have to dig some more into the "common" functions and scripts to find how exactly this value is displayed to the player in their inventory screen. 

They have a slack and a GitHub where you can message with questions: 
https://github.com/acemod/ACE3

Good luck!

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

×