I want to make a script that clear place where spawn trailers. But what I need to do to detect if there trailer or not? You can have a GetClosestVehicle but how I can make it with Trailer?

Did you find a solution ?

i have the same problem, I make a script for truckerjob, I want to detect if the truck and trailer are on the spawn position to avoid duplicate spawn (and explosions).

It would be nice of you to send me the solution if you have found it since the date of your publication.

I already know this about vehicle detection:
for example:

local vehiclepos = GetClosestVehicle(x y z , 10.000, 0, 70)
if (DoesEntityExist(vehiclepos )) then
	--Notify that Vehicle already spawned
    --spawn what you want

I tried that for trailers but it did not work…

local retval, trailer = GetVehicleTrailerVehicle(GetVehiclePedIsIn(ped, false))