Allows us to get the main truck attached to this vehicle. Do note, that trailers can be attached to other trailers. This would get the main vehicle.
Used in: VCMod Main addon.
Shared Entity Vehicle:VC_getTruck()
1. Entity The truck that this trailer is attached to. If we are not attached to anything, returns the trailer entity itself.
2. Integer CurTime() of when it was attached.
concommand.Add("vehicle_getTruck", function() local ent = player.GetAll():GetEyeTraceNoCursor().Entity if IsValid(ent) then local truck, attach_time = ent:VC_getTruck() if IsValid(truck) then print("This trailer is being dragged by "..truck:VC_getName().." since "..(CurTime()-attach_time).." seconds ago.") else print("This trailer is not attached to any trucks!") end else print("Invalid entity.") end end)