“LlAllowInventoryDrop”的版本间的差异
第93行: | 第93行: | ||
|'''相关事件''' | |'''相关事件''' | ||
|- | |- | ||
− | |'''''All Issues'''''~[http://wiki.secondlife.com/wiki/LlAllowInventoryDrop] | + | |'''''All Issues'''''~[http://wiki.secondlife.com/wiki/LlAllowInventoryDrop 原网站] |
|} | |} |
2020年3月8日 (日) 09:51的版本
首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials |
函数名 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. |
注意事项 |
|
示例 |
当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~原网站 |