ACE3/addons/gunbag/functions/fnc_status.sqf

32 lines
676 B
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
2016-05-03 08:21:21 +00:00
/*
* Author: Ir0n1E
* Check gunbag status full/empty.
2016-05-03 08:21:21 +00:00
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player] call ace_gunbag_fnc_status
2016-05-03 08:21:21 +00:00
*
* Public: No
*/
params ["_unit"];
2016-06-12 11:51:23 +00:00
private _state = (backpackContainer _unit) getVariable [QGVAR(gunbagWeapon), []];
2016-05-03 08:21:21 +00:00
2016-06-12 11:51:23 +00:00
if (_state isEqualTo []) then {
2016-05-17 09:21:48 +00:00
[localize LSTRING(empty)] call EFUNC(common,displayTextStructured);
2016-05-03 08:21:21 +00:00
} else {
2016-06-12 11:51:23 +00:00
_state params ["_weapon"];
[
getText (configFile >> "CfgWeapons" >> _weapon >> "displayname"),
getText (configFile >> "CfgWeapons" >> _weapon >> "picture")
] call EFUNC(common,displayTextPicture);
2016-05-03 08:21:21 +00:00
};