DestroyVehicle: Difference between revisions

From Onset Developer Wiki
(Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|DestroyVehicle(vehicle)}} {{FuncParameters}} {{FuncParam|vehicle|__EDIT_ME__}} {{FuncReturnValue|...")
 
No edit summary
 
Line 1: Line 1:
{{Info|Function|Server|1.0}}
{{Info|Function|Server|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Destroys a vehicle that was previously spawned by [[CreateVehicle]].}}


{{FuncSyntax|DestroyVehicle(vehicle)}}
{{FuncSyntax|DestroyVehicle(vehicle)}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|vehicle|__EDIT_ME__}}
{{FuncParam|vehicle|The vehicle to destroy.}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|Returns '''true''' on success, '''false''' on error.}}


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua">
function cmd_vclean(player)
for _, v in pairs(GetAllVehicles()) do
DestroyVehicle(v)
end
 
AddPlayerChatAll("All vehicles destroyed by "..GetPlayerName(player))
end
AddCommand("vclean", cmd_vclean)
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
{{VehicleFunctions}}

Latest revision as of 20:34, 25 February 2019