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| | {{FuncDescription|Destroys a vehicle that was previously spawned by [[CreateVehicle]].}} | ||
{{FuncSyntax|DestroyVehicle(vehicle)}} | {{FuncSyntax|DestroyVehicle(vehicle)}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|vehicle| | {{FuncParam|vehicle|The vehicle to destroy.}} | ||
{{FuncReturnValue| | {{FuncReturnValue|Returns '''true''' on success, '''false''' on error.}} | ||
== Example == | == Example == | ||
<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}} | ||
{{VehicleFunctions}} |
Latest revision as of 20:34, 25 February 2019
Description
Destroys a vehicle that was previously spawned by CreateVehicle.
Syntax
DestroyVehicle(vehicle)
Parameters
- vehicle
The vehicle to destroy.
Return Value
- Returns true on success, false on error.
Example
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)
See also
- CreateVehicle
- DestroyVehicle
- IsValidVehicle
- GetVehicleCount
- GetAllVehicles
- GetVehicleModel
- GetVehicleModelName
- SetVehicleRespawnParams
- IsVehicleStreamedIn
- GetStreamedVehiclesForPlayer
- GetStreamedVehicles
- SetVehicleLocation
- GetVehicleLocation
- SetVehicleRotation
- GetVehicleRotation
- SetVehicleHeading
- GetVehicleHeading
- SetVehicleHealth
- GetVehicleHealth
- SetVehicleLicensePlate
- GetVehicleVelocity
- GetVehicleDriver
- GetVehiclePassenger
- GetVehicleNumberOfSeats
- SetVehicleColor
- GetVehicleColor
- SetVehicleLinearVelocity
- SetVehicleAngularVelocity
- GetVehicleGear
- SetVehicleHoodRatio
- GetVehicleHoodRatio
- SetVehicleTrunkRatio
- GetVehicleTrunkRatio
- StartVehicleEngine
- StopVehicleEngine
- GetVehicleEngineState
- SetVehicleLightEnabled
- GetVehicleLightState
- SetVehicleDamage
- GetVehicleDamage
- AttachVehicleNitro