[SEMI-RELEASE] esx_jb_stopvehicledespawn

Ah ok. At the moment i insert the stuff in onexit and onenter so when leaving or entering the car.

Only thing is we use advancedgarage and als when we take the vehicle out of the pound we can duplicate it. Cant find a way to delete the one when its out there.
seems a bit tricky.

in my test server i added ā€œpoundedā€ column in db to all car, and when it pound its change to true, and when get out its change to false.
And pound vehicle list call only punded=true cars.

(eden_garage_2)

this fix helped me. But there is still a fix for the pounded section.
after connecting it is possible the car on the basis of the yellow circle to double the car :slightly_frowning_face:

yes i have the same at the moment.
I think Deniel is correct. We would need to modify everythign with an new column or i will try maybe state 2 since there is only 1 and 0

1 Like

If you find a solution, let me know, I would be very happy about it

Wird seems like sometimes the cars are on an other place where they never been.
Then i port to this place and cant see them. But this are the coords in the file.

can someone explain me please how i can use this with esx_drp_garage? I tried everything that i can think off, but i just dont get it to work.
It would be awesome if someone has a solution for me
thanksā™„

Found the problem i think. Since npc cars can have the same plate as i have. WE are using a script from modfreakz for the vehicle store and it seems there is no plate being generated unique the are like the npc cars. This should make the problem :slight_smile:

in vehicleshop not generate unique plate?
I tested it in test server 0 (zero problem with 10 palyers), then in live server, same a @StromaGames, every 40 sec one car spawn duplicateā€¦ :smiley:
so idk how made itā€¦

ok we are only 4 people with around every player has 4 cars out. And so far it looks good without duplicated cars spawning.

on live server we always still 90 player. and random 1 car will duplicate every 40. seconds :smile:

Thats an ugly issue :smiley:

So does anyone can tell me how to use this with esx_drp_garage please? Im trying for weeks, and i just keep getting frustrated

Hello, I follow the instruction give by @Deniel but when i stock the vehicle in the garage, it still in the json file. iā€™m not sure if i do it correctly.

function StockVehicleMenu()
	local playerPed  = GetPlayerPed(-1)
	if IsPedInAnyVehicle(playerPed,  false) then

		local playerPed = GetPlayerPed(-1)
    	local coords    = GetEntityCoords(playerPed)
    	local vehicle = GetVehiclePedIsIn(playerPed,false)     
		local vehicleProps  = ESX.Game.GetVehicleProperties(vehicle)
		local current 	    = GetPlayersLastVehicle(GetPlayerPed(-1), true)
		local engineHealth  = GetVehicleEngineHealth(current)
		local bodyHealth	= GetVehicleBodyHealth(current)
		local fuel			= GetVehicleFuelLevel(current)
		local plate = vehicleProps.plate

		ESX.TriggerServerCallback('eden_garage:stockv',function(valid)

			if (valid) then
				TriggerServerEvent('eden_garage:debug', vehicle)
				--if engineHealth < 990 then
				--	local fraisRep= 0--math.floor((1000 - engineHealth)/1000*Config.Price*Config.DamageMultiplier)
				--	reparation(fraisRep,vehicle,vehicleProps)
				--else
					ranger(vehicle,vehicleProps,engineHealth,bodyHealth,fuel)
					TriggerServerEvent('esx_jb_stopvehicledespawn:vehicleenteredingarage', networkid)
				--end	
			else
				TriggerEvent('esx:showNotification', _U('cannot_store_vehicle'))
			end
		end,vehicleProps)
	else
		TriggerEvent('esx:showNotification', _('no_vehicle_to_enter'))
	end

end

I use esx_eden_garage.

Missing these:

local networkid = NetworkGetNetworkIdFromEntity(vehicle)

Ah i miss that XD thanks a lot

In esx_jb_eden_garage2 where do I need to put those 2 lines?

This is not working :frowning:

ESX.TriggerServerCallback('eden_garage:stockv',function(valid)
	if(valid) then
					
		for k,v in pairs (carInstance) do
			if ESX.Math.Trim(v.plate) == ESX.Math.Trim(vehicleProps.plate) then
				table.remove(carInstance, k)
			end
		end
						
		local networkid = NetworkGetNetworkIdFromEntity(vehicle)
		TriggerServerEvent('esx_jb_stopvehicledespawn:vehicleenteredingarage', networkid)
						
		DeleteEntity(vehicle)
		TriggerServerEvent('eden_garage:modifystate', vehicleProps.plate, true)
		TriggerEvent('esx:showNotification', 'Tu vehĆ­culo ha sido guardado en el Garaje')
	else
		TriggerEvent('esx:showNotification', 'No puedes guardar este vehĆ­culo en el Garaje')
	end
end,vehicleProps, KindOfVehicle, garage, vehicle_type)

Thanks

Did you solved it for Eden Garage2?

Hi, i have the famous duplicate issue but i donā€™t know why, when i test it on my dev server, nothing bad and when i put it in my real server, the issue come. I think itā€™s onesync who repair that, but iā€™m not sure.

Sorry, but its Not working on JB_Eden_Garage2.

There are no entries written in the Jason date, and the cars are gone every time