deleteVehicle: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
[[Category:Scripting Commands|DELETEVEHICLE]]
{{Command|= Comments
[[Category:Scripting Commands OFP 1.96|DELETEVEHICLE]]
____________________________________________________________________________________________
[[Category:Scripting Commands OFP 1.46|DELETEVEHICLE]]
[[Category:Scripting Commands ArmA|DELETEVEHICLE]]


| ofp |= Game name


<h2 style="color:#000066">'''deleteVehicle ''object'''''</h2>
|1.34|= Game version


|arg= global |= Arguments in MP


'''Operand types:'''
|eff= global |= Effects in MP
____________________________________________________________________________________________


'''object:''' [[Object]]
| 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. |= Description
____________________________________________________________________________________________


'''Type of returned value:'''
| '''deleteVehicle''' object |= Syntax


[[Nothing]]
|p1= object: [[Object]] |= Parameter 1


'''Compatibility:'''
| [[Nothing]] |= Return value
____________________________________________________________________________________________
 
|x1= <pre>deleteVehicle tank</pre>


Added in version '''1.34'''
Attention Deleting a vehicle, which is still being accessed by a running script, can cause in a CTD. |= Example 1
____________________________________________________________________________________________


'''Description:'''
| [[createVehicle]], [[createUnit]] |= See also


Delete any unit or vehicle.
}}


Only vehicles inserted in editor or created during mission can be deleted.
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->


Player unit cannot be deleted.
<!-- Note Section END -->
</dl>


<h3 style="display:none">Bottom Section</h3>
Old Notes (temporary):


'''Example:'''
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 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"}


'''deleteVehicle''' tankOne
[[Category:Scripting Commands|DELETEVEHICLE]]
 
[[Category:Scripting Commands OFP 1.96|DELETEVEHICLE]]
 
[[Category:Scripting Commands OFP 1.46|DELETEVEHICLE]]
'''Comments:'''
[[Category:Scripting Commands ArmA|DELETEVEHICLE]]
 
*Since this function will not delete a player unit, a useful multiplayer application is the removal of AI created by players leaving the game.
 
If you run '''deleteVehicle''' for every playable soldier, the AI units will be removed.
 
*If ''unit1'' is a living unit that is currently located inside a vehicle then:
'''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''
 
 
*You need have no concern over attempting to access deleted units in subsequent scripts.
 
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"}

Revision as of 00:45, 2 August 2006

Hover & click on the images for description

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.
Groups:
Uncategorised

Syntax

Syntax:
deleteVehicle object
Parameters:
object: Object
Return Value:
Nothing

Examples

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

Additional Information

See also:
createVehiclecreateUnit

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section

Old Notes (temporary):

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 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"}