Advertisement
Guest User

Code for creating a paste-able code virtual arsenal

a guest
Jan 11th, 2018
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.16 KB | None | 0 0
  1. _contents = [];
  2. _container = _this;
  3. _array = [ "backpack", "item", "magazine", "weapon" ];
  4. {
  5.   _tmp = call compile format ["_container call BIS_fnc_getVirtual%1Cargo", _x];
  6.   _contents pushBack _tmp;
  7. }forEach _array;
  8. {
  9.   _tmp = _container call compile format [ "get%1Cargo _this", _x ];
  10.   _contents pushBack _tmp;
  11. }forEach _array;
  12. copyToClipboard format ["_contents=%1;_newObject=_this;nul=[""AmmoboxInit"",[_newObject,false]] spawn BIS_fnc_arsenal;clearBackpackCargoGlobal _newObject;clearItemCargoGlobal _newObject;clearMagazineCargoGlobal _newObject;clearWeaponCargoGlobal _newObject;{_toAdd = _contents select _forEachIndex;_forEachIndexTwo = _forEachIndex + 4;_toAddTwo = _contents select _forEachIndexTwo;_quantities = _toAddTwo select 1;_inventory = _toAddTwo select 0;_fnc = missionNamespace getVariable format [ ""BIS_fnc_addVirtual%3Cargo"", _x ]; _category = _x; {_quantity = _quantities select _forEachIndex; call compile format [""_newObject add%3CargoGlobal ['%4', %5]"", _category, _x, _quantity];} foreach _inventory; [_newObject, _toAdd, true ] call _fnc; }forEach %2;systemChat ""pasted"";  ", _contents, _array, "%1", "%2", "%3"];
  13. systemChat "copied";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement