RedM Natives

SET_VEHICLE_DIRT_LEVEL

Sets the dirt level of the passed vehicle.

Hash0x2B39128B
Runtime nameSetVehicleDirtLevel
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

void SET_VEHICLE_DIRT_LEVEL(Vehicle vehicle, float dirtLevel);

Parameters

NameTypeDescription
vehicleVehicle

The vehicle to set.

dirtLevelfloat

A number between 0.0 and 15.0 representing the vehicles dirt level.

Returns void

Description

Cfx.re native reference

Sets the dirt level of the passed vehicle.

This is the server-side RPC native equivalent of the client native SET_VEHICLE_DIRT_LEVEL.

Usage

Lua
SetVehicleDirtLevel(vehicle, dirtLevel)

-- always works, by hash
Citizen.InvokeNative(0x2b39128b, vehicle, dirtLevel)
JavaScript and C#
JavaScript
SetVehicleDirtLevel(vehicle, dirtLevel);

// by hash
Citizen.invokeNative('0x2b39128b', vehicle, dirtLevel + 0.0000001);
C#
Function.Call((Hash)0x2b39128b, vehicle, dirtLevel);
  • 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.

See also

Sources

Cfx.re native reference

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