AddItem - ObjectReference: Difference between revisions

Jump to navigation Jump to search
m
Convert source tags to syntaxhighlight
imported>SarthesArai
m (→‎Notes: shortening link)
m (Convert source tags to syntaxhighlight)
 
Line 7: Line 7:


== Syntax ==
== Syntax ==
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
Function AddItem(Form akItemToAdd, int aiCount = 1, bool abSilent = false) native
Function AddItem(Form akItemToAdd, int aiCount = 1, bool abSilent = false) native
</source>
</syntaxhighlight>


== Parameters ==
== Parameters ==
Line 22: Line 22:


== Examples ==
== Examples ==
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
; Add a two diamonds to the player's inventory, silently
; Add a two diamonds to the player's inventory, silently
Game.GetPlayer().AddItem(Diamond, 2, true)
Game.GetPlayer().AddItem(Diamond, 2, true)
</source>
</syntaxhighlight>
<br>
<br>
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
; Move the special gem reference from wherever it is into the chest
; Move the special gem reference from wherever it is into the chest
Chest.AddItem(SpecialGemRef)
Chest.AddItem(SpecialGemRef)
</source>
</syntaxhighlight>


== Notes ==
== Notes ==

Navigation menu