Home   Help Search Login Register  

Author Topic: Delevehicle in Array except the leader?  (Read 1109 times)

0 Members and 1 Guest are viewing this topic.

Offline Aglon

  • Members
  • *
Delevehicle in Array except the leader?
« 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

« Last Edit: 05 Jul 2007, 00:47:25 by Aglon »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Delevehicle in Array except the leader?
« Reply #1 on: 05 Jul 2007, 00:20:43 »
it is not ending in .SQF right?

Offline Aglon

  • Members
  • *
Re: Delevehicle in Array except the leader?
« Reply #2 on: 05 Jul 2007, 00:28:59 »
Nope .sqs, sqf is functions right? which is way to advanced for me :)

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Delevehicle in Array except the leader?
« Reply #3 on: 05 Jul 2007, 00:59:47 »
Not really, SQF now is script too.

Change " by { and } in the foreach

{deleteVehicle _x} foreach _units

Offline Aglon

  • Members
  • *
Re: Delevehicle in Array except the leader?
« Reply #4 on: 05 Jul 2007, 01:08:56 »
Heh thanks alot, that did it :D