Vehicle::setDirtLevel

From RAGE Multiplayer Wiki
Jump to navigation Jump to search

You can't use values greater than 15.0
You can see why here: pastebin.com/Wbn34fGD

Also, R* does (float)(rand() % 15) to get a random dirt level when generating a vehicle.

Syntax

vehicle.setDirtLevel(dirtLevel);

Required Arguments

  • dirtLevel: float

Return value

  • Undefined

Example

// This is an example for sync dirt level.
mp.events.add('entityStreamIn', (entity) => {
    if (entity.type === 'vehicle' && entity.hasVariable('dirtLevel')) entity.getVariable('dirtLevel') ? entity.setDirtLevel(parseFloat(entity.getVariable('dirtLevel'))) : entity.setDirtLevel(0);
});

See also