|
Smithy Zeno
ownes 9 pet cacti
Join date: 3 Aug 2006
Posts: 52
|
03-22-2008 07:30
Hey Everyone, I'm making a vendor and it has been going well. But I am getting stuck on reading what permissions the next owner will have on the next item. I tried to use this: if(llGetInventoryPermMask(llList2String(object,current),PERM_COPY) == 0x00008000) { llSay(0, "Copy"); }
I got the the '0x00008000' from the LSL Wiki because it said that was the value for the permission copy. Alas, it doesn't work. If someone could be kind enough to help me out, that'd be great (and yes I have all the variables set up properly). -Smithy
_____________________
-Smithy
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
Use & NOT ==
03-22-2008 08:21
Try this: name = llList2String(object,current); mask = MASK_NEXT; pFlags = llGetInventoryPermMask( name, mask ); if ( pFlags & PERM_COPY ) llSay(0,"Copy"  ; MASK_NEXT is the mask for permissions the next owner will get PERM_COPY is the mask for the Copy Permission
_____________________
From Studio Dora
|
|
Smithy Zeno
ownes 9 pet cacti
Join date: 3 Aug 2006
Posts: 52
|
03-22-2008 13:11
Thanks a bunch Dora, but I still have a problem. When I activate my vendor it gets the first object's permissions OK. But when I cycle to the next item, it says it has all permissions while it really has only copy permission ticked. Heres the code I am using: inv_object = llList2String(object,current); integer mask = MASK_NEXT; integer pFlags = llGetInventoryPermMask(inv_name,mask); if(pFlags & PERM_COPY) { llMessageLinked(LINK_SET,180,"yes","");//Its copy llSay(0, "copy"); } else { llMessageLinked(LINK_SET,180,"no","");//Its not copy } if(pFlags & PERM_MODIFY) { llMessageLinked(LINK_SET,181,"yes","");//Its mod llSay(0, "mod"); } else { llMessageLinked(LINK_SET,181,"no","");//Its not mod } if(pFlags & PERM_TRANSFER) { llMessageLinked(LINK_SET,182,"yes","");//Its trans llSay(0, "trans"); } else { llMessageLinked(LINK_SET,182,"no","");//Its not trans } }
_____________________
-Smithy
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
03-24-2008 14:40
I can't figure out what it could be from that piece of code. If each cycle gets a new name (inv_object) and that name is an object in your inventory, I don't see why it should not work And then again! you use 'inv_object' and 'inv_name'... should it not be: llGetInventoryPermMask(inv_object,mask); ???
_____________________
From Studio Dora
|