deltreey

nwscript CompletelyEmptyInventory

Oct 5th, 2023
8,166
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | Gaming | 0 0
  1. void CompletelyEmptyInventory(object creature)
  2. {
  3.     // clear held/worn items
  4.     int i;
  5.     object stuff;
  6.     for (i = 0; i < NUM_INVENTORY_SLOTS; ++i)
  7.     {
  8.         stuff = GetItemInSlot(i, creature);
  9.         DestroyObject(stuff);
  10.     }
  11.     // clear items in general inventory
  12.     stuff = GetFirstItemInInventory(creature);
  13.     while (GetIsObjectValid(stuff))
  14.     {
  15.         DestroyObject(stuff);
  16.         stuff = GetNextItemInInventory(creature);
  17.     }
  18. }
  19.  
Advertisement