HUD
Functions

Vehicle: get Trailer

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()

Returns

1. Entity The trailer that is attached.

2. Integer CurTime() of when it was attached.

Example

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)
Page modified:
...2019-02-10 23:08:56