[Release] esx_pdcarshop

Greetings all, this is my first release hope it helps

I created this copying the esx_boatshop, so all credits goes to HumanTree92. With the new esx_eden garage2: 3 in 1 garage and the new esx_policejob Officers can still buy Police cars but cant store in garage anymore cause they dont save in DB unless you put em in the esx_vehicleshop, so i had an idea and thought why not make this for PD. I’m still learning code and have no clue how to make this Job only and have certain cars for each rank, any help on this would be greatly appreciated. So far it works very well and makes it so any police vehicle bought is owned by the officer and will go to car garage. would also like to combine the other vehicles such as police boats and choppers.

You’re making resource based on extremely outdated one. JB’s “new” garage system was compatible with official ESX scripts 2 years ago, but not anymore. He’s using outdated ESX framework, that’s why so many people have problems to implement it in their servers.

Witg latest ESX framework and scripts (and up to date 3rd party garage script) you can buy and store PD and EMS vehicles without any problems.

Anyway, just wanted to leave this here, so people are gonna get the picture.

2 Likes

Thanks for replying greatly appreciated, i am new to this and not a coder in anyway just trying to help as ppl we messaging me asking since i managed to get the boat and aircraft garages to work to help get pd working and this was only way i was able to do it if you have or know of a way to to purchase pd vehicles through latest esx_policejob

Great Release. Thought about doing this a while back. I will be working on Job Vehicle Garages in the near future. However my only problem with this is you can’t limit who takes certain vehicles. For instance if you have 8 Police Cars & you have 8 Police Ranks. You can’t stop a Cadet from buying a Police Chiefs vehicle. The only function that i love about this the most is being able to sell Police Vehicles.

exactly why i posted it so someone who knows how can help out cause i couldnt figure it out

…that’s why you should use latest esx_policejob and ESX in general. It does exactly what you want right out of the box

Not exactly what i want. I would love the ability to sell my Police Vehicles. Last i checked which was earlier today that has not been implemented. Yes it has everything else. But that.

I am using latest esx_policejob and i can buy police vehicles but they dont save in DB therefore they dont save in garage

What are you talking about, they do save In DB, and they do save In garage. You probably have it setten up wrong.

Send link to the one you are using cause i have latest and i changed nothing on it exsept ranks and uniforms, and it doesnt save to db anymore with the garage system

Hey,

I been through this whole situation already multiple times.

I bet you removed the SQL table: job varchar(20) latin1_swedish_ci No None

This is the table that saves the police and any other JOB related vehicle into the DB.

Updating to eden garage DROP TABLE before it updates the new table into MySQL – Revert back to esx_vehicleshop SQLs + just install advanced_garages - I went through 4 garage systems.

  1. Advanced Garage.

  2. JB_Eden_garage2 - way to complicated with the way the vehicle transfer system works. No impounds until you code it in. Everyone was loosing their cars and IDK where to have them go to find them.

  3. Kuana Garage - Not even close to realistic garage types … its a command based garage.

  4. James Made -Super advanced garage system with fancy camera angles and your character actually opens door and exits car before storing — this mod would bring out cars broken off rip.

no i never removed anything in SQL but yes when i added jb_eden_garage2 and it dropped owned_vehicles and made new one i made a backup though maybe i should look at that and see if im missing a table, all my garages work fine everything works 100% except when officers go to the PD garage to buy vehicle it auto goes to the PD garage then you have to pull it out, well that doesnt happen anymore, now when they buy the vehicle it notifies they bought it but no vehicle in garage and when i check DB there is nothing. and on the jb_eden_garage on forum he states it doesnt work and have to add the PD cars to the vehicleshop and i dont want that

As I’ve made it clear with JB on his jb_eden_garage2 post, he is using 2 years old ESX base (…), therefore there will be errors in anything newer from official ESX releases.

If there is something to blame, it’s jb_eden_garage2. esx_advancedgarage works fine. I use esx_drp_garage instead. Saves both PD cars and normal vehicles. Also, the garage from latest esx_policejob allows to store and take out only PD vehicles (but any personal one will see them all natively, which I don’t consider as a problem anyway, as your character paid for them).

My advice is ditch jb_eden_garage2 and update everything to it’s latest versions. And get a new garage script that is actually up to date.

Edit.: I don’t know about selling, but that should be hard to implement into policejob anyway.

Yeah i was using esx_advanced garage had issues so i switched to esx_drp_garage it didnt have separate boat or aircraft garage so i went with jb_eden_garage2, i like this one

Also i managed to get the esx_police job buying police vehicles working now but it wont save in the police garage it saves in reg garage so what i did was take out option to open garage and store vehicle and just put a garage at pd, so i dont need this shop i made but going to keep it up here cause others liked it

Have you found a way to make the marker and blip only visible for police?

nope (20 characters)

So if I download this my vehiclespawner for police officers from the esx_policejob will work again?

No this will make a police vehicle shop. Just like esx_vehicleshop, boatshop, aircraftshop etc, but its not complete it doesnt have job set or ranks

i put new garages only for police cars and in esx_policejob the shop sell “police_car” not “car” in “vehicle_type” and “type”

-- POLICIA (SPANISH)
 	for k,v in pairs (Config.PoliceGarages) do
		exports.ft_libs:AddArea("esx_eden_garage_area_"..k.."_police_garage", {
			marker = {
				weight = v.Marker.w,
				height = v.Marker.h,
				red = v.Marker.r,
				green = v.Marker.g,
				blue = v.Marker.b,
				type = 1,
			},
			trigger = {
				weight = v.Marker.w,
				active = {
					callback = function()
						exports.ft_libs:HelpPromt(v.HelpPrompt)
						if IsControlJustReleased(0, 38) and EsPolicia() and IsInputDisabled(0) and GetLastInputMethod(2) and not IsPedInAnyVehicle(PlayerPedId()) then
							OpenMenuGarage(v, "personal", k, "police_car")
						elseif IsControlJustReleased(1, 38) and not EsPolicia() then
							ESX.UI.Menu.CloseAll()
							Mensaje("No trabajas aquí, este garaje es solo para policías.")
						end
					end,
				},
				exit = {
					callback = exitmarker
				},
			},
			blip = {
				text = v.Name,
				colorId = 77,
				imageId = 50,
			},
			locations = {
				v.Pos				
			},
		})
		exports.ft_libs:AddArea("esx_eden_garage_area_"..k.."_police_spawnpoint", {
			marker = {
				weight = v.SpawnPoint.Marker.w,
				height = v.SpawnPoint.Marker.h,
				red = v.SpawnPoint.Marker.r,
				green = v.SpawnPoint.Marker.g,
				blue = v.SpawnPoint.Marker.b,
				type = 1,
			},
			trigger = {
				weight = v.SpawnPoint.Marker.w,
				active = {
					callback = function()
						exports.ft_libs:HelpPromt(v.SpawnPoint.HelpPrompt)
						if IsControlJustReleased(0, 38) and EsPolicia() and IsInputDisabled(0) and GetLastInputMethod(2) and not IsPedInAnyVehicle(PlayerPedId()) then
							ListVehiclesMenu(v, "personal", k, "police_car")
						elseif IsControlJustReleased(1, 38) and not EsPolicia() then
							ESX.UI.Menu.CloseAll()
							Mensaje("No trabajas aquí, este garaje es solo para policías.")
						end
					end,
				},
				exit = {
					callback = exitmarker
				},
			},
			locations = {
				{
					x = v.SpawnPoint.Pos.x,
					y = v.SpawnPoint.Pos.y,
					z = v.SpawnPoint.Pos.z,
				},
			},
		})
		exports.ft_libs:AddArea("esx_eden_garage_area_"..k.."_police_deletepoint", {
			marker = {
				weight = v.DeletePoint.Marker.w,
				height = v.DeletePoint.Marker.h,
				red = v.DeletePoint.Marker.r,
				green = v.DeletePoint.Marker.g,
				blue = v.DeletePoint.Marker.b,
				type = 1,
			},
			trigger = {
				weight = v.DeletePoint.Marker.w,
				active = {
					callback = function()
						exports.ft_libs:HelpPromt(v.DeletePoint.HelpPrompt)
						if IsControlJustReleased(0, 38) and EsPolicia() and IsInputDisabled(0) and GetLastInputMethod(2) then
							StockVehicleMenu("personal", k, "police_car")
						elseif IsControlJustReleased(1, 38) and not EsPolicia() then
							ESX.UI.Menu.CloseAll()
							Mensaje("No trabajas aquí, este garaje es solo para policías.")
						end
					end,
				},
				exit = {
					callback = exitmarker
				},
			},
			locations = {
				{
					x = v.DeletePoint.Pos.x,
					y = v.DeletePoint.Pos.y,
					z = v.DeletePoint.Pos.z,
				},
			},
		})
	end
function EsPolicia()
	local EsPolicia = false
	TriggerServerEvent('eden_garage:getJob')
	if job ~= nil and job == 'police' then
		EsPolicia = true
	end
	return EsPolicia
end