Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Stop llGiveInventory perms madness

Mathieu Basiat
Wavemaster
Join date: 24 Apr 2006
Posts: 57
07-13-2007 11:03
Hi, trying to stop the weird permission changes that sometimes happen with llGiveInventory().

What I hope to accomplish is that IF the object given is accidently given or becomes copy/tranfer, it will detect this on rez, dies and notifies both the owner and the creator.


This script seems like it works for items you don't want to be BOTH copy and transfer. Can anyone see anything inherently wrong with doing it this way, or point to a better way of doing it?

default
{
on_rez(integer params)
{
integer perm_mask = llGetObjectPermMask(MASK_NEXT);
if((perm_mask & PERM_COPY) && (perm_mask & PERM_TRANSFER)) {
llOwnerSay("Object has bad permissions, please contact " + llKey2Name(llGetCreator()) + " for a correct copy of " + llGetObjectName());

llEmail("me@mydomain.com", "Permissions Error", llKey2Name(llGetOwner()));

llSleep(3);

llDie();


}

}
}





ETA: llEmail creator, llSleep
Lyn Mimistrobell
(waiting)
Join date: 11 Jan 2007
Posts: 179
07-13-2007 11:20
I'd also llInstantMessage the creator, telling him/her which customer should receive a new copy so not everybody starts spamming him/her for one. It also enables the creator to be pro-active and contact the customer and send him/he a new copy.

Lyn
Mathieu Basiat
Wavemaster
Join date: 24 Apr 2006
Posts: 57
07-13-2007 13:33
Thanks, good idea....I think I would rather llEmail myself in case SL broke and sent me thousands of IMs, that also gives me the object name and location where it was...

Also adding a llSleep because of this comment on the wiki:

http://lslwiki.net/lslwiki/wakka.php?wakka=llDie&show_comments=1#comments

From: someone
If you're trying to detect object's owner (llGetOwnerKey()) or something like that, just before it dies, don't. Lag slows the detection to the point where the object is already dead and it's key is invalid, thus has no owner.
-- MeLightKorvin (2006-04-13 03:48:52)
Mathieu Basiat
Wavemaster
Join date: 24 Apr 2006
Posts: 57
07-16-2007 17:19
I've decide to only use this scripts with copy objects that i don't want transfer, that way, they will at least have the original copy object to rez that should have proper permissions, and if not, this will only affect the rezzing of the bad objects. please feel free to disagree...