Esx_vehicleshop This vehicle does not belong to you

I have the exact same problem as this guy here
I can’t resell the vehicle nor store it in the garage after I just buy it.

I’ve been looking for a solution for weeks now and I tried everything that was said in the forums. I even tried a fresh installation of ESX server with just esx_vehicleshop and its dependencies but the same problem occurs.
Just like the guy who created the topic I linked above, I have the latest versions of all the ESX scripts, I get no errors and the vehicle is properly listed in owned_vehicles table:


Moreover, the plate in the car is the same as the one assigned to it. I’m really not the guy who runs for the community to fix his problems - I left this as the final choice after 2 weeks of searching for a clue. I have nowhere else to go but this amazing community.
I hope someone could help me. Thanks in advance

1 Like

Check in your esx_vehicleshop, server side

I have a feeling that your identifier that you are getting back doesn’t match with the owner in your DB meaning that it will always come back with a “false”

Also check the version of your es_extended, you might have the version which doesnt use Steam ID’s anymore which esx_vehicleshop tends to use.

Yeah I’ve checked that and it didn’t really help as I also had the same problem with the Garage script

This is where the script assigns the vehicle to its owner once you buy it

RegisterServerEvent('esx_vehicleshop:setVehicleOwned')
AddEventHandler('esx_vehicleshop:setVehicleOwned', function (vehicleProps)
	local _source = source
	local xPlayer = ESX.GetPlayerFromId(_source)

	MySQL.Async.execute('INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES (@owner, @plate, @vehicle)',
	{
		['@owner']   = xPlayer.identifier,
		['@plate']   = vehicleProps.plate,
		['@vehicle'] = json.encode(vehicleProps)
	}, function (rowsChanged)
		TriggerClientEvent('esx:showNotification', _source, _U('vehicle_belongs', vehicleProps.plate))
	end)
end)

Maybe you’re correct. I think somehow something is wrong with the es_extended version I have

description ‘ES Extended’
version ‘1.2.0’

Please tell me if there is a newer version than 1.2.0

Latest version it seems

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.