Check if Vehicle has any decal other than clan decals

Seems like it, yes, what was the returned value for each decal index?

well it didn’t clean my car when it only had blood splatters (i cleaned it first and then ran over some npcs) so i guess it returned false and only works for clan decals xD

just to clear everthing i’ll give you my server side script aswell

RegisterServerEvent('es_carwash:checkmoney')
AddEventHandler('es_carwash:checkmoney', function (userVehicleDirtLevel, userVehicleHasDecals)
	TriggerEvent('es:getPlayerFromId', source, function (user)
		if userVehicleDirtLevel > 1.0 or userVehicleHasDecals == true then	-- this is the magical if that would make the script continue if the dirt level was greater than 1.0 or the car had decals
			if enableprice == true then
				userMoney = user.getMoney()
				if userMoney >= price then
					user.removeMoney(price)
					TriggerClientEvent('es_carwash:success', source, price)
				else
					moneyleft = price - userMoney
					TriggerClientEvent('es_carwash:notenoughmoney', source, moneyleft)
				end
			else
				TriggerClientEvent('es_carwash:free', source)
			end
		else
			TriggerClientEvent('es_carwash:alreadyclean', source)
		end
	end)
end)

either that or my decal ids are wrong … but i got them from here

What is the output for this

function es_carwash_checkfordecals()
	vehiclehasdecals = false
	for i = 0, #splatterDecals do
		result = DoesVehicleHaveDecal(GetVehiclePedIsUsing(GetPlayerPed(-1)), splatterDecals[i])
		print(string.format("%i: %t",splatterDecals[i],result))
	end
end

it will be false but i’ll do it anyways …

well my client console said result was nil it didn’t even run string.format because of it

bad argument #2 to 'format' (number expected, got nil)

Yeah, I believe function’s code it is not actually checking for actual texture decals on stuff but only for actual vehicular decals and the only one that exists is the clan logo…

It seems like the is no way to check for it :expressionless:

ok this print everything you wanted to print:

print(string.format("%s: %s", tostring(splatterDecals[i]), tostring(result)))

i also think i’m starting the for loop on the wrong index, does lua start on 1 instead of 0 on arrays like every programming language does ?

but yeah it returns false every single time

Lua is weird, it likes to be different, as a result arrays start at 1

Just make a cheap scrub option that uses REMOVE_DECALS_FROM_VEHICLE and decreases the dirt level just a little bit and then a full on power wash option that does both to it’s full extent :stuck_out_tongue:

I’m allowed to get my car to a car wash and let them scrub it and what not even if it is clean and I’ll have to pay the same price! Haha… :expressionless:

bruh, i’m kinda sad i can’t do it … i basically have it ready if only that function did what the name suggests …

i guess you can update the description of the function here and also close this, i don’t think there’s any other possible native function that might be able to do it