Difference between revisions of "GetItemCount"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>JOG
m
imported>JOG
m
Line 17: Line 17:
   
   
  set MyItem to ArenaAkaviriLongSword
  set MyItem to ArenaAkaviriLongSword
  if player.GetItemCount MyItem > 0
  if player.GetItemCount MyItem == 0
   message "Hail, owner of the Akaviri Longsword"
   player.additem MyItem 1
  endif
  endif
   
   

Revision as of 14:08, 10 June 2006

Returns the number of ObjectID in the actor's inventory. It also works for containers.


Syntax:

 GetItemCount ObjectID


Examples:

if (GetItemCount Gold001 <= 0)
  disable
endif
Ref MyItem
Short count

set MyItem to ArenaAkaviriLongSword
if player.GetItemCount MyItem == 0
  player.additem MyItem 1
endif

Notes:

  • You can use a reference variable as ObjectID.


See Also

AddItem

RemoveItem