OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Aglon on 04 Jul 2007, 23:57:52
-
Hello All.
I'm not new to Ofpec but i forgot my old password :whistle: and my old email is gone too.
Now that i finally got a pc cabable of running ArmA back i'm in mission making :D
I got a little problem with deleting units in a group, i want all units deleted exept the groupleader but this little script doesn't work ???
_lead = _this select 0
_grp = group _lead
_units = units group _lead
_units = _units - [leader _grp]
#loop
? leader _grp distance player > 900 : goto "next"
~5
goto "loop"
#next
"deleteVehicle _x" foreach _units
I keep getting an error saying something with a string where code is expected ???
Is something changed since Ofp or have i overlooked something here halv drunk and tired? :D
-
it is not ending in .SQF right?
-
Nope .sqs, sqf is functions right? which is way to advanced for me :)
-
Not really, SQF now is script too.
Change " by { and } in the foreach
{deleteVehicle _x} foreach _units
-
Heh thanks alot, that did it :D