HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Create Unit ?

12-16-2008, 11:44 PM#1
Leopard
-My spell uses a lot of location, so i try to use coodinate instead...
-I was searching Jasscraft and found this:

Collapse JASS:
native CreateUnit takes playerid player , integer unitid, real x real y real face return unit

-I tryto create some dmmy units, then remove...

Collapse JASS:
call CreateUnit(p, 'h004', X, Y, 0.00)
call UnitApplyTimedLife(GetLastCreatedUnit(), 'BTLF', 1.50)

-Wahh..but then, the spell neither work nor remove my dummy units. Anyone know why ?
12-17-2008, 12:06 AM#2
Vexorian
Are you new to jass?

Collapse JASS:
set variable =  CreateUnit(p, 'h004', X, Y, 0.00)
call UnitApplyTimedLife(variable, 'BTLF', 1.50)

GetLastCreatedUnit() returns a global variable, CreateNUnitsBJ or whatever that crap is, assigns that global variable, GetLastCreatedUnit() will not work once you do real Jass, like CreateUnit
12-17-2008, 12:09 AM#3
Leopard
Thanks Vexorian..yes i'm new to Jass
-Bahhhh, it works now :)