LlRemoveInventory

来自人工智能助力教育知识百科
跳转至: 导航搜索

Template:Needs Translation/


函数名
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();
    }
}
相关函数
相关事件