GetItemCount - ObjectReference: Difference between revisions

Jump to navigation Jump to search
m
Convert source tags to syntaxhighlight
imported>Terra Nova2
m (→‎Notes: typos)
m (Convert source tags to syntaxhighlight)
 
Line 6: Line 6:


== Syntax ==
== Syntax ==
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
int Function GetItemCount(Form akItem) native
int Function GetItemCount(Form akItem) native
</source>
</syntaxhighlight>


== Parameters ==
== Parameters ==
Line 21: Line 21:


== Examples ==
== Examples ==
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
if (Game.GetPlayer().GetItemCount(WeapTypeSwordKeyword) == 0)
if (Game.GetPlayer().GetItemCount(WeapTypeSwordKeyword) == 0)
   Debug.Trace("Player has no swords")
   Debug.Trace("Player has no swords")
endIf
endIf
</source>
</syntaxhighlight>
<br/>
<br/>
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
if (Game.GetPlayer().GetItemCount(SuperSecretPotionReference) == 0)
if (Game.GetPlayer().GetItemCount(SuperSecretPotionReference) == 0)
   Debug.Trace("Player doesn't have the super-secret potion")
   Debug.Trace("Player doesn't have the super-secret potion")
endIf
endIf
</source>
</syntaxhighlight>


== Notes ==
== Notes ==

Navigation menu