ACE3/addons/arsenal/functions/fnc_statTextStatement_load.sqf
PabstMirror 9bb9fae85c
Arsenal - Show load stat's actual value (#9833)
* Arsenal - Show load stat's actual value

* Update addons/arsenal/functions/fnc_statTextStatement_load.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

---------

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
2024-03-09 17:17:13 -06:00

27 lines
688 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: PabstMirror
* Text statement for the load stat.
*
* Arguments:
* 0: Stats <ARRAY>
* 1: Item config path <CONFIG>
*
* Return Value:
* Stat Text <STRING>
*
* Public: No
*/
params ["_stats", "_config"];
TRACE_2("statTextStatement_load",_stats,_config);
if (!isNull (_config >> "ItemInfo" >> "containerClass")) then { // Uniform/Vest
_config = configfile >> "CfgVehicles" >> getText (_config >> "ItemInfo" >> "containerClass");
};
private _load = getNumber (_config >> (_stats # 0));
if (_load <= 0) exitWith { LELSTRING(common,none) };
format ["%1kg (%2lb)", (_load * 0.1 * (1 / 2.2046)) toFixed 2, (_load * 0.1) toFixed 2]