OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: CopyrightPhilly on 12 Jun 2005, 15:51:39
-
hey chaps,
ok i'm wanted to use the createunit command but then add the unit to an array so it can b later deleted.
i'm tryed:
_tmpunit = _type createunit [_pos,_group,"",1,"LIEUTENANT"]
unitarray = unitarray + _tmpunit
and also
_type createunit [_pos,_group,"_tmpunit = this",1,"LIEUTENANT"]
unitarray = unitarray + _tmpunit
but it just adds null to the array insted of the unit...
any ideas?
cheers, Phil
-
Try:
unitarray = unitarray + [_tmpunit]
-
sorry my bad, it was already [_tmpunit] otherwise you just get an error about it expecting an array...
still, its just adding null to the array...
cheers, Philly
-
Okay, now try:
_type createunit [_pos,_group,"tmpunit = this",1,"LIEUTENANT"]
unitarray = unitarray + [tmpunit]
In otherwords make it a global name not a local name.
I presume that _type is defined and the unit is being created - you just cannot get its name.
-
that worked
thanks for the help THobson
cheers,
Phil