Allows us to get the trailer attached to this vehicle. Do note, that trailers can be attached to other trailers.
Used in: VCMod Main addon.
Shared Entity Vehicle:VC_getTrailer()
1. Entity The trailer that is attached.
2. Integer CurTime() of when it was attached.
concommand.Add("vehicle_getTrailer", function()
local ent = player.GetAll()[1]:GetEyeTraceNoCursor().Entity
if IsValid(ent) then
local trailer, attach_time = ent:VC_getTrailer()
if IsValid(trailer) then
print("A vehicle has a trailer: "..trailer:VC_getName().." that was attached "..(CurTime()-attach_time).." seconds ago.")
else
print("This vehicle does not have any trailers attached!")
end
else
print("Invalid entity.")
end
end)