Inventory Dump (pay version)

From ZenMondo Wormser, 1 Year ago, written in Linden Scripting, viewed 389 times.
URL http://flynnos.org/flynnbin/view/af722b52 Embed
Download Paste or View Raw
  1. //////////////////////
  2. //Inventory Dump (pay version) by ZenMondo Wormser
  3. //
  4. // Just place in a prim, along with the inventory items to be given.
  5. // To retrieve the inventory, pay the prim.
  6. // Contents will be given in a folder named what you want by changing
  7. // a line below (default is Inventory Dump).
  8. //////////////////////
  9.  
  10. // Change "Inventory Dump"  to the name of the folder you want the object to give.(keep the quotes)
  11. string folder_name = "Inventory Dump";
  12.  
  13. // Change 1 to the amount you would like people to pay to recieve the inventory.
  14. integer pay_amount = 1;
  15.  
  16.  
  17. {
  18.     state_entry()
  19.     {
  20.         llRequestPermissions(llGetOwner(),PERMISSION_DEBIT); //To refund wrong amounts.
  21.         llSetPayPrice(PAY_HIDE, [pay_amount, PAY_HIDE, PAY_HIDE, PAY_HIDE]);  
  22.     }
  23.  
  24.     touch_start(integer num_detected)
  25.     {
  26.         llSay(0, "Pay me L$" + (string) pay_amount + " to recieve my contents");  
  27.     }
  28.    
  29.    
  30.     money(key giver, integer amount)
  31.     {
  32.         if(amount != pay_amount)
  33.         {  
  34.             llSay(0, "Wrong amount paid. Refunding...");
  35.             llGiveMoney(giver, amount);
  36.             return;
  37.         }
  38.        
  39.         else
  40.         {
  41.        
  42.             integer counter = 0;
  43.             integer inventory_num = llGetInventoryNumber(INVENTORY_ALL);
  44.        
  45.             list inventory_list;
  46.        
  47.             while(counter < inventory_num)
  48.             {
  49.                 inventory_list = (inventory_list=[]) + inventory_list + llGetInventoryName(INVENTORY_ALL, counter);
  50.                 counter ++;
  51.             }
  52.        
  53.             list scriptname = [llGetScriptName()];
  54.        
  55.             integer index = llListFindList(inventory_list, scriptname);
  56.        
  57.             inventory_list = llDeleteSubList(inventory_list, index, index);
  58.        
  59.        
  60.             llGiveInventoryList(giver, folder_name, inventory_list);
  61.         }
  62.        
  63.        
  64.     }
  65. }

Reply to "Inventory Dump (pay version)"

Here you can reply to the paste above

captcha