CY4 2 Posted February 12, 2021 Hi, I'm trying to figure out how to make a hint that shows the inventory weight of each player inside a trigger. I'm a total novice when it comes to scripting. I've tried doing this myself for a couple of hours now and I just can't. I need the pros to help. I looked at the BIKI for load, loadAbs, hint, hintSilent, and I can't remember where else. I tried numerous google searches to find some simple answer to this but to no avail. I'd really appreciate some help, Thank you. Share this post Link to post Share on other sites
stanhope 409 Posted February 12, 2021 Put in onactivation: private _hintText = "Players weight:"; { _hintText = parseText format ["%1<br/>%2: %3", _hintText, name _x, load _x]; } forEach thisList; hint _hintText; Untested, let me know if it works 3 Share this post Link to post Share on other sites
CY4 2 Posted March 16, 2021 Hi, for some reason I never got a notification that someone replied lol. That does work to show the weight! Thank you! But instead of going away like a regular hint, I'd like it to stay for as long as there are players in the trigger and I'd also like it to update each second while active as well, is that possible?EDIT: I figured this part out myself, yay!Could you instead maybe direct me on how to have the returned weight value show the weight with the proper decimal? For example, as of now, if I have "45.2lbs" of gear, it shows as "452". Any ideas? Share this post Link to post Share on other sites
CY4 2 Posted March 16, 2021 Okay so check this out, I have been able to modify the code you provided and through a lot of trial and error here is what it looks like: Quote private _hintText = "Loadout Weight"; { _hintText = parseText format ["%1<br/>%2: %3%4", _hintText, name _x, (round (loadAbs _x * 10 ^ 2 / 10)) / 10 ^ 2, "lbs"]; } forEach thisList; hintSilent _hintText; Tested on a dedicated server with two friends and I'm left with only ONE more issue currently. I can't figure out how to linebreak after each player on the list. As soon as 2 or more players are in the trigger, the current linebreak between %1 and %2 doesn't even work anymore. Example of what it looks like with only 1 player named "Cypher" in the trigger: Quote Loadout Weight Cypher: 45.2lbs And what it looks like once there are two players named "Cypher" and "Ace" inside: Quote Loadout WeightCypher: 45.2lbsAce: 45.2lbs Any ideas? Share this post Link to post Share on other sites
Schatten 254 Posted March 16, 2021 @CY4, use this code: _loadoutWeightsInfo = thisList apply { format ["%1: %2lbs", name _x, (round ((loadAbs _x) * 10)) / 10 ^ 2] }; hintSilent (parseText (format ["Loadout Weight<br/>%1", _loadoutWeightsInfo joinString "<br/>"])); 3 Share this post Link to post Share on other sites
CY4 2 Posted March 19, 2021 Thanks that works like a charm! 1 Share this post Link to post Share on other sites