Advertisement
sonixapache

LootBag script 0.1b

Mar 17th, 2014
2,169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.00 KB | None | 0 0
  1. /*
  2. SonixApache's LootBag script 0.1b - Copy all the shit a dead guy has and stuffs it in a box.
  3. Based on Comfy's Loot Prevention script ( http://pastebin.com/ZqakyDNr )
  4. */
  5.  
  6.  
  7. if (!isServer) exitWith {};
  8.  
  9.     com_bag =
  10.     {
  11.         //Set up params, create a box
  12.         _unit = _this select 0;
  13.         _box =  "Box_IND_Ammo_F" createVehicle (position _unit);
  14.         ClearWeaponCargoGlobal _box;
  15.         ClearMagazineCargoGlobal _box;
  16.         _UnitRadios = [_unit] call acre_api_fnc_getCurrentRadioList;
  17.         _UnitWeapons = weapons _unit;
  18.         _UnitItems = items _unit;
  19.         _UnitAssignedItems = assignedItems _unit;
  20.         _UnitGunItems = primaryWeaponItems _unit;
  21.         _UnitMagazines = magazines _unit;
  22.        
  23.         //Fill box with copies of stuff in unit's inventory
  24.         {_box addItemCargoGlobal [_x,1]} forEach _UnitItems;
  25.         {_box addItemCargoGlobal [_x,1]} forEach _UnitAssignedItems;
  26.         {_box addWeaponCargoGlobal [_x,1]} forEach _UnitWeapons;
  27.         {_box addMagazineCargoGlobal [_x,1]} forEach _UnitMagazines;
  28.         {_box addItemCargoGlobal [_x,1]} forEach _UnitGunItems;  
  29.         {_box addWeaponCargoGlobal [_x,1]} forEach _UnitRadios;
  30.         {_box addItemCargoGlobal [_x,1]} forEach _UnitRadios;
  31.        
  32.         sleep 1;
  33.        
  34.         //remove remove
  35.         removeAllWeapons _unit;
  36.         removeAllItems _unit;
  37.         removeBackpack _unit;
  38.            
  39.         _unit unlinkItem "ItemGPS";
  40.         _unit unlinkItem "ItemMap";
  41.         _unit unlinkItem "ItemRadio";
  42.         _unit unlinkItem "ItemWatch";
  43.         _unit unlinkItem "ItemCompass";
  44.         _unit unlinkItem "NVGoggles";
  45.         _unit unlinkItem "NVGoggles_INDEP";
  46.         _unit unlinkItem "NVGoggles_OPFOR";
  47.         {_unit removeWeapon _x} forEach (call acre_api_fnc_getCurrentRadioList);
  48.         removeVest _unit;
  49.         removeUniform _unit;
  50.         removeHeadgear _unit;
  51.         removeGoggles _unit;
  52.     };
  53.  
  54. while {true} do
  55.     {
  56.         sleep 2;
  57.             {
  58.              if (_x in switchableUnits || _x in playableUnits) then
  59.                 {
  60.                 if (isNil {_x getVariable "com_bag"}) then
  61.                     {
  62.                     _x setVariable ["com_bag", 1, false];
  63.                     _x addEventHandler ["killed", {[_this select 0] spawn com_bag}];
  64.                     };
  65.                 };
  66.             } forEach allUnits;
  67.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement