Cleaning the dusts on the cars

Greetings All,

I’ve been looking for the function for cleaning the dusts on vehicles, but still found nothing, has anyone done this before, if so, what’s the function called to do so, Thank you!

Hi,

Something like that ?

1 Like

This is the native for it.

SetVehicleDirtLevel(Vehicle vehicle, float dirtLevel)

1 Like

Nope, thats something like making cars diaappear, but thx for the help still, man! :smiley:

Ahh stupid me, I didnt see that one, thank you so much!

Sorry, I just understand my mistake :stuck_out_tongue:

no problem man, still thx for the help :smiley:

Where do i enter this information at

Where do i enter this information at?

Soo i have this SetVehicleDirtLevel(vehicle, 0)

and i wanna implement it in esx_animation now im looking at the client lua it opens op a menu form config lua how do i implement the SetVehicleDirtLevel(vehicle, 0) in the equal animation

is this correct?

ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'animations_sub',
	{
		title    = title,
		align    = 'top-left',
		elements = elements
	}, function(data, menu)
		local type = data.current.type
		local lib  = data.current.value.lib
		local anim = data.current.value.anim
                local label = data.current.lable

		if type == 'scenario' then
			startScenario(anim)
		elseif type == 'attitude' then
			startAttitude(lib, anim)
		elseif type == 'anim' then
			startAnim(lib, anim)
		end
		
		if lable == 'clean' then
			cleanVehicle()
		end
		
	end, function(data, menu)
		menu.close()
	end)
end

function cleanVehicle()
		local playerPed = PlayerPedId()
        local vehicle   = ESX.Game.GetVehicleInDirection()
        local coords    = GetEntityCoords(playerPed)

        if IsPedSittingInAnyVehicle(playerPed) then
            ESX.ShowNotification(_U('inside_vehicle'))
            return
        end

        if DoesEntityExist(vehicle) then
            IsBusy = true
            TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_MAID_CLEAN", 0, true)
            Citizen.CreateThread(function()
                Citizen.Wait(10000)

                SetVehicleDirtLevel(vehicle, 0)
                ClearPedTasksImmediately(playerPed)

                ESX.ShowNotification(_U('vehicle_cleaned'))
                IsBusy = false
            end)
        end

i changed it around and made it a chat command