RedM Natives

SET_VEHICLE_DAMAGE

Apply damage to vehicle at a location.

Hash0x1D7678F81452BB41
Runtime nameSetVehicleDamage
NamespaceVEHICLE
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0xA1DD317EA8FD4F29

Signature

void SET_VEHICLE_DAMAGE(Vehicle vehicle, float xOffset, float yOffset, float zOffset, float damage, float radius, BOOL p6);

Parameters

NameTypeDescription
vehicleVehicle—
xOffsetfloat—
yOffsetfloat—
zOffsetfloat—
damagefloat—
radiusfloat—
p6BOOL—

Returns void

Description

Apply damage to vehicle at a location. Location is relative to vehicle model (not world).

Radius of effect damage applied in a sphere at impact location

Usage

Lua
SetVehicleDamage(vehicle, xOffset, yOffset, zOffset, damage, radius, p6)

-- always works, by hash
Citizen.InvokeNative(0x1D7678F81452BB41, vehicle, xOffset, yOffset, zOffset, damage, radius, p6)
JavaScript and C#
JavaScript
SetVehicleDamage(vehicle, xOffset, yOffset, zOffset, damage, radius, p6);

// by hash
Citizen.invokeNative('0x1D7678F81452BB41', vehicle, xOffset + 0.0000001, yOffset + 0.0000001, zOffset + 0.0000001, damage + 0.0000001, radius + 0.0000001, p6);
C#
Function.Call((Hash)0x1D7678F81452BB41, vehicle, xOffset, yOffset, zOffset, damage, radius, p6);
  • Float parameters: Lua integers (10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write 10.0 or value + 0.0. The generated JS wrappers add 0.0000001 to non-zero floats for the same reason.

Sources

alloc8or RDR3 NativeDB

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.