This was requested here, so I made it quickly. This script cleans up all unused vehicles automatically
Download is here
Thanks to @MarkViolla, I could improve this script alot, both in functionality and size. Now instead of having to enter a command in the console, the cars will automatically dissapear when the game thinks it doesn’t need it anymore. Also players can noclip into spawned cars to remove them too.
Installation is as usual, put it into the resources folder, then edit the AutoStartResources in your server-config.
Citizen.CreateThread(function() while true do Citizen.Wait(1) car = GetVehiclePedIsIn(GetPlayerPed(-1), false) if car then Citizen.InvokeNative(0xB736A491E64A32CF,Citizen.PointerValueIntInitialized(car)) end end end)