SET_VEHICLE_DIRT_LEVEL
Sets the dirt level of the passed vehicle.
Signature
void SET_VEHICLE_DIRT_LEVEL(Vehicle vehicle, float dirtLevel);Parameters
| Name | Type | Description |
|---|---|---|
vehicle | Vehicle | The vehicle to set. |
dirtLevel | float | A number between 0.0 and 15.0 representing the vehicles dirt level. |
Returns void
Description
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
SetVehicleDirtLevel(vehicle, dirtLevel)
-- always works, by hash
Citizen.InvokeNative(0x2b39128b, vehicle, dirtLevel)JavaScript and C#
SetVehicleDirtLevel(vehicle, dirtLevel);
// by hash
Citizen.invokeNative('0x2b39128b', vehicle, dirtLevel + 0.0000001);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. Write10.0orvalue + 0.0. The generated JS wrappers add0.0000001to non-zero floats for the same reason.
See also
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.