WhoAddedWhat
Revision as of 05:16, 1 August 2008 by Laronzo Fitzgerald (talk | contribs)
To enable you to tell what has been added to a script on CHANGED_ALLOWED_DROP events you can use the following code:
<lsl>list content[]; // a list of all items already added to the object
if (change & CHANGED_ALLOWED_DROP || CHANGED_INVENTORY) {
integer n = llGetInventoryNumber(INVENTORY_ALL);
while(n) { integer valid = llGetListLength(contents); if(valid != 0) { string added = llGetInventoryName(INVENTORY_ALL, --n); integer index = llListFindList(contents, [added]); if(!(~index)) { if(type != 10 && (string)type != "") // don't add the object's script to the list of items! {
content += added; // add the new item to the checklist of inventory items
}
}
} }
}</lsl>