Code: Select all
int UseInventoryItem (str ClassName)
If the item was successfully used, the function returns 1 (TRUE), otherwise if the player doesn't have this type of item or it was not used because of some other condition, it returns 0 (FALSE).
Or if it isn't possible to get the state of the item's usage, then having it's return be void would be fine since one could simply check the amounts before and after to see of it decreased by one.
When scripting my inventory system, I noticed a function like this was completely lacking, despite there being a check, take, give, and clear.