Difference between revisions of "AddItem"

258 bytes added ,  13:47, 6 June 2006
You can use reference-variables for ObjectID !
imported>Deathbane27
imported>JOG
(You can use reference-variables for ObjectID !)
Line 1: Line 1:
=='''Description'''==
=='''Description'''==


Adds Count items of object ''ObjectID'' to the calling container's inventory.  
Adds ''Count'' items of object ''ObjectID'' to the calling container's inventory.  


<br>
=='''Syntax'''==
=='''Syntax'''==
  AddItem ''ObjectID'', ''Count''  
  AddItem ''ObjectID'', ''Count''  


=='''Example'''==
<br>
  AddItem MyObject, 1  
=='''Examples'''==
  AddItem MyObject, 1


<br/><br/><br/>
Ref MyItem
Short count
set MyItem to ArenaAkaviriLongSword
set count to 1
player.additem MyItem Count


=='''User Comments'''==
<br>
=='''Notes'''==


* You can use a [[Variable_types:_reference_variables|reference variable]] as ''ObjectID'' and a [[Variable_types:_shortint|short]] variable for ''count''.


NOTE: This will not trigger [[OnAdd]] blocks, because the item is created inside the inventory rather than actually being added. For creating items from the console that you need to trigger OnAdd, use [[PlaceAtMe]] instead and pick the item up from the ground.
* This will not trigger [[OnAdd]] blocks, because the item is created inside the inventory rather than actually being added. For creating items from the console that you need to trigger OnAdd, use [[PlaceAtMe]] instead and pick the item up from the ground.


----
----
Line 36: Line 45:


<br/><br/>
<br/><br/>


==Reference==
==Reference==
Anonymous user