Files
DayZ-Epoch/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_getGearItems.sqf
ebaydayz fe54b78bdb Add backpack selling to Advanced Trading
It was not possible to sell a backpack from your gear or vehicle.

Added option to sell from gear. Sell backpack from vehicle is still not
possible currently due to Arma limitations.
2016-05-05 14:55:50 -04:00

28 lines
859 B
Plaintext

/**
* call Z_getBackpackItems
*
* Gets all your items stored in your gear and innitiates the selling list.
**/
private ["_mags","_weaps","_skin","_formattedText","_bag","_bags"];
#include "defines.sqf";
call Z_clearLists;
Z_SellArray = [];
Z_SellableArray = [];
_mags = magazines player;
_weaps = weapons player;
_bag = unitBackpack player;
_bags = if (isNull _bag) then {[]} else {[typeOf _bag]};
_skin = typeOf player;
_pic = getText (configFile >> 'CfgVehicles' >> _skin >> 'portrait');
_formattedText = format [
"<t size='1' align='center' color='#ffffff'>%2</t><br />" +
"<img image='%1' size='3' align='center'/><br />"
, _pic, localize "STR_UI_GEAR"
];
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_CONTAINERINFO) ctrlSetStructuredText parseText _formattedText;
[_weaps,_mags,localize "STR_EPOCH_YOUR_GEAR",_bags] call Z_checkArrayInConfig;