SetVehicleDamage: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|SetVehicleDamage(vehicle, damageIndex, damage)}} {{FuncParameters}} {{FuncParam|vehicle|__EDIT_ME_..." |
FlyingFork (talk | contribs) |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Info|Function|Server|1.0}} | {{Info|Function|Server|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Sets the vehicle damage for a specific part/region of the vehicle. }} | ||
{{FuncSyntax|SetVehicleDamage(vehicle, damageIndex, damage)}} | {{FuncSyntax|SetVehicleDamage(vehicle, damageIndex, damage)}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|vehicle| | {{FuncParam|vehicle|Vehicle identifier.}} | ||
{{FuncParam|damageIndex| | {{FuncParam|damageIndex|Damage part of the vehicle between 1-8, depending on the vehicle.}} | ||
{{FuncParam|damage| | {{FuncParam|damage|Value between 0.0 (no damage) and 1.0 (full damage).}} | ||
{{FuncReturnValue| | {{FuncReturnValue|Returns '''true''' on success.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
SetVehicleDamage(vehicle, 1, 1.0) -- vehicle totaled | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{VehicleFunctions}} |
Latest revision as of 18:10, 28 May 2021
Description
Sets the vehicle damage for a specific part/region of the vehicle.
Syntax
SetVehicleDamage(vehicle, damageIndex, damage)
Parameters
- vehicle
Vehicle identifier. - damageIndex
Damage part of the vehicle between 1-8, depending on the vehicle. - damage
Value between 0.0 (no damage) and 1.0 (full damage).
Return Value
- Returns true on success.
Example
SetVehicleDamage(vehicle, 1, 1.0) -- vehicle totaled
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