Thanks Speck ( ) and Ranger
No problem at all.
Not that this seems to be your problem, but I should have been more clear in what to put in the initialization field. Make sure there's a semicolon between the two commands. E.g.:
enemy1 = group this; deleteVehicle thisWell, I did what you said Ranger, and I got the first 2 steps done. When it comes to the third step, I don't know how to use the CreateUnit command. My Group now is Enemy1?
and my Unitname is S1. I created a marker on the map and named it barracks.
So i tried to do this:
"S1" createUnit [getMarkerPos "barracks", groupEnemy1]
The syntax is as follows (to clarify the comref's listing):
"
unitType" createUnit [[
pos,
group,
init,
skill,
rank ]
unitType = The class name of the unit, such as
SoldierWB,
SoldierEB,
SoldierWLAW, etc. This is
not an arbitrary name that you choose. You can only use the class names (unit types) defined by the game's .pbo files (add-ons).
pos = 3-dimensional position of the unit.
group = The name of the group into which this unit will be created. The group must already exist.
init = Optional. The initialization field (string) of the unit.
skill = Optional. The skill rating of the unit, ranging from 0.2 to 1.
rank = Optional. The rank of the unit.
So, examining what you posted, you made two mistakes. First, you specified the unit type as "S1", which does not exist. You need specify the type of unit you want to create, instead.
Second, you tried to create the unit into a group named "groupEnemy1". However, you didn't create any such group, since your group is really named "enemy1".
A working example of this command could be as follows:
"OfficerWHG" createUnit [getMarkerPos "barracks", enemy1]
This will create a west officer with the M9 at the same position as the marker named "barracks", and put this officer into the group named "enemy1". Since I did not specify the optional parameters init, skill, and rank, those will all acquire the default values of "", 0.5, and "PRIVATE", respectively.