HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

This is probably a stupid question, but...

08-19-2009, 11:19 PM#1
DillanDespair
I've only been using JASS for a little while, so I'm not how to fix this.
Every time I use the code

Collapse JASS:
call UnitAddItem( udg_hero, 'I000' )

I get an error saying "Cannot convert integer to item"
But if I use

Collapse JASS:
call UnitAddItemSwapped( 'I000', udg_hero )

It works every time.
Can someone tell me what it is actually doing and how to fix it?
It would be much appreciated. Thank you.
08-20-2009, 01:03 AM#2
Vexorian
native UnitAddItem takes unit whichUnit, item whichItem returns boolean
This function takes an item for second argument.

'I000' is not an item. It is an integer, it is just a number, an item type id.

function UnitAddItemSwapped takes item whichItem, unit whichHero This also takes an item, are you sure it works?