Forums » Bugs
GetInventoryItemInfo
Very low priority, but GetInventoryItemInfo(itemid) currently returns the same thing as GetInventoryItemIcon(itemid), i.e., the path to the item's icon. I don't know how long it's been this way, but it doesn't return the item info table.
I think that function has multiple return values of which the icon is the first.
I tried it out with both console_print() and printtable(), and that is the only thing it returned. If it's hiding multiple return values beyond that, I don't know how.
try something like
local icon,name = GetInventoryItemInfo(itemid)
print(name)
or plop all values into a table
printtable({GetInventoryItemInfo(itemid)})
print(({GetInventoryItemInfo(itemid)})[2])
local icon,name = GetInventoryItemInfo(itemid)
print(name)
or plop all values into a table
printtable({GetInventoryItemInfo(itemid)})
print(({GetInventoryItemInfo(itemid)})[2])
Spuck is correct. The GetInventoryItemInfo() function essentially returns everything that the GetInventoryItem*() functions return as multiple return values.
The easiest thing to do to see them all is:
printtable{GetInventoryItemInfo(item)}
which is syntactic sugar to:
printtable({GetInventoryItemInfo(item)})
The easiest thing to do to see them all is:
printtable{GetInventoryItemInfo(item)}
which is syntactic sugar to:
printtable({GetInventoryItemInfo(item)})
console_print(GetInventoryItemInfo(item)) works too. <.<
Ah, I was unaware of that expansion possibility. Thanks for letting me know. I grow less noobish in lua every day, only to remain eternally an utter noob.