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