Home   Help Search Login Register  

Author Topic: delete unit not the vehicle...  (Read 503 times)

0 Members and 2 Guests are viewing this topic.

CopyrightPhilly

  • Guest
delete unit not the vehicle...
« on: 06 May 2005, 00:01:28 »
hey chaps

what i want to do is delete the unit but not the vehicle IF they are in one...

I'm trying to do with a trigger:
"deletevehicle _x" Foreach thislist

but this will delete the vehicle as well...
any ideas?

cheers,
Phil

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:delete unit not the vehicle...
« Reply #1 on: 06 May 2005, 00:11:14 »
Not sure if this would work, but......

deletevehicle vehiclenamed    .....for driver
deletevehicle vehiclenameg    .....for gunner
deletevehicle vehiclenamec    .....for commander


As I said, I'm not sure if it will work.....and I have no clue about cargo.


Planck
I know a little about a lot, and a lot about a little.

Offline Flauta

  • Members
  • *
  • There is no knownledge, that is no power
    • Chek mi FLog
Re:delete unit not the vehicle...
« Reply #2 on: 06 May 2005, 03:01:00 »
I think It should work...

this is the Full Thing:



Code: [Select]
"deletevehicle driver  _x" Foreach thislist; "deletevehicle gunner  _x" Foreach thislist; "deletevehicle commander  _x" Foreach thislist
chek it!

 

UNN

  • Guest
Re:delete unit not the vehicle...
« Reply #3 on: 06 May 2005, 03:22:17 »
You can use nested ForEach commands:

Code: [Select]
{{DeleteVehicle _x} ForEach (Crew _x)} ForEach ThisList
But I think you might CTD if you try and delete the crew straight out of a vehicle, you might have to SetPos them out first with a slight pause.

Code: [Select]
{{[_x] Exec "Eject.sqs"} ForEach (Crew _x)} ForEach ThisList
Eject.sqs

Code: [Select]
_Unit=_This Select 0
_Unit SetPos [0,0,0]
@(_Unit==Vehicle _Unit)
DeleteVehicle _Unit
« Last Edit: 06 May 2005, 03:23:25 by UNN »