“LlRemoveInventory”的版本间的差异
(创建页面,内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}} {{函数详情 |函数名 = Function: llRemoveInventory( string item ); |参数= 参数:string…”) |
(没有差异)
|
2020年7月19日 (日) 03:09的最新版本
首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials |
函数名 |
---|
Function: llRemoveInventory( string item ); |
参数:string item – 此脚本所在的prim目录中的项目 |
返回值:删除已命名的库存项 |
注意事项 |
---|
如果物品从prim的库存中丢失,那么DEBUG_CHANNEL将显示一个错误。
如果当前脚本被删除,它将在此调用后继续运行一小段时间。 多次执行llRemoveInventory之后的llSleep(0.1)将允许编辑窗口内容正确刷新,并避免phantom内容上的错误。 llRemoveInventory不会触发一个已更改的事件。 |
示例 |
---|
示例1
// 从对象中删除当前脚本 default { state_entry() { llRemoveInventory(llGetScriptName()); } } // 要包含在脚本中的用户函数 // 删除除脚本本身之外的所有其他类型的内容 delete_all_other_contents() { string thisScript = llGetScriptName(); string inventoryItemName; integer index = llGetInventoryNumber(INVENTORY_ALL); while (index) { --index; // (faster than index--;) inventoryItemName = llGetInventoryName(INVENTORY_ALL, index); if (inventoryItemName != thisScript) llRemoveInventory(inventoryItemName); } } default { state_entry() { delete_all_other_contents(); } } |
相关函数 |
---|
无 |
相关事件 |
---|
无 |