ESX.Game.GetClosestVehicle return 0 fix

I’ve found a thing that maybe can be useful to someone.
In vehicles.meta if theres a flag called FLAG_LAW_ENFORCEMENT in flags tag, when using ESX.Game.GetClosestVehicle(coords, modelFilter) it return 0.
If you remove the flag it works fine.
Hope i will save some mental health for someone.

Do you have a documentation for this flag ? where is located vehicles.meta ?
This function does not seem to work properly on my side.
Always return 0

I was trying to use esx_vehiclelock on police cars and it wasn’t possible because ESX.Game.GetClosestVehicle, was returning 0 and not the id of the car, after this flag has been removed from the car vehicles.meta the function start working, i did this in every police car i’ve added and i was able to use esx_vehiclelock

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