Difference between revisions of "deleteVehicle"

From Bohemia Interactive Community
Jump to navigation Jump to search
(deleting MP clients)
(add note re. deleting vehicle crews)
Line 37: Line 37:
  
 
<dd class="notedate">Posted on August 3, 2006 - 14:30</dd>
 
<dd class="notedate">Posted on August 3, 2006 - 14:30</dd>
<dt class="note">'''[[User:Hardrock|hardrock]]'''</dt><dd class="note">''Notes from before the conversion:''
+
<dt class="note">'''[[User:Hardrock|hardrock]]'''</dt>
 +
<dd class="note">''Notes from before the conversion:''
  
 
If you run deleteVehicle for every playable soldier, the AI units will be removed.  
 
If you run deleteVehicle for every playable soldier, the AI units will be removed.  
Line 58: Line 59:
 
</dd>
 
</dd>
  
 +
<dd class="notedate">Posted on January 14, 2009 - 12:35</dd>
 +
<dt class="note">'''[[User:Kronzky|Kronzky]]'''</dt>
 +
<dd class="note">''Units in vehicles cannot be deleted''.<br>
 +
It doesn't matter whether it's the default crew (e.g. {driver car1}), or a unit that has been placed into a vehicle (e.g. {unit1 moveInCargo car1; deleteVehicle unit1}). In either case the unit will stay alive and visible in its position.<br>
 +
To circumvent this limitation, [[Armed_Assault:_Actions_List#Eject|eject]] the unit first, before deleting it.
 +
</dd>
 
<!-- Note Section END -->
 
<!-- Note Section END -->
 
</dl>
 
</dl>

Revision as of 19:07, 14 January 2009

Introduced with Operation Flashpoint version 1.341.34Arguments of this scripting command don't have to be local to the client the command is executed onEffects of this scripting command are broadcasted over the network and happen on every computer in the network
Hover & click on the images for descriptions

Description

Description:
Delete an object. Note that only units inserted in the mission editor and units created during the game's progress can be deleted by this command. Island objects and player units can't be removed.
Multiplayer:
A deleted player unit will stay visible until that player has disconnected.

Syntax

Syntax:
deleteVehicle Object
Parameters:
Object
Return Value:
Nothing

Examples

Example 1:
deleteVehicle _house1
Attention Deleting a vehicle, which is still being accessed by a running script, can result in a CTD.

Additional Information

See also:
createUnitcreateUnit arraycreateVehicle arraycreateVehicleLocalcreateVehicle
Groups:
Uncategorised

Notes

i
Only post proven facts here. Report bugs on the Feedback Tracker and discuss on the Arma Discord or on the Forums.

Notes

Posted on August 3, 2006 - 14:30
hardrock
Notes from before the conversion: If you run deleteVehicle for every playable soldier, the AI units will be removed. deleteVehicle unit1 will result in some very strange, and unwelcome, things happening. A safer way to delete unit1 if it is, or might be, inside a vehicle is: unassignVehicle unit1
unit1 setPos [0,0,0]
deleteVehicle unit1
This is because you cannot call deleteVehicle on a unit (soldier) who's currently inside a Vehicle. The line below works just fine for units that have been deleted. if (alive unit1) then {hint"He is alive"} else {hint"Oh no he's not"}
Posted on January 14, 2009 - 12:35
Kronzky
Units in vehicles cannot be deleted.
It doesn't matter whether it's the default crew (e.g. {driver car1}), or a unit that has been placed into a vehicle (e.g. {unit1 moveInCargo car1; deleteVehicle unit1}). In either case the unit will stay alive and visible in its position.
To circumvent this limitation, eject the unit first, before deleting it.

Bottom Section