[ESX] Crypto Customs Dealership Job

  • I buy the car

  • put on display

  • bill player

  • player pay me a bill

  • sell vehicel to player

  • and the plate of the displayed car have another nummer plate.

This is the section your error is coming from

cardealer_vehicles should have the cars the dealership owns and hasnt sold yet (which displays in the menu when press put on display)

once you put it on display from that menu and click sell vehicle

It will change the plate on the displayed dealership car to something new put in owned_vehicles for that player and give both employee and customer notification of the plate change.

will then remove the vehicle from the dealership garage… which is where your issue is. Does the plate on the floor after the sale match the notification? Can the customer park his/her car in the garage regardless of the removal from the dealership garage?

AddEventHandler('esx_CryptosCustoms:sellVehicle', function (vehicle)
	MySQL.Async.fetchAll('SELECT * FROM cardealer_vehicles WHERE vehicle = @vehicle LIMIT 1', {
		['@vehicle'] = vehicle
	}, function (result)
		local id = result[1].id

		MySQL.Async.execute('DELETE FROM cardealer_vehicles WHERE id = @id', {
			['@id'] = id
		})
	end)
end)```

No i get notification for another plate, and he cant park displayed car.

EDIT: Few times it was working correctly

Then the client

SetVehicleNumberPlateText(LastVehicles[#LastVehicles], newPlate)

isnt working
maybe someone is getting in the car or driving it around previous to hitting sell button

@CryptoGenics
first of all a big thank you for this script, it is really good.

but I had a question that is not clear. I wanted to know more about esx_finance. Should we really make the changes with esx_billing?
or does it also work without making any changes with esx_billing? Because I’m using a script and I wish I could use yours too. thank you in any case, you are great. 100%


ill try it again, after server restart.

How to show all cars to players?

I would like to display more cars in same moment, but i think thats not possible here?

If you add my edits to esx_billing it should not effect the script you linked as it just adds another simple column for the amount originally billed for. Although this script just redirects all the triggers to its own script so you would probably have to do my orignal column script edits to Kuanaxd/billing not esx_billing. The only things that use this column are esx_CryptoCustoms if esx_finance = true and esx_finanace to bill the same amount everyday instead of 10% or 100k today 10% of 90k tomorrow.

This is what I would recommend remaking for what you are looking for.

Thank you for the idea. I have implemented jsfour-licenseplate into this. You can collect blank plates and craft them into normal license plates before using through jsfour-licenseplate!

@CryptoGenics
thank you very much for this hyper-fast and sure answer for this script, but here I do not want to use esx_finances with the financial interests. Is there a way to remove it or change? Just the line of code will suffice me. Thanks again a thousand times for this script.

@CryptoGenics
I’m stupid. I just saw that it’s off by default in config.lua

Config.Finance = false -- using Cryptos esx_finance?

sorry for the inconvenience and thanks a billion times for this script :slight_smile: 100% beautiful :wink:

just a last request you say that jsfour-licenseplate is included in the file, so no need to have the script?( jsfour-licenseplate)

yes as I have Config.Finance references if your using esx_finance,if your going to use jsfour-licenseplate put true for Config.License.

1 Like

@CryptoGenics
yes i just understood, i had the old github link of the script that did not have esx_licenceplate = true yet in the config.lua. Everything is ok thanks again for everything you are the best. quick response, beautiful script. You are really great! 10000000000000% :100::yellow_heart::heart_eyes:

Have not tested this, but looking good. Is it by any chance possible to show RP names instad for steam names in the billing section? (Paid & not paid)

I’ve been thinking about how to implement this. As far as i can rap my head around would need to further modify esx_billing similar to adding original section in esx_finance to put character names in as well as steam, then have the boss reference the character names saved in the billing table not the hex ids.

1 Like

Will use this for sure if you do that changes to show character names :slight_smile:

I am pushing an update now so customer first and last name displays, employee still shows steam hex.

1 Like

2 Likes

hi, good job !
the update is online ?