查看“LlAllowInventoryDrop”的源代码
←
LlAllowInventoryDrop
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}} {|style="background:; color:" border=1 |+'''函数详情''' |-style="background:#FFF3EE; color:" |'''函数名 Function: llAllowInventoryDrop( integer add );''' |-style="background:#FFF3EE; color:" |'''参数''' |- |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 |-style="background:#FFF3EE; color:" |'''返回值''' |- |Allows for all users without modify permissions to add inventory items to a prim. |-style="background:#FFF3EE; color:" |'''注意事项''' |- | *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. |-style="background:#FFF3EE; color:" |'''示例''' |- |当llAllowInventoryDrop被设置为TRUE,并且某人在没有修改权限的情况下成功删除了某个项时,将使用CHANGED_ALLOWED_DROP位设置更改发生的事件。 <pre> changed(integer change) { if (change & CHANGED_ALLOWED_DROP) llSay(0, "Your contribution is appreciated, o ye non-permitted modifier!"); } </pre> |- |当一个具有修改权限的人成功地删除了一个条目时,不管llAllowInventoryDrop()的状态如何,所发生的事件都是CHANGED_INVENTORY () <pre> changed(integer change) { if (change & CHANGED_INVENTORY) llSay(0, "Your contribution is appreciated, o ye permitted modifier!"); } </pre> |- |提示!要测试任何一个改变的事件,正确的语法是: <pre> changed(integer change) { //PUBLIC_CHANNEL has the integer value 0 if (change & (CHANGED_ALLOWED_DROP | CHANGED_INVENTORY)) llSay(PUBLIC_CHANNEL, "yeppers, inventory changed somehow."); } </pre> |- |下面的示例比较复杂。它演示了AllowInventoryDrop和on的交替。(除非你真的想玩弄用户的心思,否则你可能不会真的这么做。) <pre> 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."); } } </pre> |-style="background:#FFF3EE; color:" |'''相关''' |- |'''Events''' * changed – CHANGED_ALLOWED_DROP |-style="background:#FFF3EE; color:" |'''相关事件''' |- |'''''All Issues''''''~http://wiki.secondlife.com/wiki/LlAllowInventoryDrop |}
该页面使用的模板:
模板:LSL Header
(
查看源代码
)
模板:LSLC
(
查看源代码
)
模板:LSLGC
(
查看源代码
)
模板:Multi-lang
(
查看源代码
)
返回至
LlAllowInventoryDrop
。
导航菜单
个人工具
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
网站首页
知识百科
编辑帮助
最近更改
工具
链入页面
相关更改
特殊页面
页面信息