OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: CopyrightPhilly 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
-
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 think It should work...
this is the Full Thing:
"deletevehicle driver _x" Foreach thislist; "deletevehicle gunner _x" Foreach thislist; "deletevehicle commander _x" Foreach thislist
chek it!
-
You can use nested ForEach commands:
{{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.
{{[_x] Exec "Eject.sqs"} ForEach (Crew _x)} ForEach ThisList
Eject.sqs
_Unit=_This Select 0
_Unit SetPos [0,0,0]
@(_Unit==Vehicle _Unit)
DeleteVehicle _Unit