Difference between revisions of "INVENTORY CLOTHING"

From Second Life Wiki
Jump to: navigation, search
(cut to the chase)
Line 4: Line 4:
 
|value=5
 
|value=5
 
|desc=Used with {{LSLGC|Inventory|Inventory}} functions and specifies inventory items of CLOTHING type will be retrieved by the function.
 
|desc=Used with {{LSLGC|Inventory|Inventory}} functions and specifies inventory items of CLOTHING type will be retrieved by the function.
|examples=<lsl>//Gives inventory only to agents with the same active group
+
|examples=<lsl>//Give all clothing items from prim's contents to anyone touching this object
 
default
 
default
 
{
 
{
 
     touch_start(integer total_number)
 
     touch_start(integer total_number)
 
     {
 
     {
         integer number = 0;
+
         // get the UUID of the person touching this object
         do
+
        key user = llDetectedKey(0);
         {
+
         integer count = llGetInventoryNumber(INVENTORY_CLOTHING);
            if (llDetectedGroup(number)) //same as llSameGroup(llDetectedKey(number)) (with llSameGroup, detected must be in the sim)
+
         while (count--)
                llGiveInventory(llDetectedKey(number), llGetInventoryName(INVENTORY_CLOTHING,0));
+
        // Give them each item of clothing found in the object's contents
            else
+
            llGiveInventory(user, llGetInventoryName(INVENTORY_CLOTHING, count) );
                llSay(0, "Wrong active group!");
+
        }while(total_number > ++number);
+
 
     }
 
     }
 
}</lsl>
 
}</lsl>

Revision as of 08:07, 7 January 2013

Description

Constant: integer INVENTORY_CLOTHING = 5;

The integer constant INVENTORY_CLOTHING has the value 5

Used with Inventory functions and specifies inventory items of CLOTHING type will be retrieved by the function.

Examples

<lsl>//Give all clothing items from prim's contents to anyone touching this object default {

   touch_start(integer total_number)
   {
       // get the UUID of the person touching this object
       key user = llDetectedKey(0);
       integer count = llGetInventoryNumber(INVENTORY_CLOTHING);
       while (count--)
       // Give them each item of clothing found in the object's contents
           llGiveInventory(user, llGetInventoryName(INVENTORY_CLOTHING, count) );
   }

}</lsl>

Deep Notes

Search JIRA for related Issues

Signature

integer INVENTORY_CLOTHING = 5;