Template:Needs Translation/
函数名
|
Function: integer llGetInventoryType( string name )
|
参数:string name–name of an inventory item
|
返回值:返回一个整数,该整数是库存项名称的类型
|
示例
|
string get_type_info(integer inputInteger)
{
if (inputInteger == INVENTORY_TEXTURE)
return "INVENTORY_TEXTURE";
else if (inputInteger == INVENTORY_SOUND)
return "INVENTORY_SOUND";
else if (inputInteger == INVENTORY_LANDMARK)
return "INVENTORY_LANDMARK";
else if (inputInteger == INVENTORY_CLOTHING)
return "INVENTORY_CLOTHING";
else if (inputInteger == INVENTORY_OBJECT)
return "INVENTORY_OBJECT";
else if (inputInteger == INVENTORY_NOTECARD)
return "INVENTORY_NOTECARD";
else if (inputInteger == INVENTORY_SCRIPT)
return "INVENTORY_SCRIPT";
else if (inputInteger == INVENTORY_BODYPART)
return "INVENTORY_BODYPART";
else if (inputInteger == INVENTORY_ANIMATION)
return "INVENTORY_ANIMATION";
else if (inputInteger == INVENTORY_GESTURE)
return "INVENTORY_GESTURE";
else if (inputInteger == INVENTORY_SETTING)
return "INVENTORY_SETTING";
// else
return "<!-- inventory type unknown --!>";
}
default
{
touch_start(integer num_detected)
{
integer totalItems = llGetInventoryNumber(INVENTORY_ALL);
integer index;
while (index < totalItems)
{
string itemName = llGetInventoryName(INVENTORY_ALL, index);
integer type = llGetInventoryType(itemName);
// PUBLIC_CHANNEL has the integer value 0
llSay(PUBLIC_CHANNEL,
"'" + itemName + "' (" + get_type_info(type) + ")");
++index;
}
}
}
|