Template:Needs Translation/
函数详情
函数名 Function: llAllowInventoryDrop( integer add );
|
参数
|
integer
add
–
boolean, If TRUE it allows anyone, even if they don't have modify rights to a prim, regardless of whether they are the owner or not, to drop items into that prim, If FALSE (default) inventory dropping can still be done, but it is restricted only to people with modify permissions to that prim
|
返回值
|
Allows for all users without modify permissions to add inventory items to a prim.
|
注意事项
|
- In a link set llAllowInventoryDrop must be executed from a script within the root prim or it fails silently.
- Scripts are an exception to what is allowed to be dropped in. If a user without modify permissions to a prim attempts to drop a script into it, the inventory addition is rejected and the prim shouts (sic -- shouts, not says) "Not permitted to edit this!" This is for obvious security reasons. If you own the prim and have mod rights to it, you can drop a script in. Friends who have mod rights to your stuff can also drop scripts in.
- Will not work if, under the Object tab on the prim, "Locked" is ticked.
- Bear in mind when dropping a texture into a prim to be sure (a) that you see a red box framing the target prim, and (b) not to release the Ctrl button until you are sure that the texture is actually inside the box. If you see a white frame instead, or release Ctrl too soon, the texture will instead be applied to the prim face that you were on.
- There is no way to tell who dropped the item in. If you really need to know, consider making the user touch the prim first to turn the llAllowInventoryDrop on, and then grab the user's information from the touch event, and then set it back to FALSE through a timer.
- Nor is there any way based on just llAllowInventoryDrop to tell *what* the user dropped in. See WhoAddedWhat script to handle that.
- Ordinary end-users may face challenges when confronted with actually performing the drag and drop. See the section below.
- People with modify rights to your (modifiable) stuff can do this anyway, as can you, even without the presence of llAllowInventoryDrop.
- Even if you own the prim, but don't have modify rights to it, you cannot drop anything at all into it, ever, unless the creator put in it an llAllowInventoryDrop(TRUE) first before passing it to you.
- If you have a prim that you don't have mod rights to, but that the creator did set an llAllowInventoryDrop(TRUE) in, that even though you can drop stuff in, you will never be able to delete it! You can however move it to your inventory.
|
示例
|
当llAllowInventoryDrop被设置为TRUE,并且某人在没有修改权限的情况下成功删除了某个项时,将使用CHANGED_ALLOWED_DROP位设置更改发生的事件。
changed(integer change)
{
if (change & CHANGED_ALLOWED_DROP)
llSay(0, "Your contribution is appreciated, o ye non-permitted modifier!");
}
|
当一个具有修改权限的人成功地删除了一个条目时,不管llAllowInventoryDrop()的状态如何,所发生的事件都是CHANGED_INVENTORY ()
changed(integer change)
{
if (change & CHANGED_INVENTORY)
llSay(0, "Your contribution is appreciated, o ye permitted modifier!");
}
|
提示!要测试任何一个改变的事件,正确的语法是:
changed(integer change)
{
//PUBLIC_CHANNEL has the integer value 0
if (change & (CHANGED_ALLOWED_DROP | CHANGED_INVENTORY))
llSay(PUBLIC_CHANNEL, "yeppers, inventory changed somehow.");
}
|
下面的示例比较复杂。它演示了AllowInventoryDrop和on的交替。(除非你真的想玩弄用户的心思,否则你可能不会真的这么做。)
integer allow;
default
{
touch_start(integer num)
{
llAllowInventoryDrop(allow = !allow);
llOwnerSay("llAllowInventoryDrop == " + llList2String(["FALSE","TRUE"], allow));
}
changed(integer change)
{
//note that it's & and not &&... it's bitwise!
if (change & CHANGED_ALLOWED_DROP)
llOwnerSay("The inventory has changed as a result of a user without mod permissions dropping
an item on the prim and it being allowed by the script.");
}
}
|
相关
|
Events
changed
–
CHANGED_ALLOWED_DROP
|
相关事件
|
All Issues~[1]
|