[PAID] [ESX] Immersive Car Wash Experience with wax to keep vehicle clean after carwash

This ain’t your ordinary car wash.
This is a immersive experience for your players AND their passengers. It contains two fully working automatic drive through car washes. One in Little Seoul (with included YMAP) and one in Strawberry. Both with 3 programs including immersive sound and effects and an emergency off-switch. There is also an coupon that could be handed out by your car dealership or mechanics!

But thats not all!
You can create as many hand wash spots as you like where a Ped will clean you car. Also with animation, effects and sound. You can choose the location of the wash-spot and the appearance of the Ped. You want a Bikini-Wash? No problem! Fancy a Sasquatch Carwash in the woods? Say no more fam!

But wait! Theres more!
Are your players tired of the cars always getting dirty that quick? Why not apply some wax coating to keep that filthy dirt away? There are three types of wax coating. The lenght of the protection can be determined in the config file. One is applied by the car wash. The other two can be used from the inventory and start a little animation. You could sell normal wax at the gas station and premium wax at the tuner shop.

If I catched your interest heres a little presentation video:

You can now even add a trigger to your jobs like the mechanic to use the hand wash from this script:
(The player cleaning the car and all passengers inside the car will hear and see the effects)

The code is designed to be lightweight and idles at about 0.01ms
If 3D Text enabled it can get to 0.08ish while car wash and displaying text.

The database table can be cleared at every script start (i.e. server-restart) to keep everything fast.
Or you can choose an interval to check for cars that lost their protection to delete them. (recommended)

Cars that are currently driven and lost their wax effect will delete themselves from the table.

But dont take only my words, here are some testimonials by customers:


(joined from two messages)

Testimonials1

Config File with a lot of options

Config = {}

Config.ESXSHAREDOBJECT = 'esx:getSharedObject' --If you don't know what this is you better not touch it :D

Config.Locale = 'en'					-- Change your language here. If you need an other languga than german or english theres a template for you to translate. Feel free to send me your translation in discord so I can add them to later releases.

Config.Purge = false					-- If true the car_wax table will be cleared at script start. If the server restarts every wax entry is lost and cars must be waxed again.
Config.DeleteRunOuts = true				-- If you want to delete all the run out entries of wax that are still in the database 
Config.DeleteRunOutsInterval = 1800000   -- How often the cleansing of run out wax-entries should take place (default: 1800000 = every 30 min)
Config.EnableMakeDirty = false			-- This is a command I used for testing purposes. /makedirty sets the vehicledirtlevel to max (15.0). If you want to test and play around you can enable it.

Config.Volume = 0.50					-- Here you can control the sound volume of the carwash (Default: 0.50)
Config.EnableBlips = 1					-- 0 to show no blips at all. 1 to show standard carwash blips on the map. 2 to use custom blips (change further below). 
Config.BlipSize = 1.0					-- The size of the carwash blip. (1.0 is default)
Config.BlipSprite = 100					-- The Blip Icon to show on the map/minimap https://docs.fivem.net/docs/game-references/blips/
Config.BlipColor = 0					-- 0 is white (default) For other colors look up: https://docs.fivem.net/docs/game-references/blips/
Config.BlipDisplay = 2					-- https://docs.fivem.net/natives/?_0x9029B2F3DA924928
Config.EnableText = false				-- Enables / disables all 3D-text
Config.EnableHelpMarkers = true			-- Enables / disables the help text in the upper left corner.
Config.EnableSigns = false				-- Enables / disables the text signs above the carwash stations at 'hands on car wash' in strawberry
Config.EnableMarker = true				-- Enables / disables the markers
Config.MarkerType = 2					-- Customize your markers. You can find the types on: https://docs.fivem.net/docs/game-references/markers/
Config.Font = 4 						-- The type of font you want to use for your carwash. ( 2 is default, 1 is cursive, 7 is GTA-Style some do not display properly.) 
Config.RadiusCarwash = 1				-- Higher radius helps to find the right spot when you go into no-marker-not-text-mode (default 1 but increase this to maybe 3 when using no markers/text)
Config.MenuLocationCarwash = 'top-left' -- You can set the alignment of the menu here. Possible options are: left, top-left, top, right, bottom-right, bottom, bottom-left, center
Config.MenuLocationHandwash = 'top-left'-- You can set the alignment of the menu here. Possible options are: left, top-left, top, right, bottom-right, bottom, bottom-left, center
Config.CoolDown = 10					-- Time that needs to pass before the next customer can use the drive through carwash (in seconds, default: 10)

--If you want to use progress bars you can enable them here. If you don't have a progress bar I can recommend you this cool one by Poggu https://forum.cfx.re/t/release-pogress-bar-progress-bar-standalone-smooth-animation/838951
--If you want to use a diffrent progress bar you can change it in the client/notifications.lua
Config.ProgressWax	= false				-- Enable/Disable progress bars for applying wax
Config.ProgressWash = 0					-- Enable/Disable progress bars for car wash (0 is off, 1 is handwash only, 2 is carwash only, 3 is all on)
Config.ProgressPlayerWash = false		-- Enable/Disable progress bars when player is washing a car			

Config.EnablePrice = true				-- Enables / Disables payment at the carwash
Config.Price1 = 25 						-- Price for basic wash, will get rid of most dirt but not all if the car is very dirty
Config.Price2 = 30						-- Price for premium wash (gets car to dirtlevel 0)
Config.Price3 = 35						-- Price for premium wash with wax (holds new dirt off)
Config.Payment = 1						-- How the player should pay for the wash. 0 = cash only, 1 = cash and bank (cash is prefered), 2 = bank only
Config.BankFees = 10					-- If you want to encourage cash payment you can set extra fees the player has to pay when using bank account (in percent. If you want no extra fees just use 0)

Config.AllowBikes = true				--If you wand to block bikes from using drive-through washes set this to false. Bikes may not align correctly and the driver needs to steer.
Config.Align = true						--If you have to align your car correctly at the drive through car wash (+-10 degrees)

Config.Washoff = false					--If true the wax effect will wash off when the car is cleaned (realistic approach). If false car will get clean and wax sealing will stay untouched (gameplay approach).
Config.Interval = 5555					--How often in ms the wax effect should get rid of the dirt. You may increase this on high-pop servers (Smaller interval = more load on client and server) default: 5555
Config.WaxEffectCarwash 	= 1800		--How many seconds the carwash wax will hold any dirt off 		(default 1800 = 30min)
Config.WaxEffect			= 3600		--How many seconds the wax will hold any dirt off 				(default 3600 = 60min)
Config.WaxEffectPremium		= 7200		--How many seconds the premium wax will hold any dirt off 		(default 7200 = 120min)

Config.EnableWaxJob1 = false			-- True to restrict the usage of the basic wax to the jobs you can put below.
Config.WaxJob1 = {'mechanic', 'taxi'}	-- If you set Config.EnableWaxJob1 = true you can put here the jobs that should be allowed like in the example.
Config.EnableWaxJob2 = false			-- True to restrict the usage of the premium wax to the jobs you can put below.
Config.WaxJob2 = {'mechanic'}			-- If you set Config.EnableWaxJob2 = true you can put here the jobs that should be allowed like in the example.

Config.WaxTime1 			= 10.0		--How long it takes to apply the normal wax coating (in seconds)
Config.WaxTime2 			= 15.0		--How long it takes to apply the premium wax coating (in seconds)
Config.Distance2Vehicle 	= 2			--How close you need to be to the vehicle to apply wax. Sometimes big vehicles need a little more distance. (default: 2)

Config.PaySociety = false				--True, if you want the money spent by a player at the car wash places go to a society account. (required esx_addonaccount or similar)
Config.Society = 'society_mechanic'		--If PaySociety = true, this is which account the money should go to
Config.DiffrentSocieties = false		--If true the option above will be ignored and every carwash location can pay to it's own society account.

Config.EnablePed =  true				--Enables / Disables the NPC cleaning your vehicle at handwash spots.
Config.Greeting = true					--Enables / disables voice greeting lines from peds

Config.Locations = {
	vector3(44.25, -1391.84, 29.38),  	-- 'Hands On Carwash' in Strawberry. Minor changes are possible but keep it in close distance. !!Always keep this at place 1 in list !!
	vector3(-700.12, -922.87, 19.00),  	-- Carwash in Little Seoul. Minor changes are possible but keep it in close distance. !! Always keep this at place 2 in list !!
	-- You can add more spots for a handwash. They will be stationary ones.
	vector3(2524.54, 4193.82, 39.60),  	-- Grapeseed [3]
	vector3(216.75, -937.17, 23.61),	-- Legion Square [4]
	vector3(175.22, -1737.09, 28.75),	-- Davis [5]
}
-- Here you can define which Carwash should employ which Ped models https://docs.fivem.net/docs/game-references/ped-models/
-- Choose the ones you want. And start with [3] like in the examples below
-- [1] and [2] are not used because there are no Peds at the drive through car wash.

Config.Models = {}	--Don´t touch. Leave this as is.
Config.Models[3] = {'a_f_y_beach_01', 's_f_y_stripper_01', 's_f_y_baywatch_01'}  	--When you want a random Ped from a selection, put in the Peds like in the examples. Theres no limit how many, but try not to overdo :D
Config.Models[4] = {'s_m_y_clown_01', 'hc_gunman', 'cs_orleans'}
Config.Models[5] = {'g_m_y_famdnf_01'}

Config.OffsetOverride = {} --Don´t touch. Leave this as is.
Config.OffsetOverride[5] = vector3(0.0,2.0,0.0)  	-- The Ped will be spawned by default at an offset of (2.0,0.0.0.0) (x,y,z) from the wash location. If you need it to spawn at a diffrent location you can choose a diffrent offset like in this example)
													-- Just put Config.OffsetOverride[i] = vector3(x,y,z) where "i" stands for the Config.Locations listing place
Config.Societies = {} --Don´t touch. Leave this as is.
Config.Societies[1] = 'society_mechanic' 	-- Society account for Strawberry car wash
Config.Societies[2] = 'society_taxi'		-- Society account for Little Seoul car wash
Config.Societies[3] = 'society_cardealer'	-- Society account for hand wash spot (Grapeseed)
Config.Societies[4] = 'society_police'		-- Society account for hand wash spot (Legion Square)
Config.Societies[5] = 'society_ambulance' 	-- Society account for hand wash spot (Davis)


--Here you can define custom blips for each location if you have set Config.EnableBlips to 2.
-- You can see the diffrent blipsprites and colors here: https://docs.fivem.net/docs/game-references/blips/
-- If you dont want to use a blip for one location set the showBlip to false.
-- You can also set custom blipText to be shown on the map.

Config.Blips = {} --Don´t touch. Leave this as is.
Config.Blips[1] = {showBlip = true, blipSprite = 100, blipText = "Strawberry Carwash", blipColor = 27, blipSize = 1.0, blipDisplay = 2}
Config.Blips[2] = {showBlip = true, blipSprite = 100, blipText = "Little Seoul Carwash", blipColor = 5, blipSize = 1.0, blipDisplay = 2}
Config.Blips[3] = {showBlip = true, blipSprite = 280, blipText = "Bikini Carwash", blipColor = 48, blipSize = 1.3, blipDisplay = 2}
Config.Blips[4] = {showBlip = true, blipSprite = 280, blipText = "Hand Carwash", blipColor = 3, blipSize = 1.0, blipDisplay = 2}
Config.Blips[5] = {showBlip = false}

Comes with english/german/spanish locales, a config file, a YMAP for the little seoul car wash, five sounds and a SQL file (in english or german) for your database.

Get this script at my Tebex store (14,64€):
Fuenfs FiveM Scripts Tebex

Code is accessible No
Subscription-based No
Lines (approximately) 1500
Requirements ESX Legacy / optional: esx_addonaccount
Support Yes
Changenotes <click to expand>

Version 1.5.0

  • Fixed some issues that seemed to appear on high pop servers?
  • Added a bubble particle effect for drive through car wash.
  • When player in police cars opened the car-wash menu the siren triggered on. It’s now shut off immediately.
  • Added (optional) particle effects for player waxing the cars.
  • When using player-handwash or wax all players in configurable area hear and see the effects. Instead of as before only the ones in the vehicle.
  • Used a new more reliable method to check for vehicles when using wax / handwash.
  • Added a little fix against onesync warnings when a vehicle is out of players area.

Version 1.4.0
Additions:

  • Added a sponge item which can be used to clean vehicles.
    • can be job restricted
    • consume can be toggled (for all or for players with job)
      Fixes:
  • Fixed a problem where players in the car would not see the effects of a player hand wash.

Version 1.3.3

  • As of a request the blip creation is now open (in the notifications.lua)
  • Fixed the wax-spray not shutting off after the drive through wash

Version 1.3.0

  • Added traffic lights as an indicator of whether the vehicle is properly positioned.
  • Fixed some warning messages for Entity GetNetworkObject

Version 1.2.4:

  • Added support for ESX Legacy 1.9 (request)

Version 1.2.3:

  • Added the config option to change the currency of the carwash. (request)

Version 1.2.2:

  • Added a (configurable) delay to drive through car washes so that players can’t start immediately after another player. (request)

Version 1.2.1:

  • This version is now independant from sound resources. (no InteractSound needed)

Version 1.2.0:

  • Added options to customize the marker (scale, color, type, height) (request)
  • Added options to customize the text size (request)

Version 1.1.9:

  • Performance Update. Got rid of some unneccessary loops. The script idles now at 0.0ms
  • Changes to the handwash effects

Version 1.1.8:

  • Added the option for bank payment. You can now choose cash, bank or both (if you use both cash will always be preferred). (request)
  • Added the option to have fees on bank payment to encourage cash payment.
  • Prices will do not show anymore in the menu when Config.EnablePayment is set to false.
  • Notifications when payment is collected, are now shown immediatly. So theres is only one notification left at the end of the wash.

Version 1.1.7:

  • Added config options to align the menu (request)
  • Added es.lua (Puerto Rican spanish from JP23. Thank you!)
  • Optimized the code a little

Version 1.1.6:

  • Added the option for progress bars at carwash, waxing and playerwash (all can be toggled separately)(request)
  • Added function to have your own progress bar in functions.lua (request)
  • Added the option to have the ped greet the player (if model has voice-lines for this)

Version 1.1.5:

  • Added size option for carwash blips in config file. (request)
  • Added display options for blips in config file. (request)
  • Added color and sprite options for the standard blip.
  • Added options for required jobs to apply wax in the config. (request)

Version 1.1.4:

  • Added the option to disable all carwash blips in the config file. (request)
  • Made each blip customizable in the config file.

Version 1.1.3:

  • Added the option to have every car wash spot pay to a diffrent society account. (request)

Version 1.1.2:

  • Added option to disable markers and infotext in the upper left corner. (request)
  • Added option to increase the radius of interaction at the carwash & handwash.
  • Added client/notifications.lua where you can add your own notification alerts if you’d like. (request)

Version 1.1.1:

  • Fixed a major bug that caused the cleaning of the cars not getting synced. Please update to this version. :exclamation:

Version 1.1.0:

  • Added a handwash trigger for your jobs (i.e. mechanicjob) (request)

Version 1.0.9:

  • Added two config options for adjusting the time it takes to apply basic or premium wax. (request)

Version 1.0.8:

  • Made the esx:getSharedObject on clientside aswell
  • Added config option to increase the distance in which you can apply wax to a vehicle. (good for bigger vehicles)

Version 1.0.7:

  • Fixed a bug where the paid price was not shown correctly in the notification after the carwash.
  • Fixed a bug where carwash wax-duration was actually the one of the basic car-wax.

Version 1.0.6:

  • Added option for payment to society_account into config file. (request)

Version 1.0.5:

  • Made the deletion of the contents in table car_wax at script start optional (now you can have the wax protection beyond server restart)
  • Wrote a function that will delete cars from table that ran out of wax protection every X milliseconds

Version 1.0.4:

  • deleted an old chunk of code with an unwanted progressBar
  • made esx:getSharedObject configurable

Thanks for reading about my first release :heart:

1 Like

[script:fuenf_carwash] Error loading script server/main.lua in resource fuenf_carwash: ?:-1: attempt to index a nil value (field ‘ESX’)
[script:fuenf_carwash] stack traceback:
[script:fuenf_carwash] ?: in main chunk
[ c-scripting-core] Failed to load script server/main.lua.

You should make the esx:getSharedObject part configurable

Sorry for this inconvenience. I will look into this asap.

Also this problem:

There is a german non translatable text during washing.

1 Like

Sorry, this was a chunk of old code from a year ago. Haven’t noticed it since I had no progressBar on my testserver :sweat_smile:. I got rid of it entirely because I don’t think it is necessary. If you prefer an option to keep the progressBar (in configurable language) let me know :+1:

I reuploaded, version carwash1_0_4 has esx:getSharedObject configurable.
Thanks for pointing out and for buying. I’ll hope you have fun with the script :+1:

1 Like

Other player dont hear and see the car wash

Hi thanks for your feedback. The soudn and effects only work with passengers (to minimize load).
If they don’t work with your passengers do you have any error messages (server or client)? I just tested it to confirm they are working.

Can you optimise bit a wax part? I can see from debug it queries the database in every second. You can just store it on client side which car has been waxed no need to query database every second. Thats big load to a server.

Hmm. As far as I’m concerned every driver should querry the database every 5555ms (default).
Have you tried increasing Config.Interval in the config file?

Storing it clientside would bring problems with other players driving cars that diffrent players waxed. :man_shrugging:

maybe then you could just store in or server side in memory instead of DB it is bit better performance wise.

1 Like

In the beginning I used a table to store it on server side but there were strange outcomes. It was somehow bound to playerID. When I Ieft the Server and came back with new ID the wax was gone.
Also have I read in this Forum that tables tend to get very slow and you should prefer a database.
But I am not sure on that because it was just a dudes opinion.
There are scripts like vehicle mileage that do a lot of querrys and seem to not impact servers that bad.

But I promise I will look further into this.

reading from the above thread, i think i know the answer - but just want to confirm…

If a player applies wax to a car, it saves for the allotted time? IE: server reset, they would still have wax for X time remaining?

Yes and no :smile:
The script saves Licenseplate | Dirtlevel | alotted Time in the Database. :white_check_mark:
It is totally capable to store the data beyond a server reset.
But at the moment the script will clear the database on script-start (i.e. server restart) to keep everything as empty as possible to have lightweight querries.

But you have a point. I will implement a config option to turn this off and do a cleansing of cars that ran out of wax protection every X minutes.

For now if the player is in a car that is in the DB, but with ran out wax protection, it will delete the entry from the DB.

Version 1.0.5 features now optional cleansing of the table at script start.
Wax protection is now working beyond server restart. :+1:
You can choose the interval to search through the car_wax table to delete ran out wax protections.

Config.Purge = false					-- If true the car_wax table will be cleared at script start. If the server restarts every wax entry is lost and cars must be waxed again.
Config.DeleteRunOUts = true				-- If you want to delete all the run out entries of wax that are still in the database 
Config.DeleteRunOutsInterval = 1800000   -- How often the cleansing of run out wax-entries should take place (default: 1800000 = every 30 min)
1 Like

Is it possible to make it so when someone pays for the car wash it is paid to a society as an option in the config please!

I plan to add player management in the future. But it needs more time. For now I could add something like your mentioned society account but every car wash spot would pay into the same society account.

That would be perfect for my needs :smiley:

Okay perfect. I’ll add it later today. First I gotta get some sleep, it’s already 3 a.m. here :+1:

no problem at all matey, thanks for even adding it!

1 Like